prometheus / common

Go libraries shared across Prometheus components and libraries.
Apache License 2.0
259 stars 306 forks source link

chore: add HumanizeTimestamp; make ConvertToFloat exportable #654

Closed freak12techno closed 1 week ago

freak12techno commented 2 weeks ago

See the discussion here: https://github.com/prometheus/prometheus/pull/14202

Basically copied HumanizeTimestamp from prometheus repo to move it there and added some tests (basically refactored to avoid using templating), the idea is to remove its implementation and the implementation of ConvertToFloat (which are both used in alertmanager and prometheus repos) from both prometheus and alertmanager repos to include the implementation from this repo.

@gotjosh can you check?

freak12techno commented 1 week ago

@machine424 since you reviewed the previous PR on Prometheus repo, maybe you can take a look?

gotjosh commented 1 week ago

You can merge without me @ArthurSens - if this looks go to you, go right ahead.

freak12techno commented 1 week ago

@gotjosh @ArthurSens can either of you bump a version? I'd like to make another PR on Prometheus repo utilizing this and it needs a new version.

Also, appreciate the review.

ArthurSens commented 3 days ago

Sure :)

Let me ping a few people and see if I can proceed with a release!