Custom timestamp in prometheus java client

261 views
Skip to first unread message

Mishanth Pararasasingam (Intern)

unread,
May 30, 2022, 11:20:26 AM5/30/22
to Prometheus Developers
i need to set my custom timestamps to prometheus metrics in java client. But i can't find a way to do that currently. Is there a solution available for this?
there is a similar question in the github. But there seems to be no reply.
some places suggest to use a custom collector(https://github.com/prometheus/client_java/pull/494#issuecomment-517914129) but i am not sure how that will solve this and can't find any useful examples.
How ever i have noticed that in go we have that feature (NewMetricWithTimestamp - https://pkg.go.dev/github.com/prometheus/client_golang/prometheus#NewMetricWithTimestamp)  wondering why doesn't java have such.
Has anybody tried doing this with java client. any help is appreciated.
Reply all
Reply to author
Forward
0 new messages