or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
golangpkg:golang/github.com/prometheus/client_model@v0.6.2
tile.json

tessl/golang-github-com-prometheus--client-model

tessl install tessl/golang-github-com-prometheus--client-model@0.6.1

Data 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%

task.mdevals/scenario-7/

Counter Metric Builder

Produce a serialized Prometheus counter metric payload that captures a single sample with contextual labels, an exemplar, and a creation timestamp.

Capabilities

Emits counter metric bytes

  • Given name, help text, value, and labels, return protobuf-encoded bytes for a single metric family containing one counter metric with those labels and value and no extra metrics. @test

Attaches exemplar

  • When exemplar labels, value, and millisecond timestamp are provided, the encoded counter includes an exemplar carrying those labels, value, and timestamp. @test

Records creation timestamp

  • Provided creation timestamp (milliseconds) populates the counter's creation timestamp while leaving the per-sample timestamp unset; a zero value omits the creation timestamp. @test

Validates required fields

  • Missing metric name or a negative exemplar timestamp results in an error and no bytes returned. @test

Implementation

@generates

API

package eval

type CounterInput struct {
    Name                string
    Help                string
    Labels              map[string]string
    Value               float64
    ExemplarValue       float64
    ExemplarTimestampMs int64
    ExemplarLabels      map[string]string
    CreatedTimestampMs  int64
}

func BuildCounterMetric(input CounterInput) ([]byte, error)

Dependencies { .dependencies }

github.com/prometheus/client_model/go { .dependency }

Provides Prometheus metric data model types for constructing counter metrics with exemplars and creation timestamps.