CtrlK
BlogDocsLog inGet started
Tessl Logo

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

Data model artifacts for Prometheus

Overall
score

93%

Evaluation93%

1.13x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-7/

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.

Install with Tessl CLI

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

tile.json