tessl install tessl/golang-github-com-prometheus--client-model@0.6.1Data model artifacts for Prometheus
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.13x
Baseline
Agent success rate without this tile
82%
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