-
Notifications
You must be signed in to change notification settings - Fork 626
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
feat: Add exclude urls feature to HTTPX instrumentation #1900
base: main
Are you sure you want to change the base?
Conversation
|
...tion/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
Outdated
Show resolved
Hide resolved
@zqumei0 merge in current main. I tested it locally and had no issues with tests. Should be good on pipeline. After this, mention maintainer or approver to run it. |
I don't get why those tests are failing. It worked on my machine. Can anyone help out with debugging? |
Weird, I checked out this PR with diff --git a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml
index 50f3fccb..1632f9c4 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml
+++ b/instrumentation/opentelemetry-instrumentation-httpx/pyproject.toml
@@ -28,6 +28,7 @@ dependencies = [
"opentelemetry-api ~= 1.12",
"opentelemetry-instrumentation == 0.42b0.dev",
"opentelemetry-semantic-conventions == 0.42b0.dev",
+ "opentelemetry-util-http"
]
[project.optional-dependencies]
diff --git a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
index 1ecf4596..1fe3a21b 100644
--- a/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
+++ b/instrumentation/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
@@ -176,7 +176,7 @@ from opentelemetry.semconv.trace import SpanAttributes
from opentelemetry.trace import SpanKind, TracerProvider, get_tracer
from opentelemetry.trace.span import Span
from opentelemetry.trace.status import Status
-from opentelemetry.utils.http import (
+from opentelemetry.util.http import (
ExcludeList,
get_excluded_urls,
parse_excluded_urls, After that, it also failed but by different reasons. @zqumei0 can you please check this? |
Hi 👋 I could also use this feature, although I don't quite have the time to deeply contribute other than do some testing on my end. In an attempt to be useful, I tried following the steps to get started and at least run the tests on my machine. However, the tests were also failing for me. @macieyng I would have dug into the test logs in GitHub Actions but it looks like the logs have expired at this point I tried the steps that @ocelotl laid out but it didn't work either. After installing the dependencies in the requirements.txt files, I ran this command: And here was the output:
@zqumei0 if you or anyone wants to pick up this PR, I'm happy to do some testing and give some feedback. |
Description
Modified HTTPX instrumentation to allow for skipping instrumentation for a list of excluded URLs similar to the current solutions.
Fixes #539
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.