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

Remove log pollution from charm tracing in scenario tests #220

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

mmkay
Copy link
Contributor

@mmkay mmkay commented Dec 6, 2024

Issue

In scenario test runs, a significant number of warnings (and some error logs) came from the fact that charm tracing was enabled even though there isn't anything charm traces can be sent to.

WARNING  tracing:charm_tracing.py:658 <class 'charm.GrafanaAgentMachineCharm'>._server_cert is None; sending traces over INSECURE connection.
WARNING  opentelemetry.trace:__init__.py:537 Overriding of current TracerProvider is not allowed
WARNING  opentelemetry.sdk.trace.export:__init__.py:213 Already shutdown, dropping span.
WARNING  opentelemetry.sdk.trace.export:__init__.py:213 Already shutdown, dropping span.
WARNING  opentelemetry.sdk.trace.export:__init__.py:213 Already shutdown, dropping span.
WARNING  opentelemetry.sdk.trace.export:__init__.py:213 Already shutdown, dropping span.
WARNING  opentelemetry.sdk.trace.export:__init__.py:213 Already shutdown, dropping span.
WARNING  opentelemetry.sdk.trace.export:__init__.py:213 Already shutdown, dropping span.

Solution

Disable charm tracing in all scenario tests as we aren't testing charm tracing there. We're testing tracing-related configuration in one set of tests, but this doesn't need charm tracing to be enabled.

Context

Testing Instructions

Run tox -e scenario and see the log pollution decreased significantly.

Upgrade Notes

@mmkay mmkay marked this pull request as ready for review December 6, 2024 11:31
@mmkay mmkay requested a review from a team as a code owner December 6, 2024 11:31
Copy link
Contributor

@MichaelThamm MichaelThamm left a comment

Choose a reason for hiding this comment

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

Still seeing errors related to charm:charm.py:632 snap file for foo not found. It is likely not installed. Skipping.

But this PR fixes the spam of warning messages and will address the other issues in a different PR. Thanks!

@mmkay mmkay merged commit 7af0833 into main Dec 6, 2024
13 checks passed
@mmkay mmkay deleted the charm-tracing-log-pollution branch December 6, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants