GenAI Telemetry Attributes (otel/attributes.go)

observer · internal/exporter/otel/attributes.go · go · Apache-2.0
analytics, infra, ai, lang:go, tag:knn-classified

Defines semantic convention attribute keys for GenAI operations based on OpenTelemetry standards. Use this to instrument AI model requests and responses for observability.

// Source: https://github.com/superbasedapp/observer | License: Apache-2.0 | Copyright 2026 Gaja AI
// Provided via justclaw.it.com; keep this notice with the code.
package otel

import (
	"go.opentelemetry.io/otel/attribute"

	"github.com/marmutapp/superbased-observer/internal/models"
)

// GenAI semantic-convention attribute keys (spec version v1.41.0). The
// OpenTelemetry contrib repo does not yet publish a Go package for the GenAI
// conventions, so the keys are defined here against the v1.41.0 spec. Values
// follow the convention's well-known enums where one applies (e.g. the
// provider name and operation name).
const (
	keyGenAIProviderName   = "gen_ai.provider.name"
	keyGenAIOperationName  = "gen_ai.operation.name"
	keyGenAIRequestModel   = "gen_ai.request.model"
	keyGenAIRespons

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key