-
Notifications
You must be signed in to change notification settings - Fork 599
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
pymemcache query sanitization #1576
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until now the default behavior was to present the original query,
and now the default behavior is to present a sanitized query.
Is this generally the thing that users prefer?
instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py
Outdated
Show resolved
Hide resolved
actually this is a good question, i opened an issue in the spec repository in order to clarify this: |
# Conflicts: # CHANGELOG.md # instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py
@@ -44,6 +44,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
([#1592](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1592)) | |||
- `opentelemetry-instrumentation-django` Allow explicit `excluded_urls` configuration through `instrument()` | |||
([#1618](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1618)) | |||
- Added query sanitization for pymemcache | |||
([#1576](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1576)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to Unreleased section
with tracer.start_as_current_span( | ||
cmd, kind=SpanKind.CLIENT, attributes={} | ||
) as span: | ||
try: | ||
if span.is_recording(): | ||
if not args: | ||
if not args or sanitize_query: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the approach we follow elsewhere. The values get replaced with something like ?
or similar.
Description
Added a query sanitizer to the Pymemcache instrumentation.
Default False, can be enabled with sanitize_query = True
This will allow users to sanitize the query.
PymemcacheInstrumentor().instrument(sanitize_query=True)
Fixes #1546
How Has This Been Tested?
Does This PR Require a Core Repo Change?
Checklist: