community.general.opentelemetry – Create distributed traces with OpenTelemetry

Note

This plugin is part of the community.general collection (version 3.7.0).

To install it use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.opentelemetry.

New in version 3.7.0: of community.general

Synopsis

Requirements

The below requirements are needed on the local controller node that executes this callback.

  • opentelemetry-api (python lib)

  • opentelemetry-exporter-otlp (python lib)

  • opentelemetry-sdk (python lib)

Parameters

Parameter Choices/Defaults Configuration Comments
hide_task_arguments
boolean
    Choices:
  • no ←
  • yes
env:ANSIBLE_OPENTELEMETRY_HIDE_TASK_ARGUMENTS
Hide the arguments for a task.
otel_service_name
string
Default:
"ansible"
env:OTEL_SERVICE_NAME
The service name resource attribute.
traceparent
string
Default:
"None"
env:TRACEPARENT

Examples

examples: |
  Enable the plugin in ansible.cfg:
    [defaults]
    callbacks_enabled = community.general.opentelemetry

  Set the environment variable:
    export OTEL_EXPORTER_OTLP_ENDPOINT=<your endpoint (OTLP/HTTP)>
    export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer your_otel_token"
    export OTEL_SERVICE_NAME=your_service_name

Authors