-
Notifications
You must be signed in to change notification settings - Fork 867
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
Add builders for setting optional attributes on HTTP extractors #5347
Add builders for setting optional attributes on HTTP extractors #5347
Conversation
HttpClientAttributesExtractor.builder(new TestHttpClientAttributesGetter()) | ||
.captureHttpHeaders( | ||
CapturedHttpHeaders.create( | ||
singletonList("Custom-Request-Header"), | ||
singletonList("Custom-Response-Header"))) | ||
.build(); |
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.
what do you think of hiding CapturedHttpHeaders
and exposing captureHttpRequestHeaders
and captureHttpResponseHeaders
on the builders?
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 think I'd probably prefer leaving this as it is, it's a bit simpler this way.
If I added captureHttpRequestHeaders(List<String>)
I'd have to take the following things into account:
- is it additive? does
. captureHttpRequestHeaders(["abc"]).captureHttpRequestHeaders(["def"])
capture["abc", "def"]
or does the second call overwrite the first one? - do the default (configured) values get overwritten, or appended to?
With captureHttpHeaders(CapturedHttpHeaders)
it's clear (I hope so? 😅 ) that the previous setting is overwritten. (Maybe I should rename it to setCapturedHttpHeaders
after all...)
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.
cc @anuraaga for any API thoughts
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.
How about
setCapturedRequestHeaders
setCapturedResponseHeaders
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'll do that in a separate PR - this requires changing all our HTTP library instrumentations, so the amount of changes will be pretty significant.
583e894
to
a44bcbf
Compare
…-telemetry#5347) * Add builders for setting optional attributes on HTTP extractors * errorprone * fix compilation failure
No description provided.