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-4/

Gauge Metric Payload

Build a binary representation of a single gauge metric for Prometheus protobuf exposition.

Capabilities

Single gauge metric

  • Produces a payload representing exactly one metric family of type gauge using the provided name, help text, and unit; contains a single metric with label pairs and a floating-point value matching the input. @test

Optional timestamp

  • When a timestamp (milliseconds since epoch) is supplied, the metric includes it; when omitted, no timestamp is set. @test

Input validation

  • Returns an error when the name is empty or labels include an empty key; accepts an empty label map as a valid case. @test

Implementation

@generates

API

type GaugeInput struct {
    Name            string
    Help            string
    Unit            string
    Value           float64
    Labels          map[string]string
    TimestampMillis *int64
}

func BuildGaugePayload(in GaugeInput) ([]byte, error)

Dependencies { .dependencies }

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

Provides metric protobuf messages for encoding gauge metrics.