From f62664a8e98a4ddc67ed8a1fa3d0f6eda0ff4f86 Mon Sep 17 00:00:00 2001 From: Manik Rana Date: Wed, 10 Jul 2024 10:06:26 +0530 Subject: [PATCH] feat: document CreatedTimestamp func Signed-off-by: Manik Rana --- model/textparse/openmetricsparse.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/textparse/openmetricsparse.go b/model/textparse/openmetricsparse.go index e640caf4ef..b90fe93592 100644 --- a/model/textparse/openmetricsparse.go +++ b/model/textparse/openmetricsparse.go @@ -226,8 +226,8 @@ func (p *OpenMetricsParser) Exemplar(e *exemplar.Exemplar) bool { return true } -// CreatedTimestamp returns nil as it's not implemented yet. -// TODO(bwplotka): https://github.com/prometheus/prometheus/issues/12980 +// CreatedTimestamp returns the created timestamp as *int64 of a given Metric. +// It searches for the _created line of a given metric and uses an ephemeral createdTimestampParser to peek ahead and find the _created line. func (p *OpenMetricsParser) CreatedTimestamp() *int64 { var lbs labels.Labels p.Metric(&lbs)