Skip to content

Commit edc88e7

Browse files
authored
Merge pull request #45 from instana/env-var-disable-autoinstr
Add config to disable automatic instrumentation
2 parents 74c9054 + 4cceece commit edc88e7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Configuration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ for development.
1919
```Python
2020
export INSTANA_DEV="true"
2121
```
22+
23+
## Disabling Automatic instrumentation
24+
25+
You can disable automatic instrumentation (tracing) by setting the environment variable `INSTANA_DISABLE_AUTO_INSTR`. This will suppress the loading of instrumentation built-into the sensor.

instana/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
from __future__ import absolute_import
2+
import os
23
import opentracing
34
from .sensor import Sensor
45
from .tracer import InstanaTracer
56
from .options import Options
67

7-
# Import & initialize instrumentation
8-
from .instrumentation import urllib3
8+
if "INSTANA_DISABLE_AUTO_INSTR" not in os.environ:
9+
# Import & initialize instrumentation
10+
from .instrumentation import urllib3
911

1012
"""
1113
The Instana package has two core components: the sensor and the tracer.

0 commit comments

Comments
 (0)