Skip to content

Add support for parsing timestamps.#483

Merged
brian-brazil merged 2 commits intoprometheus:masterfrom
asherf:parse_ts_2
Oct 29, 2019
Merged

Add support for parsing timestamps.#483
brian-brazil merged 2 commits intoprometheus:masterfrom
asherf:parse_ts_2

Conversation

@asherf
Copy link
Copy Markdown
Contributor

@asherf asherf commented Oct 26, 2019

Closes: #461

Signed-off-by: Asher Foa <asher@asherfoa.com>
b = CounterMetricFamily("b", "help", value=2)
a.add_metric(["bar"], 1, timestamp=0)
b = CounterMetricFamily("b", "help")
b.add_metric([], 2, timestamp=1234567890)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't right, Prometheus timestamp are in milliseconds whereas the Python client is using the OpenMetrics data model so is working in seconds.

…reas the Python client is using the OpenMetrics data model so is working in seconds.

Signed-off-by: Asher Foa <asher@asherfoa.com>
@asherf asherf requested a review from brian-brazil October 29, 2019 16:59
@brian-brazil brian-brazil merged commit f11b6d9 into prometheus:master Oct 29, 2019
@brian-brazil
Copy link
Copy Markdown
Contributor

Thanks!

@asherf asherf deleted the parse_ts_2 branch October 29, 2019 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Difference in parser behaviour compared to prometheus/common/expfmt

2 participants