package x

import "go.opentelemetry.io/otel/sdk/metric/internal/x"

Package x contains support for OTel metric SDK experimental features.

This package should only be used for features defined in the specification. It should not be used for experiments or new project ideas.

Index

Types

type Feature

type Feature[T any] struct {
	// contains filtered or unexported fields
}

Feature is an experimental feature control flag. It provides a uniform way to interact with these feature flags and parse their values.

func (Feature[T]) Enabled

func (f Feature[T]) Enabled() bool

Enabled reports whether the feature is enabled.

func (Feature[T]) Key

func (f Feature[T]) Key() string

Key returns the environment variable key that needs to be set to enable the feature.

func (Feature[T]) Lookup

func (f Feature[T]) Lookup() (v T, ok bool)

Lookup returns the user configured value for the feature and true if the user has enabled the feature. Otherwise, if the feature is not enabled, a zero-value and false are returned.

Source Files

x.go

Version
v1.43.0 (latest)
Published
Apr 3, 2026
Platform
linux/amd64
Imports
1 packages
Last checked
1 day ago

Tools for package owners.