opentelemetry
OpenTelemetry backend
Backend: pants.backend.observability.opentelemetry
Config section: [opentelemetry]
Basic options
async_completion
--[no-]opentelemetry-async-completionPANTS_OPENTELEMETRY_ASYNC_COMPLETION[opentelemetry]
async_completion = <bool>
FalseIf True, allows the plugin to finish asynchronously when Pants is shutting down. This can result in faster Pants exit times but may lead to some spans not being exported if the export process is slow. If False, forces synchronous completion, ensuring all spans are exported before Pants exits but potentially slowing down the shutdown process. Defaults to False.
enabled
--[no-]opentelemetry-enabledPANTS_OPENTELEMETRY_ENABLED[opentelemetry]
enabled = <bool>
FalseWhether to enable emitting OpenTelemetry spans.
exporter
--opentelemetry-exporter=<TracingExporterId>PANTS_OPENTELEMETRY_EXPORTER[opentelemetry]
exporter = <TracingExporterId>
otlp, json-filedefault:
otlpSet the exporter to use when exporting workunits to external tracing systems. Choices are otlp (OpenTelemetry OTLP over HTTP), json-file (Write OpenTelemetry-style debug output to a file). Default is otlp.
exporter_endpoint
--opentelemetry-exporter-endpoint=<str>PANTS_OPENTELEMETRY_EXPORTER_ENDPOINT[opentelemetry]
exporter_endpoint = <str>
NoneThe target to which the exporter is going to send traces, metrics, or logs. The endpoint MUST be a valid URL host, and MAY contain a scheme (http or https), port and path. The plugin will construct a "signal-specific" URL for sending traces by appending the applicable URL path if the signal-specific [opentelemetry].exporter_traces_endpoint option is not already set to override this option.
Corresponds to the OTEL_EXPORTER_OTLP_ENDPOINT environment variable.
finish_timeout
--opentelemetry-finish-timeout=<float>PANTS_OPENTELEMETRY_FINISH_TIMEOUT[opentelemetry]
finish_timeout = <float>
2.0The number of seconds to wait at the end of a session for export of all tracing spans to OpenTelemetry to complete.
json_file
--opentelemetry-json-file=<str>PANTS_OPENTELEMETRY_JSON_FILE[opentelemetry]
json_file = <str>
dist/otel-json-trace.jsonlIf set, Pants will write OpenTelemetry tracing spans to a local file for easier debugging. Each line will be a tracing span in OpenTelemetry's JSON format. The filename is relative to the build root. Export will only occur if the --opentelemetry-exporter is set to json-file.
parse_traceparent
--[no-]opentelemetry-parse-traceparentPANTS_OPENTELEMETRY_PARSE_TRACEPARENT[opentelemetry]
parse_traceparent = <bool>
TrueIf True, then parse the TRACEPARENT environment variable if it is present in the environment. TRACEPARENT contains the parent trace ID and parent span ID to which to link any trace generated by this plugin. This is useful for linking Pants-related traces together with the trace for the CI job.
The format of the TRACEPARENT environment variable is defined in the W3C Trace Context specification: https://www.w3.org/TR/trace-context/#traceparent-header
trace_link_template
--opentelemetry-trace-link-template=<str>PANTS_OPENTELEMETRY_TRACE_LINK_TEMPLATE[opentelemetry]
trace_link_template = <str>
NoneLog a link to the URL at which the trace will be available in a trace management system. The following replacement variables are available:
-
{trace_id}- The OpenTelemetry trace ID -
{root_span_id}- The span ID of the root span of the trace -
{trace_start_ms}- Start time of the root span in milliseconds since the UNIX epoch -
{trace_end_ms}- End time of the root span in milliseconds since the UNIX epoch
Advanced options
exporter_certificate_file
--opentelemetry-exporter-certificate-file=<str>PANTS_OPENTELEMETRY_EXPORTER_CERTIFICATE_FILE[opentelemetry]
exporter_certificate_file = <str>
NoneThe path to the certificate file for TLS credentials of gRPC client for traces. Should only be used for a secure connection for tracing.
Corresponds to the OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY and OTEL_EXPORTER_OTLP_CERTIFICATE environment variables.
exporter_client_certificate_file
--opentelemetry-exporter-client-certificate-file=<str>PANTS_OPENTELEMETRY_EXPORTER_CLIENT_CERTIFICATE_FILE[opentelemetry]
exporter_client_certificate_file = <str>
NoneThe path to the client certificate/chain trust for clients private key to use in mTLS communication in PEM format for traces.
Corresponds to the OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE and OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE environment variables.
exporter_client_key_file
--opentelemetry-exporter-client-key-file=<str>PANTS_OPENTELEMETRY_EXPORTER_CLIENT_KEY_FILE[opentelemetry]
exporter_client_key_file = <str>
NoneThe path to the client private key to use in mTLS communication in PEM format for traces.
Corresponds to the OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY and OTEL_EXPORTER_OTLP_CLIENT_KEY environment variables.
exporter_compression
--opentelemetry-exporter-compression=<OtelCompression>PANTS_OPENTELEMETRY_EXPORTER_COMPRESSION[opentelemetry]
exporter_compression = <OtelCompression>
gzip, deflate, nonedefault:
noneSpecifies a gRPC compression method to be used in the OTLP exporters. Possible values are gzip, deflate, and none.
Corresponds to the OTEL_EXPORTER_OTLP_TRACES_COMPRESSION and OTEL_EXPORTER_OTLP_COMPRESSION environment variables.
exporter_headers
--opentelemetry-exporter-headers="{'key1': val1, 'key2': val2, ...}"PANTS_OPENTELEMETRY_EXPORTER_HEADERS[opentelemetry.exporter_headers]
key1 = val1
key2 = val2
...
{}The key-value pairs to be used as headers for spans associated with gRPC or HTTP requests.
Corresponds to the OTEL_EXPORTER_OTLP_TRACES_HEADERS and OTEL_EXPORTER_OTLP_HEADERS environment variables.
exporter_timeout
--opentelemetry-exporter-timeout=<int>PANTS_OPENTELEMETRY_EXPORTER_TIMEOUT[opentelemetry]
exporter_timeout = <int>
NoneThe maximum time the OTLP exporter will wait for each batch export for spans.
Corresponds to the OTEL_EXPORTER_OTLP_TRACES_TIMEOUT and OTEL_EXPORTER_OTLP_TIMEOUT environment variables.
exporter_traces_endpoint
--opentelemetry-exporter-traces-endpoint=<str>PANTS_OPENTELEMETRY_EXPORTER_TRACES_ENDPOINT[opentelemetry]
exporter_traces_endpoint = <str>
NoneThe target to which the exporter is going to send traces. The endpoint MUST be a valid URL host, and MAY contain a scheme (http or https), port and path. If this option is set, then the [opentelemetry].exporter_endpoint option will not be used. The URL is not modified at all since it is specific to the traces endpoint to use.
You should not normally need to set this option. Prefer using the [opentelemetry].exporter_endpoint option instead.
Corresponds to the OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.
Deprecated options
None
Related subsystems
None