-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using timestamp from api as timestamp in promehteous metric #80
Comments
It's possible, but usually not what you want. Timestamps are meant for TSDB federation. They disable staleness handling and can break monitoring if you're not careful. |
I couldn't find an example config to make it happen. would you please help me?
How should I add the timestamp to the config? |
I think what @SuperQ was trying to convey was that Prometheus supports the concept of creating metrics with explicit timestamp. This exporter however, does not currently support providing external timestamps with the scrapes. |
This fixes prometheus-community#80 Signed-off-by: Jérôme LOYET <822436+fatpat@users.noreply.github.com>
This fixes prometheus-community#80 Signed-off-by: Jérôme LOYET <822436+fatpat@users.noreply.github.com>
This fixes prometheus-community#80 Signed-off-by: Jérôme LOYET <822436+fatpat@users.noreply.github.com>
See the PR #97 which adds the option to fetch the timestamp from the json: ---
metrics:
- name: example
path: "{ .data }"
timestamp: "{ .date }"
help: Example
labels:
label: '{.label}'
values:
metrics: '{.value}' |
This fixes prometheus-community#80 Signed-off-by: Jérôme LOYET <822436+fatpat@users.noreply.github.com>
From the discussion on #97, a possible way to do this can be to export the timestamp as a metric. If you can send a PR for this, it can be reviewed. You can also try to use the feature from #69 if your server supports providing metrics for a given time period (for example, scrape every minute and get the metrics in the time period: from Modifying the timestamps can break monitoring in case of inaccurate data, therefore it is not an option. |
based on prometheus-community#97 and prometheus-community#80 this provides the posibility to use a metric that has a unix style timestamp as the timestamp of the scraped metric
based on prometheus-community#97 and prometheus-community#80 this provides the posibility to use a metric that has a unix style timestamp as the timestamp of the scraped metric When deserializing objects we need to take the key json path into account as well like we would do for all the values as well. This allows collections to be defined still with each entry having a separate timestamp (e.g. list of time-stamped log messages). Update examples for timestamp Update Readme about staleness for custom timestamps
based on prometheus-community#97 and prometheus-community#80 this provides the posibility to use a metric that has a unix style timestamp as the timestamp of the scraped metric When deserializing objects we need to take the key json path into account as well like we would do for all the values as well. This allows collections to be defined still with each entry having a separate timestamp (e.g. list of time-stamped log messages). Update examples for timestamp Update Readme about staleness for custom timestamps Signed-off-by: Jan Phillip Kretzschmar <janphkre@gmx.de>
based on prometheus-community#97 and prometheus-community#80 this provides the posibility to use a metric that has a unix style timestamp as the timestamp of the scraped metric When deserializing objects we need to take the key json path into account as well like we would do for all the values as well. This allows collections to be defined still with each entry having a separate timestamp (e.g. list of time-stamped log messages). Update examples for timestamp Update Readme about staleness for custom timestamps Signed-off-by: Jan Phillip Kretzschmar <janphkre@gmx.de>
based on prometheus-community#97 and prometheus-community#80 this provides the posibility to use a metric that has a unix style timestamp as the timestamp of the scraped metric When deserializing objects we need to take the key json path into account as well like we would do for all the values as well. This allows collections to be defined still with each entry having a separate timestamp (e.g. list of time-stamped log messages). Update examples for timestamp Update Readme about staleness for custom timestamps Signed-off-by: Jan Phillip Kretzschmar <janphkre@gmx.de>
* Pick timestamp from metric based on #97 and #80 this provides the posibility to use a metric that has a unix style timestamp as the timestamp of the scraped metric When deserializing objects we need to take the key json path into account as well like we would do for all the values as well. This allows collections to be defined still with each entry having a separate timestamp (e.g. list of time-stamped log messages). Update examples for timestamp Update Readme about staleness for custom timestamps Signed-off-by: Jan Phillip Kretzschmar <janphkre@gmx.de> Signed-off-by: Ben Kochie <superq@gmail.com> Co-authored-by: Ben Kochie <superq@gmail.com>
Is there a way to use timestamp from the api data as timestamp in output result? in promehteous documentation in instrumentation part there is :
I have this data from my api:
is it possible to get output like this?
The text was updated successfully, but these errors were encountered: