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

Ability to set CreatedTimestamp on constant histogram metrics #1535

Closed
swar8080 opened this issue Jun 7, 2024 · 1 comment · Fixed by #1537
Closed

Ability to set CreatedTimestamp on constant histogram metrics #1535

swar8080 opened this issue Jun 7, 2024 · 1 comment · Fixed by #1537

Comments

@swar8080
Copy link
Contributor

swar8080 commented Jun 7, 2024

#1313 added created timestamp to the internal histogram data model:

https://github.com/ArthurSens/client_golang/blob/e5639d1dcb98e3f1027e110d11ab9eda54e36f34/prometheus/histogram.go#L1202-L1218

I don't see a way for clients to set the value for created timestamp? Specifically we are trying to use prometheus.NewConstHistogram

I think this is why we're not getting any results when trying to calculate histogram_quantile since our _bucket counts don't start at zero without created timestamp injection. It'd also be nice if the _sum and _count metrics had zero injection.


Curious to know if hiding created timestamp from clients is intentional here, like if this part of the feature is WIP.

swar8080 pushed a commit to swar8080/client_golang that referenced this issue Jun 11, 2024
swar8080 pushed a commit to swar8080/client_golang that referenced this issue Jun 11, 2024
Closes prometheus#1535

Signed-off-by: Steven Swartz <sswartz@ripple.com>
swar8080 pushed a commit to swar8080/client_golang that referenced this issue Jun 11, 2024
Closes prometheus#1535

Signed-off-by: Steven Swartz <sswartz@ripple.com>
@ArthurSens
Copy link
Member

Hmmmm, interesting. We have MustNewConstMetricWithCreatedTimestamp and even an example for it, but I just realize it doesn't cover Histograms.

I'm supportive of adding the same functionality for ConstHistograms and ConstSummaries.

swar8080 pushed a commit to swar8080/client_golang that referenced this issue Jun 29, 2024
Closes prometheus#1535

Signed-off-by: Steven Swartz <sswartz@ripple.com>
swar8080 pushed a commit to swar8080/client_golang that referenced this issue Jun 29, 2024
Closes prometheus#1535

Signed-off-by: Steven Swartz <sswartz@ripple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants