Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report data from custom collectors #241

Open
mayurkale22 opened this issue Jan 17, 2019 · 4 comments
Open

Report data from custom collectors #241

mayurkale22 opened this issue Jan 17, 2019 · 4 comments

Comments

@mayurkale22
Copy link

mayurkale22 commented Jan 17, 2019

Hi !

This is Mayur from OpenCensus team. Recently we've been working on adding already aggregated metrics data to (Counter, Gauge and Histogram) prom-client. As data is already aggregated it does not make sense to report them using counter.inc(val) and histogram.observe(val);. This client doesn't seem to support custom collectors.

Is it possible to add new APIs similar to https://github.com/prometheus/client_python/blob/624bb61e6f15e0c3739fec853edaea2b91d1674f/prometheus_client/metrics_core.py#L178 and https://github.com/prometheus/client_java/blob/master/simpleclient/src/main/java/io/prometheus/client/Collector.java#L75 to report data from custom collectors?

OR

In order to record already aggregated data with Counter and Histogram, we should include set()/addMetric() method. I think this would be simpler and straight-forward approach.

Let me know your views, I can help you to send PR.

@siimon
Copy link
Owner

siimon commented Jan 21, 2019

I would actually like if prom-client had support for custom collections since it's been requested before too. But for this it might be better to take then more simple approach.. @SimenB, @zbjornson what do you think?

@mayurkale22
Copy link
Author

Any update here?

@siimon
Copy link
Owner

siimon commented Feb 6, 2019

Sorry about the late response..

After giving it some more thought I actually prefer your first suggestion, even if it's more work. I have concerns that if a set function is added to Counters it will be misused and also confusing.

I, however, do not know the requirements specially for custom collectors so I will not be much of help other than code reviewing if anyone is willing to do some work on it!

@christian-2
Copy link

See also #197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants