-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
default value for header setter extension #34412
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@f7o Makes sense to me, are you interested in contribute it? |
@Frapschen yeah, sure |
* default value config * set default value in context source if metadata empty fixes open-telemetry#34412
oh wait a minute. looking at the code I believe this functionally could be achieved by something like this: headers:
- action: upsert
key: X-TENANT
from_context: X-TENANT
- action: insert
key: X-TENANT
value: some-tenant I believe it would first try to set it from context, even if it's empty. But second set the value only if first header does not set it. @jpkrohling have you had this use case before? |
I believe that's correct: an upsert of a fixed value would cause it to act as a default value. |
I tried the following - action: upsert
key: X-NAMESPACE
from_context: X-TENANT
- action: insert
key: X-NAMESPACE
value: sre-test This apparently does not work if |
* default value config * set default value in context source if metadata empty fixes open-telemetry#34412
* default value config * set default value in context source if metadata empty fixes open-telemetry#34412
**Description:** <Describe what has changed.> * default value config * set default value in context source if metadata empty **Link to tracking Issue: #34412 **Testing:** tbd **Documentation:** see README.md --------- Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Closed via #34455 |
…emetry#34455) **Description:** <Describe what has changed.> * default value config * set default value in context source if metadata empty **Link to tracking Issue: open-telemetry#34412 **Testing:** tbd **Documentation:** see README.md --------- Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Component(s)
extension/headerssetter
Is your feature request related to a problem? Please describe.
When using the header setter with
from_context
configuration set, and the key is not set within context from receiver, the header is set to nil on the exporter.Describe the solution you'd like
Describe alternatives you've considered
Allow to specify a default value per header action in case
X-TENANT
on the provided context is empty/nilAdditional context
No response
The text was updated successfully, but these errors were encountered: