x

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

Experimental Features

The SDK contains features that have not yet stabilized in the OpenTelemetry specification. These features are added to the OpenTelemetry Go SDK prior to stabilization in the specification so that users can start experimenting with them and provide feedback.

These feature may change in backwards incompatible ways as feedback is applied. See the Compatibility and Stability section for more information.

Features

Resource

OpenTelemetry resource semantic conventions include many attribute definitions that are defined as experimental. To have experimental semantic conventions be added by resource detectors set the OTEL_GO_X_RESOURCE environment variable. The value set must be the case-insensitive string of "true" to enable the feature. All other values are ignored.

Examples

Enable experimental resource semantic conventions.

export OTEL_GO_X_RESOURCE=true

Disable experimental resource semantic conventions.

unset OTEL_GO_X_RESOURCE

Compatibility and Stability

Experimental features do not fall within the scope of the OpenTelemetry Go versioning and stability policy. These features may be removed or modified in successive version releases, including patch versions.

When an experimental feature is promoted to a stable feature, a migration path will be included in the changelog entry of the release. There is no guarantee that any environment variable feature flags that enabled the experimental feature will be supported by the stable version. If they are supported, they may be accompanied with a deprecation notice stating a timeline for the removal of that support.

Documentation

Overview

Package x contains support for OTel 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

Constants

This section is empty.

Variables

View Source
var Resource = newFeature("RESOURCE", func(v string) (string, bool) {
	if strings.ToLower(v) == "true" {
		return v, true
	}
	return "", false
})

Resource is an experimental feature flag that defines if resource detectors should be included experimental semantic conventions.

To enable this feature set the OTEL_GO_X_RESOURCE environment variable to the case-insensitive string value of "true" (i.e. "True" and "TRUE" will also enable this).

Functions

This section is empty.

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 returns if 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.

Jump to

Keyboard shortcuts

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