Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

v1/charm_tracing.py library raises Exception on import opentelemetry due to stale packages #157

Closed
ca-scribner opened this issue Aug 2, 2024 · 0 comments

Comments

@ca-scribner
Copy link
Contributor

Bug Description

#151 attempts to address an issue where., during charm refresh, some opentelemetry tooling raises an Exception because empty leftover package directories are left in the virtual environment. #151 focued on applying the patch from within a decorator in the library, and only on the opentelemetry_sdk package.

It turns out that this problem can also occur:

  • for other opentelemetry packages (specifically noticed for opentelemetry_api)
  • at import time, eg when doing import opentelemetry, because opentelemetry/context/__init__.py does a similar inspection of packages

This means that the patch from #151 is too narrow (should apply to opentelemetry_*) and too late (must be done before importing any opentelemetry package)

To Reproduce

(in a machine model)

to repro the original issue

charmcraft pack
juju deploy grafana-agent --revision=134 --channel=latest/stable
juju deploy ubuntu
juju relate grafana-agent ubuntu
# wait for deploy to finish and charm to go to blocked (because it has no target for its metrics)

# rebuild grafana-agent latest/edge with v12 (old) version of the library
juju refresh grafana-agent --path ./grafana-agent_ubuntu-22.04-amd64.charm

juju refresh grafana-agent --channel latest/edge
# charm should refresh and go to error

Environment

Relevant log output

-

Additional context

No response

ca-scribner added a commit that referenced this issue Aug 2, 2024
fixes #157 by moving the stale package culling of charm_tracing.py ahead of all package imports and widening its scope to any opentelemetry package directories.
ca-scribner added a commit that referenced this issue Aug 2, 2024
fixes #157 by moving the stale package culling of charm_tracing.py ahead of all package imports and widening its scope to any opentelemetry package directories.
ca-scribner added a commit that referenced this issue Aug 2, 2024
fixes #157 by moving the stale package culling of charm_tracing.py ahead of all package imports and widening its scope to any opentelemetry package directories.
ca-scribner added a commit that referenced this issue Aug 6, 2024
fixes #157 by moving the stale package culling of charm_tracing.py ahead of all package imports and widening its scope to any opentelemetry package directories.
ca-scribner added a commit that referenced this issue Aug 6, 2024
fixes #157 by moving the stale package culling of charm_tracing.py ahead of all package imports and widening its scope to any opentelemetry package directories.
ca-scribner added a commit that referenced this issue Aug 6, 2024
fixes #157 by moving the stale package culling of charm_tracing.py ahead of all package imports and widening its scope to any opentelemetry package directories.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant