Skip to content
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

Need to add timestamp in data series before reporting to prometheus #492

Open
winattack opened this issue May 19, 2023 · 0 comments
Open

Comments

@winattack
Copy link

Is your feature request related to a problem? Please describe.
default timestamp mechanism will lead to wrong statistics due to network shaking

Describe the solution you'd like
like go client, add NewMetricWithTimestamp support

// Create a constant gauge from values we got from an external
// temperature reporting system. Those values are reported with a slight
// delay, so we want to add the timestamp of the actual measurement.
temperatureReportedByExternalSystem := 298.15
timeReportedByExternalSystem := time.Date(2009, time.November, 10, 23, 0, 0, 12345678, time.UTC)
s := prometheus.NewMetricWithTimestamp(
timeReportedByExternalSystem,
prometheus.MustNewConstMetric(
desc, prometheus.GaugeValue, temperatureReportedByExternalSystem,
),
)

@winattack winattack changed the title Need to add timestamp in data series before reporting to promotheus Need to add timestamp in data series before reporting to prometheus May 19, 2023
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

No branches or pull requests

1 participant