Skip to content

Add Gauge#set_to_current_time - #287

Merged
Sinjo merged 1 commit into
mainfrom
sinjo-add-gauge-current-timestamp
Jun 13, 2023
Merged

Add Gauge#set_to_current_time#287
Sinjo merged 1 commit into
mainfrom
sinjo-add-gauge-current-timestamp

Conversation

@Sinjo

@Sinjo Sinjo commented Jun 9, 2023

Copy link
Copy Markdown
Member

I was porting some code from Python to Ruby today, and when I went to call this method, I realised we don't have it!

My use-case is to track the last time some code successfully ran.

I'm open to discussing the naming, but I've defaulted to the name used in client_python because it seems good to me.


Fixes #51 (I think?)

I was porting some code from Python to Ruby today, and when I went to
call this method, I realised we don't have it!

My use-case is to track the last time some code successfully ran.

I'm open to discussing the naming, but I've defaulted to the name used
in `client_python` because it seems good to me.

Signed-off-by: Chris Sinjakli <chris@sinjakli.co.uk>
@Sinjo
Sinjo requested a review from dmagliola June 9, 2023 15:41
@electron0zero

Copy link
Copy Markdown
Member

I think we are missing it in client_ruby, and should add it, guide on writing client says Guage SHOULD have this method:

A gauge SHOULD have the following methods:
set_to_current_time(): Set the gauge to the current unixtime in seconds.

source: https://prometheus.io/docs/instrumenting/writing_clientlibs/#gauge

@Sinjo

Sinjo commented Jun 13, 2023

Copy link
Copy Markdown
Member Author

Perfect. Let's do this!

@Sinjo
Sinjo merged commit 7507716 into main Jun 13, 2023
@Sinjo
Sinjo deleted the sinjo-add-gauge-current-timestamp branch June 13, 2023 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants