Skip to content

Change exclude lists to just exclude_urls, add tests for flask and django#872

Merged
lzchen merged 5 commits intoopen-telemetry:masterfrom
cnnradams:exclude_lists
Jul 7, 2020
Merged

Change exclude lists to just exclude_urls, add tests for flask and django#872
lzchen merged 5 commits intoopen-telemetry:masterfrom
cnnradams:exclude_lists

Conversation

@cnnradams
Copy link
Copy Markdown
Member

resolves #779

@cnnradams cnnradams requested a review from a team June 30, 2020 13:59
Copy link
Copy Markdown
Contributor

@lzchen lzchen left a comment

Choose a reason for hiding this comment

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

Nice

Copy link
Copy Markdown
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

*************
Excludes certain hosts and paths from being tracked. Pass in comma delimited string into environment variables.
Host refers to the entire url and path refers to the part of the url after the domain. Host matches the exact string that is given, where as path matches if the url starts with the given excluded path.
To exclude certain URLs from being tracked, set the environment variable ``OPENTELEMETRY_PYTHON_DJANGO_EXCLUDED_URLS`` with comma delimited regexes representing which URLs to exclude.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

devil's advocate, but: what if the url I want to exclude has a comma?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good question, hadn't thought of this. Not really sure of a good solution, I guess we could make the env variable an array or give some way to escape commas in the URL but they don't sound enticing. any ideas?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like a pretty specific case to me. I'm okay with the solution as is. Better to cover the majority of cases than to block something by fixating on a rare case.

Copy link
Copy Markdown
Contributor

@AndrewAXue AndrewAXue Jul 3, 2020

Choose a reason for hiding this comment

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

I think the only way to truly fix this is to make the env variable into an array. Any delimiter can be present in a url of the form

url.com/point?payload="delimiter"

Comment thread ext/opentelemetry-ext-django/tests/test_middleware.py
Comment thread ext/opentelemetry-ext-django/tests/test_middleware.py
Comment thread ext/opentelemetry-ext-flask/tests/test_programmatic.py
@cnnradams cnnradams force-pushed the exclude_lists branch 2 times, most recently from f17b8df to b146816 Compare July 6, 2020 13:20
@codeboten
Copy link
Copy Markdown
Contributor

@AndrewAXue can you confirm whether or not your comments have been addressed, i can merge once they are resolved.

@AndrewAXue
Copy link
Copy Markdown
Contributor

@codeboten Ya we're good!

@lzchen lzchen merged commit d0e125a into open-telemetry:master Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

disable_tracing_hostname for URL exclude lists not covering reasonable use cases

6 participants