MCPcopy
hub / github.com/prometheus/client_golang / NewMetricWithTimestamp

Function NewMetricWithTimestamp

prometheus/metric.go:170–172  ·  view source on GitHub ↗

NewMetricWithTimestamp returns a new Metric wrapping the provided Metric in a way that it has an explicit timestamp set to the provided Time. This is only useful in rare cases as the timestamp of a Prometheus metric should usually be set by the Prometheus server during scraping. Exceptions include m

(t time.Time, m Metric)

Source from the content-addressed store, hash-verified

168// millisecond resolution. Thus, the provided time will be rounded down to the
169// next full millisecond value.
170func NewMetricWithTimestamp(t time.Time, m Metric) Metric {
171 return timestampedMetric{Metric: m, t: t}
172}
173
174type withExemplarsMetric struct {
175 Metric

Callers 2

Calls

no outgoing calls

Tested by 2