hs-opentelemetry-api
Copyright(c) Ian Duncan 2026
LicenseBSD-3
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

OpenTelemetry.Metric.InstrumentName

Description

The SDK validates instrument names and units at creation time. The API itself does not validate (per spec), but these functions are used by the SDK to reject invalid names before registering instruments.

Spec: https://opentelemetry.io/docs/specs/otel/metrics/api/#instrument-name-syntax

Synopsis

Documentation

validateInstrumentName :: Text -> Maybe Text Source #

Nothing if valid; Just err with a short English reason if invalid. Implements the stable rules from specificationmetricsapi.md (instrument name ABNF; ASCII only).

Since: 0.0.1.0

validateInstrumentUnit :: Text -> Maybe Text Source #

Unit is optional; when present it must be ASCII and at most 63 code units (specificationmetricsapi.md).

Since: 0.0.1.0