Repository navigation
Add timestamp field support - #69
Conversation
siimon
left a comment
There was a problem hiding this comment.
Looks good overall, just got a question that you could answer..
Have you verified this so Prometheus is able to scrape metrics with time stamps?
| if(isNumber(labels) || !labels) { | ||
| return inc.call(this, null)(labels); | ||
| return inc.call(this, null)(labels, value); | ||
| } |
There was a problem hiding this comment.
Not sure why value is added here
There was a problem hiding this comment.
If labels is a number or falsy then it's used as a value. Consequently, the next argument (value) is used as a timestamp.
There was a problem hiding this comment.
Gotcha!
Might rename the variable then so it makes more sense, I can do that later on if you don't want to do it..
| Gauge.prototype.set = function(labels, value, timestamp) { | ||
| if(isNumber(labels)) { | ||
| return set.call(this, null)(labels); | ||
| return set.call(this, null)(labels, value); |
There was a problem hiding this comment.
Same here, I'm probably missing something :)
Yes, already verified. |
|
Another thing, we need to update the typescript definitions as well, as in the other comment, if you don't want to do it I can do it after this PR is merged |
|
Any news here? 😄 |
According to exposition format specification https://prometheus.io/docs/instrumenting/exposition_formats/