Skip to content
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

Tracing: Exclude query string for http.url tag from net/http instrumentation #3045

Merged
merged 5 commits into from
Aug 11, 2023

Conversation

TonyCTHsu
Copy link
Contributor

What does this PR do?

Exclude query string for http.url tag from net/http instrumentation

@TonyCTHsu TonyCTHsu added this to the 1.13.1 milestone Aug 10, 2023
@TonyCTHsu TonyCTHsu self-assigned this Aug 10, 2023
@TonyCTHsu TonyCTHsu requested a review from a team August 10, 2023 17:03
@TonyCTHsu TonyCTHsu linked an issue Aug 10, 2023 that may be closed by this pull request
@github-actions github-actions bot added integrations Involves tracing integrations tracing labels Aug 10, 2023
Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

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

Great work, @TonyCTHsu! 🙇

Copy link
Contributor

@delner delner left a comment

Choose a reason for hiding this comment

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

Perhaps you should address @marcotc 's comment first, and I have one question here, but otherwise this seems acceptable.

span.set_tag(Tracing::Metadata::Ext::HTTP::TAG_URL, request.path)
span.set_tag(
Tracing::Metadata::Ext::HTTP::TAG_URL,
Contrib::Utils::Quantization::HTTP.url(request.path, { query: { exclude: :all } })
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems fine as a default, and you've added tests to make sure there aren't any query strings in other integrations.

Is it worth putting this same quantization line in those integrations as well? For consistency? Or is there a drawback?

Copy link
Contributor Author

@TonyCTHsu TonyCTHsu Aug 11, 2023

Choose a reason for hiding this comment

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

Currently, our http client integrations do not offer settings for quantization, each of them leverage their public interface to provide data.

I believe we should refactor and centralize the quantization mechanism when we offer the feature.

@TonyCTHsu TonyCTHsu merged commit d91e764 into master Aug 11, 2023
203 checks passed
@TonyCTHsu TonyCTHsu deleted the tonycthsu/http-query-string branch August 11, 2023 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to scrub sensitive query string params from net/http spans
3 participants