1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-05 15:57:05 +00:00
community.general/plugins
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
..
action Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
become pfexec become plugin: fix broken defaults for illumos/SmartOS (#11623) 2026-04-25 21:12:36 +02:00
cache Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
callback Start opentelemetry spans on host start instead of task start (#11434) 2026-05-17 11:28:15 +02:00
connection saltstack connection plugin: add documentation (#11992) 2026-05-07 07:36:47 +12:00
doc_fragments Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00
filter to_ini filter plugin: add no_extra_spaces parameter (#8576) (#12059) 2026-05-16 14:56:52 +02:00
inventory nmap inventory plugin: add skip_host_discovery option (#11955) 2026-05-10 10:20:08 +02:00
lookup Lookup plugins: prevent using _terms for positional arguments, and reject positional arguments completely for lookups that don't use them (#12060) 2026-05-17 09:43:21 +02:00
module_utils Remove as maintainer (#11911) 2026-05-14 10:20:10 +02:00
modules Fix flatpak id check (#12063) 2026-05-17 11:12:38 +02:00
plugin_utils Lookup plugins: prevent using _terms for positional arguments, and reject positional arguments completely for lookups that don't use them (#12060) 2026-05-17 09:43:21 +02:00
test Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00