Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docs/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,22 @@ Because the Elastic Distribution of OpenTelemetry Python is an extension of Open

EDOT Python supports all configuration options listed in the [OpenTelemetry General SDK Configuration documentation](https://opentelemetry.io/docs/languages/sdk-configuration/general/) and [OpenTelemetry Python](https://opentelemetry.io/docs/languages/python).

#### Logs

Exporting logs from the Python `logging` module is disabled by default and gated under a configuration environment variable:

```sh
export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
```

#### Differences from OpenTelemetry Python

EDOT Python uses different defaults than OpenTelemetry Python for the following configuration options:

| Option | EDOT Python default | OpenTelemetry Python default |
|---|---|---|
| `OTEL_EXPERIMENTAL_RESOURCE_DETECTORS` | `process_runtime,os,otel,telemetry_distro` | `otel` |

| `OTEL_LOGS_EXPORTER` | `otlp` | _no default_ |

### Configuration options that are _only_ available in EDOT Python

Expand Down
2 changes: 2 additions & 0 deletions src/elasticotel/distro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from logging import getLogger

from opentelemetry.environment_variables import (
OTEL_LOGS_EXPORTER,
OTEL_METRICS_EXPORTER,
OTEL_TRACES_EXPORTER,
)
Expand Down Expand Up @@ -72,5 +73,6 @@ def load_instrumentor(self, entry_point: EntryPoint, **kwargs):
def _configure(self, **kwargs):
os.environ.setdefault(OTEL_TRACES_EXPORTER, "otlp")
os.environ.setdefault(OTEL_METRICS_EXPORTER, "otlp")
os.environ.setdefault(OTEL_LOGS_EXPORTER, "otlp")
os.environ.setdefault(OTEL_EXPORTER_OTLP_PROTOCOL, "grpc")
os.environ.setdefault(OTEL_EXPERIMENTAL_RESOURCE_DETECTORS, "process_runtime,os,otel,telemetry_distro")
2 changes: 2 additions & 0 deletions tests/distro/test_distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from elasticotel.distro import ElasticOpenTelemetryDistro
from elasticotel.distro.environment_variables import ELASTIC_OTEL_SYSTEM_METRICS_ENABLED
from opentelemetry.environment_variables import (
OTEL_LOGS_EXPORTER,
OTEL_METRICS_EXPORTER,
OTEL_TRACES_EXPORTER,
)
Expand All @@ -36,6 +37,7 @@ def test_default_configuration(self):
distro.configure()
self.assertEqual("otlp", os.environ.get(OTEL_TRACES_EXPORTER))
self.assertEqual("otlp", os.environ.get(OTEL_METRICS_EXPORTER))
self.assertEqual("otlp", os.environ.get(OTEL_LOGS_EXPORTER))
self.assertEqual("grpc", os.environ.get(OTEL_EXPORTER_OTLP_PROTOCOL))
self.assertEqual(
"process_runtime,os,otel,telemetry_distro", os.environ.get(OTEL_EXPERIMENTAL_RESOURCE_DETECTORS)
Expand Down