Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opentelemetry][callback] Support loops error handling #3599

Merged

Conversation

v1v
Copy link
Contributor

@v1v v1v commented Oct 22, 2021

SUMMARY

Enrich the error messages for loops, otherwise All items completed is the only description in the error message

Fixes #3597

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

plugins/callback/opentelemetry.py

ADDITIONAL INFORMATION
---
- name: Echo
  hosts: localhost
  connection: local

  tasks:
  - name: ECHO
    shell: "echo hi"
  - name: exit 1
    shell: "exit 1"
    ignore_errors: yes

  - name: Register loop output as a variable
    shell: "exit {{ item }}"
    loop:
      - 0
      - 2
      - bc
    register: echo

With this proposal:

image

image

Otherwise

image

image

@ansibullbot ansibullbot added bug This issue/PR relates to a bug callback callback plugin plugins plugin (any type) tests tests unit tests/unit labels Oct 22, 2021
@felixfontein felixfontein added the check-before-release PR will be looked at again shortly before release and merged if possible. label Oct 22, 2021
Copy link
Collaborator

@Ajpantuso Ajpantuso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment, but otherwise looks good.

plugins/callback/opentelemetry.py Outdated Show resolved Hide resolved
@ansibullbot ansibullbot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Oct 22, 2021
@v1v v1v force-pushed the feature/support-loops-error-handling branch from be2dd9a to 57faed7 Compare October 25, 2021 14:58
@ansibullbot ansibullbot removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Oct 25, 2021
@Ajpantuso
Copy link
Collaborator

/rebuild_failed

Copy link
Collaborator

@Ajpantuso Ajpantuso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Oct 25, 2021
@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Oct 27, 2021
@felixfontein felixfontein merged commit a362879 into ansible-collections:main Oct 27, 2021
@felixfontein
Copy link
Collaborator

@v1v thanks for contributing this!
@Ajpantuso thanks for reviewing!

JonEllis pushed a commit to JonEllis/community.general that referenced this pull request Nov 16, 2021
…ctions#3599)

* [opentelemetry][callback] simplify condition

* [opentelemetry][callback] initial support for loops

* [opentelemetry][callback] support for loops

* [opentelemetry][callback] enrich loop message with action and item

* [opentelemetry][callback] add UTs for get_error_message_from_results

* [opentelemetry][callback] add UTs for enrich_error_message_from_results

* [opentelemetry][callback] add changelog fragment

* Update plugins/callback/opentelemetry.py

Co-authored-by: Ajpantuso <[email protected]>

Co-authored-by: Ajpantuso <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug callback callback plugin plugins plugin (any type) tests tests unit tests/unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opentelemetry: error handling for loops does not provide enough context
4 participants