-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat(opentelemetry): Allow header_type to be set #10620
Conversation
Note: I couldn't get the tests to run locally with
When I attempted the gojira command, it was returning a bazel error. I was hoping that CI would take care of running the test to confirm this functionality once I raised the PR. |
6182f0a
to
67a33e5
Compare
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.
looks great! Just some small observations:
It is possible that you'll have to run
ah! Thanks for pointing that out, we will fix that, please do feel free to update the CHANGELOG
that would be awesome! ❤️ the docs for this plugin can be found on this page. |
67a33e5
to
6458339
Compare
FWIW I still couldn't get this working locally with
Thanks! Went ahead and added a note in the CHANGELOG with the recent commit.
Working on the docs now, will post a link here once that's done! |
This pull request will add the ability to set the `header_type` for the opentelemetry plugin: Kong/kong#10620 To ensure the documentation remains in sync with the options available for plugins, this adds the `header_type` key to the `config` section showing its something that can be set.
Added documentation here: Kong/docs.konghq.com#5422 Wasn't sure what to point at, so pointed to |
@nbialostosky alright that makes sense, please use |
This pull request will add the ability to set the `header_type` for the opentelemetry plugin: Kong/kong#10620 To ensure the documentation remains in sync with the options available for plugins, this adds the `header_type` key to the `config` section showing its something that can be set.
This pull request will add the ability to set the `header_type` for the opentelemetry plugin: Kong/kong#10620 To ensure the documentation remains in sync with the options available for plugins, this adds the `header_type` key to the `config` section showing its something that can be set.
New PR link for the docs pointed at the proper release branch: Kong/docs.konghq.com#5431 |
This pull request will add the ability to set the `header_type` for the opentelemetry plugin: Kong/kong#10620 To ensure the documentation remains in sync with the options available for plugins, this adds the `header_type` key to the `config` section showing its something that can be set.
Thanks! To close the loop, the command you provided worked and I was able to successfully run the tests locally, they passed. I will share this information with my team so we are all able to test locally before raising upstream PR's. |
6458339
to
c71b74b
Compare
looks great @nbialostosky! This just needs a rebase to resolve a couple of conflicts and then it'll be ready to merge. Thanks! |
At the moment the opentelemtry plugin sets the `default_header_type` for propigations: https://github.com/Kong/kong/blob/master/kong/plugins/opentelemetry/handler.lua#L150 However, doesn't allow the modification of `header_type` in the `schema`, so it always defaults to `preserve`. However, based on the function it's calling: https://github.com/Kong/kong/blob/master/kong/tracing/propagation.lua#L432 > -- If conf_header_type is set to `preserve`, found_header_type is used over default_header_type; The above means the `default_header_type` is never used. We want the `default_header_type` to be used, and we want to ignore the incoming header type. This commit takes care of addressing this issue: Kong#10246 I am not implmenting the ability to modify the `default_header_type` as opentelemetry notes it should default to `w3c` which it currently is: https://opentelemetry.io/docs/concepts/signals/traces/#context-propagation
c71b74b
to
14e9947
Compare
@samugi Thanks! Went ahead and rebased and resolved the conflicts, lemme know if you need anything else from my end! |
* Add header_type to OTel documentation This pull request will add the ability to set the `header_type` for the opentelemetry plugin: Kong/kong#10620 To ensure the documentation remains in sync with the options available for plugins, this adds the `header_type` key to the `config` section showing its something that can be set. * Update app/_hub/kong-inc/opentelemetry/_index.md Co-authored-by: lena-larionova <[email protected]> * Remove required: true to match change The change ended up marking the schema to be required: false, so removing this line as it's no longer releveant. --------- Co-authored-by: lena-larionova <[email protected]>
Summary
At the moment the opentelemtry plugin sets the
default_header_type
for propigations:https://github.com/Kong/kong/blob/master/kong/plugins/opentelemetry/handler.lua#L150
However, doesn't allow the modification of
header_type
in theschema
, so it always defaults topreserve
. However, based on the function it's calling:https://github.com/Kong/kong/blob/master/kong/tracing/propagation.lua#L432
The above means the
default_header_type
is never used. We want thedefault_header_type
to be used, and we want to ignore the incoming header type.I am not implmenting the ability to modify the
default_header_type
as opentelemetry notes it should default tow3c
which it currently is:https://opentelemetry.io/docs/concepts/signals/traces/#context-propagation
Checklist
Full changelog
header_type
for the opentelemetry pluginIssue reference
Fix #10246