Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Python agent-config #2272

Merged
merged 8 commits into from
Mar 9, 2023
Merged
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
44 changes: 13 additions & 31 deletions content/en/docs/instrumentation/python/automatic/agent-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,49 +28,31 @@ opentelemetry-instrument \

Here's an explanation of what each configuration does:

- `traces_exporter` specifies which trace exporter to use. In this case, traces
are being exported to `console` (stdout) and to `otlp`. The `otlp` option
tells `opentelemetry-instrument` to send it to an endpoint that accepts OTLP
via gRPC. The full list of available options for traces_exporter can be found
- `traces_exporter` specifies which traces exporter to use. In this case, traces
are being exported to `console` (stdout) and with `otlp`. The `otlp` option
tells `opentelemetry-instrument` to send the traces to an endpoint that
accepts OTLP via gRPC. In order to use HTTP instead of gRPC, add
`--exporter_otlp_protocol http`. The full list of available options for
traces_exporter can be found
[here](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/opentelemetry-instrumentation).
- `otlp` used above for `traces_exporter` is the equivalent of using
`otlp_proto_grpc`. To send traces via HTTP instead of gRPC, replace
`otlp_proto_grpc` (or `otlp`) with `otlp_proto_http`.
- `metrics_exporter` specifies which metrics exporter to use. In this case,
metrics are being exported to `console` (stdout). It is currently required for
your to specify a metrics exporter. If you aren't exporting metrics, specify
`none` as the value instead.
Comment on lines 39 to 41
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it's still required to set a metrics exporter (probably not). Could also remove this part.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least as of last December it was needed (in my own testing). Otherwise you'd get an error at runtime. I'd love it if this isn't required anymore, though!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late reply -- I just confirmed that this is still necessary with the latest agent.

- `service_name` sets the name of the service associated to the trace, and is
sent to your [Observability back-end](/ecosystem/vendors/).
- `exporter_otlp_endpoint` tells `opentelemetry-instrument` to send the traces
to the given [Observability back-end's](/ecosystem/vendors/) endpiont via
gRPC, or directly to the [OpenTelemetry Collector](/docs/collector/).
- `service_name` sets the name of the service associated with your telemetry,
and is sent to your [Observability backend](/ecosystem/vendors/).
- `exporter_otlp_endpoint` sets the endpoint where telemetry is exported to. If
omitted, the default [Collector](/docs/collector) endpoint will be used, which
is `0.0.0.0:4317` for gRPC and `0.0.0.0:4318` for HTTP.
- `exporter_otlp_headers` is required depending on your chosen Observability
back-end. More info exporter OTLP headers be found
backend. More info exporter OTLP headers be found
[here](/docs/concepts/sdk-configuration/otlp-exporter-configuration/#otel_exporter_otlp_headers).
- If `exporter_otlp_endpoint` is omitted, the agent assumes that you are using
the default Collector gRPC endpoint, `0.0.0.0:4317`. The above command is the
equivalent of saying:

```console
opentelemetry-instrument \
--traces_exporter console,otlp_proto_grpc \
--metrics_exporter console\
--service_name your-service-name \
--exporter_otlp_endpoint 0.0.0.0:4317 \
--exporter_otlp_insecure true \
python myapp.py
```

For HTTP, replace `otlp_proto_grpc` with `otlp_proto_http`. If left
unspecified, the endpoint is now assumed to be `0.0.0.0:4318` (default
Collector HTTP endpoint).

### Environment Variables

In some cases, configuring via
[Environment Variables](/docs/concepts/sdk-configuration/) is more preferred.
Any setting configurable with a configuration property can also be configured
Any setting configurable with a command-line argument can also be configured
with an Environment Variable.

You can apply the following steps to determine the correct name mapping of the
Expand Down