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

fix(opentelemetry): adjust default value for store_spans_in_file causing traces to be produced to a file named None #8741

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

wilfriedroset
Copy link
Contributor

@wilfriedroset wilfriedroset commented Aug 11, 2024

SUMMARY

The commit 5f48193 introduced store_spans_in_file with the default
value None as a string. This causes the value of store_spans_in_file
to be a not empty string, value=None as a string and not a null value.
The rest of the code check if the store_spans_in_file is not null which
squeezes the rest of the code. The following commit set the default
value as an empty string.

Fixes (hopefully) #8566

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

community.general.opentelemetry

ADDITIONAL INFORMATION

I've used the same reproducer as #8321 with git bisect

5f481939d4558e1ae61459cee2a4aecb2f8a7207 is the first bad commit
commit 5f481939d4558e1ae61459cee2a4aecb2f8a7207 (HEAD)
Author: Victor Martinez <[email protected]>
Date:   Sun May 19 20:48:49 2024 +0200

    feat(opentelemetry): support flag to export spans in a given file (#8363)

    * opentelemetry: support flag to create output file

    this is only to help with adding unit tests

    * refactor and rename

    * changelog

    * rename

    * fix linting

 changelogs/fragments/8363-opentelemetry-export-to-a-file.yml |  2 ++
 plugins/callback/opentelemetry.py                            | 48 ++++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 42 insertions(+), 8 deletions(-)
 create mode 100644 changelogs/fragments/8363-opentelemetry-export-to-a-file.yml

…using traces to be produced to a file named `None`

The commit 5f48193 introduced `store_spans_in_file` with the default
value `None` as a string. This causes the value of `store_spans_in_file`
to be a not empty string, value=None as a string and not a null value.
The rest of the code check if the store_spans_in_file is not null which
squeezes the rest of the code. The following commit set the default
value as an empty string.

Signed-off-by: Wilfried Roset <[email protected]>
@wilfriedroset
Copy link
Contributor Author

ping @moserke @rojon8 @cervajs as you have stumbled on the bug. I would appreciate if you could test this small change.

ping @v1v @russoz for the review 🙏🏾.

@ansibullbot ansibullbot added bug This issue/PR relates to a bug callback callback plugin plugins plugin (any type) labels Aug 11, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

plugins/callback/opentelemetry.py Outdated Show resolved Hide resolved
changelogs/fragments/8741-fix-opentelemetry-callback.yml Outdated Show resolved Hide resolved
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-9 Automatically create a backport for the stable-9 branch labels Aug 11, 2024
@felixfontein
Copy link
Collaborator

I don't know whether this fixes #8566, but this change should be merged nonetheless since writing to a file None is definitely wrong. I've unlinked the issue from this PR, let's close the issue if testing by the others confirms this PR fixes it. I'm merging this PR now so it will be included in today's release.

@felixfontein felixfontein merged commit 73b5413 into ansible-collections:main Aug 12, 2024
147 checks passed
Copy link

patchback bot commented Aug 12, 2024

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/73b54139d65c94aac5f5b4ba251afa2d676cb12e/pr-8741

Backported as #8751

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Aug 12, 2024
…using traces to be produced to a file named `None` (#8741)

* fix(opentelemetry): adjust default value for `store_spans_in_file` causing traces to be produced to a file named `None`

The commit 5f48193 introduced `store_spans_in_file` with the default
value `None` as a string. This causes the value of `store_spans_in_file`
to be a not empty string, value=None as a string and not a null value.
The rest of the code check if the store_spans_in_file is not null which
squeezes the rest of the code. The following commit set the default
value as an empty string.

Signed-off-by: Wilfried Roset <[email protected]>

* fix(opentelemetry): No default value is better, reword changelog

Signed-off-by: Wilfried Roset <[email protected]>

---------

Signed-off-by: Wilfried Roset <[email protected]>
(cherry picked from commit 73b5413)
@felixfontein
Copy link
Collaborator

@wilfriedroset thanks for fixing this!

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Aug 12, 2024
felixfontein pushed a commit that referenced this pull request Aug 12, 2024
…ault value for `store_spans_in_file` causing traces to be produced to a file named `None` (#8751)

fix(opentelemetry): adjust default value for `store_spans_in_file` causing traces to be produced to a file named `None` (#8741)

* fix(opentelemetry): adjust default value for `store_spans_in_file` causing traces to be produced to a file named `None`

The commit 5f48193 introduced `store_spans_in_file` with the default
value `None` as a string. This causes the value of `store_spans_in_file`
to be a not empty string, value=None as a string and not a null value.
The rest of the code check if the store_spans_in_file is not null which
squeezes the rest of the code. The following commit set the default
value as an empty string.

Signed-off-by: Wilfried Roset <[email protected]>

* fix(opentelemetry): No default value is better, reword changelog

Signed-off-by: Wilfried Roset <[email protected]>

---------

Signed-off-by: Wilfried Roset <[email protected]>
(cherry picked from commit 73b5413)

Co-authored-by: Wilfried ROSET <[email protected]>
aioue pushed a commit to aioue/community.general that referenced this pull request Oct 1, 2024
…using traces to be produced to a file named `None` (ansible-collections#8741)

* fix(opentelemetry): adjust default value for `store_spans_in_file` causing traces to be produced to a file named `None`

The commit 5f48193 introduced `store_spans_in_file` with the default
value `None` as a string. This causes the value of `store_spans_in_file`
to be a not empty string, value=None as a string and not a null value.
The rest of the code check if the store_spans_in_file is not null which
squeezes the rest of the code. The following commit set the default
value as an empty string.

Signed-off-by: Wilfried Roset <[email protected]>

* fix(opentelemetry): No default value is better, reword changelog

Signed-off-by: Wilfried Roset <[email protected]>

---------

Signed-off-by: Wilfried Roset <[email protected]>
TobiasZeuch181 pushed a commit to TobiasZeuch181/zypper_repository_add_list that referenced this pull request Oct 2, 2024
…using traces to be produced to a file named `None` (ansible-collections#8741)

* fix(opentelemetry): adjust default value for `store_spans_in_file` causing traces to be produced to a file named `None`

The commit 5f48193 introduced `store_spans_in_file` with the default
value `None` as a string. This causes the value of `store_spans_in_file`
to be a not empty string, value=None as a string and not a null value.
The rest of the code check if the store_spans_in_file is not null which
squeezes the rest of the code. The following commit set the default
value as an empty string.

Signed-off-by: Wilfried Roset <[email protected]>

* fix(opentelemetry): No default value is better, reword changelog

Signed-off-by: Wilfried Roset <[email protected]>

---------

Signed-off-by: Wilfried Roset <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 Automatically create a backport for the stable-9 branch bug This issue/PR relates to a bug callback callback plugin plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants