Skip to content

Commit f74ce39

Browse files
committed
docs: move semconv opt-in docs to HTTP instrumentations
1 parent 79b8ffd commit f74ce39

14 files changed

Lines changed: 221 additions & 25 deletions

File tree

  • instrumentation
    • opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client
    • opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server
    • opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi
    • opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon
    • opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi
    • opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask
    • opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx
    • opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid
    • opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests
    • opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado
    • opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3
    • opentelemetry-instrumentation-urllib/src/opentelemetry/instrumentation/urllib
    • opentelemetry-instrumentation-wsgi/src/opentelemetry/instrumentation/wsgi

README.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -103,31 +103,6 @@ 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-
131106
## Contributing
132107

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

instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,23 @@ def response_hook(span: Span, params: typing.Union[
189189
Note:
190190
The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change.
191191
192+
Stable Semantic Conventions
193+
***************************
194+
195+
This instrumentation supports the semantic convention migration plan. You can control
196+
which semantic conventions are emitted by setting the
197+
``OTEL_SEMCONV_STABILITY_OPT_IN`` environment variable.
198+
199+
For HTTP instrumentations, set ``OTEL_SEMCONV_STABILITY_OPT_IN`` to:
200+
201+
- ``http`` - emit the stable HTTP and networking conventions, and stop emitting
202+
the old experimental HTTP and networking conventions.
203+
- ``http/dup`` - emit both the old experimental and stable HTTP and networking
204+
conventions during a transition period.
205+
206+
By default, when the environment variable is not set, the old experimental HTTP
207+
and networking conventions are emitted.
208+
192209
API
193210
---
194211
"""

instrumentation/opentelemetry-instrumentation-aiohttp-server/src/opentelemetry/instrumentation/aiohttp_server/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,23 @@ async def hello(request):
150150
Note:
151151
The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change.
152152
153+
Stable Semantic Conventions
154+
***************************
155+
156+
This instrumentation supports the semantic convention migration plan. You can control
157+
which semantic conventions are emitted by setting the
158+
``OTEL_SEMCONV_STABILITY_OPT_IN`` environment variable.
159+
160+
For HTTP instrumentations, set ``OTEL_SEMCONV_STABILITY_OPT_IN`` to:
161+
162+
- ``http`` - emit the stable HTTP and networking conventions, and stop emitting
163+
the old experimental HTTP and networking conventions.
164+
- ``http/dup`` - emit both the old experimental and stable HTTP and networking
165+
conventions during a transition period.
166+
167+
By default, when the environment variable is not set, the old experimental HTTP
168+
and networking conventions are emitted.
169+
153170
API
154171
---
155172
"""

instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,23 @@ def client_response_hook(span: Span, scope: Scope, message: dict[str, Any]):
204204
Note:
205205
The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change.
206206
207+
Stable Semantic Conventions
208+
***************************
209+
210+
This instrumentation supports the semantic convention migration plan. You can control
211+
which semantic conventions are emitted by setting the
212+
``OTEL_SEMCONV_STABILITY_OPT_IN`` environment variable.
213+
214+
For HTTP instrumentations, set ``OTEL_SEMCONV_STABILITY_OPT_IN`` to:
215+
216+
- ``http`` - emit the stable HTTP and networking conventions, and stop emitting
217+
the old experimental HTTP and networking conventions.
218+
- ``http/dup`` - emit both the old experimental and stable HTTP and networking
219+
conventions during a transition period.
220+
221+
By default, when the environment variable is not set, the old experimental HTTP
222+
and networking conventions are emitted.
223+
207224
API
208225
---
209226
"""

instrumentation/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,23 @@ def response_hook(span, req, resp):
180180
Note:
181181
The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change.
182182
183+
Stable Semantic Conventions
184+
***************************
185+
186+
This instrumentation supports the semantic convention migration plan. You can control
187+
which semantic conventions are emitted by setting the
188+
``OTEL_SEMCONV_STABILITY_OPT_IN`` environment variable.
189+
190+
For HTTP instrumentations, set ``OTEL_SEMCONV_STABILITY_OPT_IN`` to:
191+
192+
- ``http`` - emit the stable HTTP and networking conventions, and stop emitting
193+
the old experimental HTTP and networking conventions.
194+
- ``http/dup`` - emit both the old experimental and stable HTTP and networking
195+
conventions during a transition period.
196+
197+
By default, when the environment variable is not set, the old experimental HTTP
198+
and networking conventions are emitted.
199+
183200
API
184201
---
185202
"""

instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,23 @@ def client_response_hook(span: Span, scope: dict[str, Any], message: dict[str, A
176176
Note:
177177
The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change.
178178
179+
Stable Semantic Conventions
180+
***************************
181+
182+
This instrumentation supports the semantic convention migration plan. You can control
183+
which semantic conventions are emitted by setting the
184+
``OTEL_SEMCONV_STABILITY_OPT_IN`` environment variable.
185+
186+
For HTTP instrumentations, set ``OTEL_SEMCONV_STABILITY_OPT_IN`` to:
187+
188+
- ``http`` - emit the stable HTTP and networking conventions, and stop emitting
189+
the old experimental HTTP and networking conventions.
190+
- ``http/dup`` - emit both the old experimental and stable HTTP and networking
191+
conventions during a transition period.
192+
193+
By default, when the environment variable is not set, the old experimental HTTP
194+
and networking conventions are emitted.
195+
179196
API
180197
---
181198
"""

instrumentation/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,23 @@ def response_hook(span: Span, status: str, response_headers: List):
189189
Note:
190190
The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change.
191191
192+
Stable Semantic Conventions
193+
***************************
194+
195+
This instrumentation supports the semantic convention migration plan. You can control
196+
which semantic conventions are emitted by setting the
197+
``OTEL_SEMCONV_STABILITY_OPT_IN`` environment variable.
198+
199+
For HTTP instrumentations, set ``OTEL_SEMCONV_STABILITY_OPT_IN`` to:
200+
201+
- ``http`` - emit the stable HTTP and networking conventions, and stop emitting
202+
the old experimental HTTP and networking conventions.
203+
- ``http/dup`` - emit both the old experimental and stable HTTP and networking
204+
conventions during a transition period.
205+
206+
By default, when the environment variable is not set, the old experimental HTTP
207+
and networking conventions are emitted.
208+
192209
SQLCommenter
193210
************
194211
You can optionally enable sqlcommenter which enriches the query with contextual

instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,23 @@ async def async_response_hook(span, request, response):
308308
Note:
309309
The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change.
310310
311+
Stable Semantic Conventions
312+
***************************
313+
314+
This instrumentation supports the semantic convention migration plan. You can control
315+
which semantic conventions are emitted by setting the
316+
``OTEL_SEMCONV_STABILITY_OPT_IN`` environment variable.
317+
318+
For HTTP instrumentations, set ``OTEL_SEMCONV_STABILITY_OPT_IN`` to:
319+
320+
- ``http`` - emit the stable HTTP and networking conventions, and stop emitting
321+
the old experimental HTTP and networking conventions.
322+
- ``http/dup`` - emit both the old experimental and stable HTTP and networking
323+
conventions during a transition period.
324+
325+
By default, when the environment variable is not set, the old experimental HTTP
326+
and networking conventions are emitted.
327+
311328
API
312329
---
313330
"""

instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,23 @@
179179
Note:
180180
The environment variable names used to capture HTTP headers are still experimental, and thus are subject to change.
181181
182+
Stable Semantic Conventions
183+
***************************
184+
185+
This instrumentation supports the semantic convention migration plan. You can control
186+
which semantic conventions are emitted by setting the
187+
``OTEL_SEMCONV_STABILITY_OPT_IN`` environment variable.
188+
189+
For HTTP instrumentations, set ``OTEL_SEMCONV_STABILITY_OPT_IN`` to:
190+
191+
- ``http`` - emit the stable HTTP and networking conventions, and stop emitting
192+
the old experimental HTTP and networking conventions.
193+
- ``http/dup`` - emit both the old experimental and stable HTTP and networking
194+
conventions during a transition period.
195+
196+
By default, when the environment variable is not set, the old experimental HTTP
197+
and networking conventions are emitted.
198+
182199
API
183200
---
184201
"""

instrumentation/opentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,23 @@ def response_hook(span, request_obj, response):
177177
178178
will exclude requests such as ``https://site/client/123/info`` and ``https://site/xyz/healthcheck``.
179179
180+
Stable Semantic Conventions
181+
***************************
182+
183+
This instrumentation supports the semantic convention migration plan. You can control
184+
which semantic conventions are emitted by setting the
185+
``OTEL_SEMCONV_STABILITY_OPT_IN`` environment variable.
186+
187+
For HTTP instrumentations, set ``OTEL_SEMCONV_STABILITY_OPT_IN`` to:
188+
189+
- ``http`` - emit the stable HTTP and networking conventions, and stop emitting
190+
the old experimental HTTP and networking conventions.
191+
- ``http/dup`` - emit both the old experimental and stable HTTP and networking
192+
conventions during a transition period.
193+
194+
By default, when the environment variable is not set, the old experimental HTTP
195+
and networking conventions are emitted.
196+
180197
API
181198
---
182199
"""

0 commit comments

Comments
 (0)