summaryrefslogtreecommitdiff
path: root/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/go.opentelemetry.io/otel/sdk/trace/internal/x')
-rw-r--r--vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/README.md35
-rw-r--r--vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/x.go63
2 files changed, 0 insertions, 98 deletions
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/README.md b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/README.md
deleted file mode 100644
index feec16fa6..000000000
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Experimental Features
-
-The Trace SDK contains features that have not yet stabilized in the OpenTelemetry specification.
-These features are added to the OpenTelemetry Go Trace SDK prior to stabilization in the specification so that users can start experimenting with them and provide feedback.
-
-These features may change in backwards incompatible ways as feedback is applied.
-See the [Compatibility and Stability](#compatibility-and-stability) section for more information.
-
-## Features
-
-- [Self-Observability](#self-observability)
-
-### Self-Observability
-
-The SDK provides a self-observability feature that allows you to monitor the SDK itself.
-
-To opt-in, set the environment variable `OTEL_GO_X_SELF_OBSERVABILITY` to `true`.
-
-When enabled, the SDK will create the following metrics using the global `MeterProvider`:
-
-- `otel.sdk.span.live`
-- `otel.sdk.span.started`
-
-Please see the [Semantic conventions for OpenTelemetry SDK metrics] documentation for more details on these metrics.
-
-[Semantic conventions for OpenTelemetry SDK metrics]: https://github.com/open-telemetry/semantic-conventions/blob/v1.36.0/docs/otel/sdk-metrics.md
-
-## Compatibility and Stability
-
-Experimental features do not fall within the scope of the OpenTelemetry Go versioning and stability [policy](../../../../VERSIONING.md).
-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.
diff --git a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/x.go b/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/x.go
deleted file mode 100644
index 2fcbbcc66..000000000
--- a/vendor/go.opentelemetry.io/otel/sdk/trace/internal/x/x.go
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright The OpenTelemetry Authors
-// SPDX-License-Identifier: Apache-2.0
-
-// Package x documents experimental features for [go.opentelemetry.io/otel/sdk/trace].
-package x // import "go.opentelemetry.io/otel/sdk/trace/internal/x"
-
-import (
- "os"
- "strings"
-)
-
-// SelfObservability is an experimental feature flag that determines if SDK
-// self-observability metrics are enabled.
-//
-// To enable this feature set the OTEL_GO_X_SELF_OBSERVABILITY environment variable
-// to the case-insensitive string value of "true" (i.e. "True" and "TRUE"
-// will also enable this).
-var SelfObservability = newFeature("SELF_OBSERVABILITY", func(v string) (string, bool) {
- if strings.EqualFold(v, "true") {
- return v, true
- }
- return "", false
-})
-
-// Feature is an experimental feature control flag. It provides a uniform way
-// to interact with these feature flags and parse their values.
-type Feature[T any] struct {
- key string
- parse func(v string) (T, bool)
-}
-
-func newFeature[T any](suffix string, parse func(string) (T, bool)) Feature[T] {
- const envKeyRoot = "OTEL_GO_X_"
- return Feature[T]{
- key: envKeyRoot + suffix,
- parse: parse,
- }
-}
-
-// Key returns the environment variable key that needs to be set to enable the
-// feature.
-func (f Feature[T]) Key() string { return f.key }
-
-// 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.
-func (f Feature[T]) Lookup() (v T, ok bool) {
- // https://github.com/open-telemetry/opentelemetry-specification/blob/62effed618589a0bec416a87e559c0a9d96289bb/specification/configuration/sdk-environment-variables.md#parsing-empty-value
- //
- // > The SDK MUST interpret an empty value of an environment variable the
- // > same way as when the variable is unset.
- vRaw := os.Getenv(f.key)
- if vRaw == "" {
- return v, ok
- }
- return f.parse(vRaw)
-}
-
-// Enabled reports whether the feature is enabled.
-func (f Feature[T]) Enabled() bool {
- _, ok := f.Lookup()
- return ok
-}