1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-04 23:37:12 +00:00
community.general/plugins/callback
Alexander Freiherr von Buddenbrock 23bd56990c
Start opentelemetry spans on host start instead of task start (#11434)
* Start opentelemetry spans on host start instead of task start

v2_playbook_on_task_start does not have the host information, so spans
would always start at the same time for every host in that task, even if
they started at different times, like when hosts > forks with strategy
host_pinned. This also hides the duration of the task for that host.

This change uses the newer v2_runner_on_start callback and adds the acutal
host start time to the span. The change is backwards compatible with ansible
versions that do not have v2_runner_on_start and makes no assumptions around
the ordering of v2_runner_on_start and v2_playbook_on_task_start.

* Add changelog fragment

* Remove redundant callback hooks

v2_runner_on_starts gets called by ansible right after the strategy has called on_task_start or on_handler_start. So there is no need to keep this code as the minimum ansible-core version is guaranteed to have this function. on_cleanup (removed around ansible-core 2.0) and on_no_hosts (removed around ansible-core 2.5) never get called.

* Fix unreachable hosts causing exceptions

If finish_task is never called for a host the result object stays None, which caused an exception in update_span_data. This was the case for unreachable hosts, as the callback plugin did not implement v2_runner_on_unreachable.

* Fix import order in test_opentelemetry
2026-05-17 11:28:15 +02:00
..
cgroup_memory_recap.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
context_demo.py Reformat everything. 2025-11-01 13:46:53 +01:00
counter_enabled.py Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00
default_without_diff.py Reformat everything. 2025-11-01 13:46:53 +01:00
dense.py Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00
diy.py Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00
elastic.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
jabber.py Reformat everything. 2025-11-01 13:46:53 +01:00
log_plays.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
loganalytics.py Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00
loganalytics_ingestion.py Add missing __future__ imports (#11567) 2026-03-11 06:42:08 +01:00
logdna.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
logentries.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
logstash.py Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00
mail.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
nrdp.py Reformat everything. 2025-11-01 13:46:53 +01:00
null.py Reformat everything. 2025-11-01 13:46:53 +01:00
opentelemetry.py Start opentelemetry spans on host start instead of task start (#11434) 2026-05-17 11:28:15 +02:00
print_task.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
say.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
selective.py selective callback plugin: align host names in stats output (#12065) 2026-05-17 10:38:33 +02:00
slack.py Reformat everything. 2025-11-01 13:46:53 +01:00
splunk.py Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00
sumologic.py Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00
syslog_json.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
tasks_only.py Reformat everything. 2025-11-01 13:46:53 +01:00
timestamp.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
unixy.py Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00