Data model artifacts for Prometheus
Overall
score
93%
Evaluation — 93%
↑ 1.13xAgent success when using this tile
Build a protobuf payload for a single counter metric that carries exemplar context (labels, value, timestamp) without leaking exemplar labels into the metric's base label set.
method=GET and status=200, attaches an exemplar containing trace_id=abc-123, exemplar value 0.42, and timestamp 2023-11-20T10:00:00Z, and returns bytes that decode back to those exact values. @testservice=checkout and region=us-east-1, while exemplar labels remain trace_id=xyz-789 and span_id=def-456, with no cross-contamination between the two label sets. @test@generates
package exemplar
import "time"
// MarshalCounterWithExemplar builds a single-sample counter metric payload with an exemplar and returns the protobuf bytes.
func MarshalCounterWithExemplar(
metricName string,
metricLabels map[string]string,
exemplarLabels map[string]string,
counterValue float64,
exemplarValue float64,
exemplarTime time.Time,
) ([]byte, error)Provides protobuf data model types for metrics and exemplars.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/golang-github-com-prometheus--client-modeldocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10