Skip to content

Commit 79b8ffd

Browse files
committed
Document OTEL_SEMCONV_STABILITY_OPT_IN environment variable
Add documentation explaining how to use the OTEL_SEMCONV_STABILITY_OPT_IN environment variable to control semantic convention stability opt-in for HTTP instrumentations. Fixes: #4202
1 parent 5560324 commit 79b8ffd

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,31 @@ To release a package as `1.0` stable, the package:
103103

104104
In our efforts to maintain optimal user experience and prevent breaking changes for transitioning into stable semantic conventions, OpenTelemetry Python is adopting the semantic convention migration plan for several instrumentations. Currently this plan is only being adopted for [HTTP-related instrumentations](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/non-normative/http-migration.md), but will eventually cover all types. Please refer to the `semconv status` column of the [instrumentation README](instrumentation/README.md) of the current status of instrumentations' semantic conventions. The possible values are `development`, `stable` and `migration` referring to [status](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.31.0/specification/document-status.md#lifecycle-status) of that particular semantic convention. `Migration` refers to an instrumentation that currently supports the migration plan.
105105

106+
### Opting into stable semantic conventions
107+
108+
You can control which semantic conventions are used by setting the `OTEL_SEMCONV_STABILITY_OPT_IN` environment variable. This is useful for transitioning from experimental to stable semantic conventions.
109+
110+
For HTTP instrumentations, set `OTEL_SEMCONV_STABILITY_OPT_IN` to:
111+
112+
- `http` - Emit the new, stable HTTP and networking conventions, and stop emitting the old experimental HTTP and networking conventions that the instrumentation emitted previously.
113+
- `http/dup` - Emit both the old and the stable HTTP and networking conventions, allowing for a seamless transition.
114+
115+
By default (when the environment variable is not set), the old experimental HTTP and networking conventions are emitted.
116+
117+
Example:
118+
```bash
119+
# Use stable HTTP conventions only
120+
export OTEL_SEMCONV_STABILITY_OPT_IN=http
121+
122+
# Emit both old and new conventions for transition
123+
export OTEL_SEMCONV_STABILITY_OPT_IN=http/dup
124+
```
125+
126+
You can also combine multiple opt-ins using commas:
127+
```bash
128+
export OTEL_SEMCONV_STABILITY_OPT_IN=http,database/dup
129+
```
130+
106131
## Contributing
107132

108133
See [CONTRIBUTING.md](CONTRIBUTING.md)

0 commit comments

Comments
 (0)