otel

package
v1.4.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package otel provides OpenTelemetry instrumentation utilities for the registry server.

Index

Constants

View Source
const (
	AttrRegistryName  = attribute.Key("registry.name")
	AttrRegistryType  = attribute.Key("registry.type")
	AttrServerName    = attribute.Key("server.name")
	AttrServerVersion = attribute.Key("server.version")
	AttrPageSize      = attribute.Key("pagination.limit")
	AttrResultCount   = attribute.Key("result.count")
	AttrHasCursor     = attribute.Key("pagination.has_cursor")
)

Common attribute keys for business context used across the application. Using shared keys ensures consistent attribute naming in traces.

Variables

This section is empty.

Functions

func RecordError

func RecordError(span trace.Span, err error)

RecordError records an error on a span and sets the span status to error. It safely handles nil spans and nil errors. Note: The status description is intentionally generic to prevent sensitive information (e.g., SQL queries, connection strings) from appearing in trace status. The full error details are still available via span events for debugging.

func StartSpan

func StartSpan(
	ctx context.Context,
	tracer trace.Tracer,
	name string,
	opts ...trace.SpanStartOption,
) (context.Context, trace.Span)

StartSpan starts a new span if the tracer is non-nil, otherwise returns a no-op span. This provides graceful degradation when tracing is disabled.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL