Skip to content

Commit

Permalink
change debug message for attributeerror
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
  • Loading branch information
Lawouach committed Oct 25, 2023
1 parent a54f3f2 commit 7cce5e0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

[Unreleased]: https://github.com/chaostoolkit-incubator/chaostoolkit-opentracing/compare/0.13.2..HEAD

### Changed

- Make the `AttributeError` from importing HTTPXInstrument silent because
it will usually occur when a `gevent` environment only

## [0.13.2][] - 2023-08-03

[0.13.2]: https://github.com/chaostoolkit-incubator/chaostoolkit-opentracing/compare/0.13.1...0.13.2
Expand Down
10 changes: 9 additions & 1 deletion chaostracing/oltp.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@
from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor

HAS_HTTPX = True
except (AttributeError, ImportError):
except AttributeError:
logger.debug(
"Failed to import HTTPXClientInstrumentor. Likely because you run from "
"a gevent monkeypatched environment. You can ignore this if that's the"
"case, but you cannot instrument httpx unfortunately.",
exc_info=True,
)
HAS_HTTPX = False
except ImportError:
logger.debug("Failed to import HTTPXClientInstrumentor", exc_info=True)
HAS_HTTPX = False
try:
Expand Down

0 comments on commit 7cce5e0

Please sign in to comment.