Spec-Zone.ru › Ansible

community.general.elastic callback – Create distributed traces for each Ansible task in Elastic APM

Note

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

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general. You need further requirements to be able to use this callback plugin, see Requirements for details.

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

New in community.general 3.8.0

  • Callback plugin
  • Synopsis
  • Requirements
  • Parameters
  • Examples

Callback plugin

This plugin is a notification callback. It sends information for a playbook run to other applications, services, or systems. See Callback plugins for more information on callback plugins.

Synopsis

  • This callback creates distributed traces for each Ansible task in Elastic APM.
  • You can configure the plugin with environment variables.
  • See https://www.elastic.co/guide/en/apm/agent/python/current/configuration.html.

Requirements

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

  • elastic-apm (Python library)

Parameters

Parameter

Comments

apm_api_key

string

Use the APM API key.

Configuration:

  • Environment variable: ELASTIC_APM_API_KEY

apm_secret_token

string

Use the APM server token.

Configuration:

  • Environment variable: ELASTIC_APM_SECRET_TOKEN

apm_server_url

string

Use the APM server and its environment variables.

Configuration:

  • Environment variable: ELASTIC_APM_SERVER_URL

apm_service_name

string

The service name resource attribute.

Default: "ansible"

Configuration:

  • Environment variable: ELASTIC_APM_SERVICE_NAME

apm_verify_server_cert

boolean

Verifies the SSL certificate if an HTTPS connection.

Choices:

  • false
  • true ← (default)

Configuration:

  • Environment variable: ELASTIC_APM_VERIFY_SERVER_CERT

hide_task_arguments

boolean

Hide the arguments for a task.

Choices:

  • false ← (default)
  • true

Configuration:

  • Environment variable: ANSIBLE_OPENTELEMETRY_HIDE_TASK_ARGUMENTS

traceparent

string

The W3C Trace Context header traceparent.

Configuration:

  • Environment variable: TRACEPARENT

Examples

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

  Set the environment variable:
    export ELASTIC_APM_SERVER_URL=<your APM server URL)>
    export ELASTIC_APM_SERVICE_NAME=your_service_name
    export ELASTIC_APM_API_KEY=your_APM_API_KEY

Authors

  • Victor Martinez (@v1v)

Collection links

  • Issue Tracker
  • Repository (Sources)
  • Ask for help
  • Submit a bug report
  • Request a feature
  • Communication

© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/community/general/elastic_callback.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API