Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

[KafkaChannels] Pass-through "additional headers" #1001

Conversation

travis-minke-sap
Copy link
Contributor

The common MessageReceiver implementation forwards "additional headers" to the registered handler. These are non-ce headers that are deemed important to pass-through (x-b3, etc). Currently the KafkaChannel implementations do not forward these headers. Not forwarding such headers can, as an example, limit the ability to perform complete e2e tracing in Istio.

Proposed Changes

  • 🎁 Enhance receiver to append "additional headers" into Sarama ProducerMessage.Headers
  • 🎁 Enhance dispatcher to extract "additional headers" from Sarama ConsumerMessage.Headers
  • 🎁 Enhance dispatcher to include "additional headers" in outbound requests.

Release Note

KafkaChannels will now pass-through the "x-request-id", "knative-*" and "x-b3-*" headers for all events.

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 24, 2021
@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 24, 2021
@codecov
Copy link

codecov bot commented Nov 24, 2021

Codecov Report

Merging #1001 (763eba4) into main (eaa0e79) will increase coverage by 0.04%.
The diff coverage is 85.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1001      +/-   ##
==========================================
+ Coverage   74.69%   74.74%   +0.04%     
==========================================
  Files         121      121              
  Lines        5675     5693      +18     
==========================================
+ Hits         4239     4255      +16     
- Misses       1213     1215       +2     
  Partials      223      223              
Impacted Files Coverage Δ
...onsolidated/dispatcher/consumer_message_handler.go 0.00% <0.00%> (ø)
pkg/channel/consolidated/dispatcher/dispatcher.go 63.69% <0.00%> (-0.44%) ⬇️
...annel/distributed/dispatcher/dispatcher/handler.go 89.09% <100.00%> (+0.20%) ⬆️
.../channel/distributed/receiver/producer/producer.go 69.66% <100.00%> (+0.34%) ⬆️
pkg/common/tracing/tracing.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eaa0e79...763eba4. Read the comment docs.

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-sandbox-eventing-kafka-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/channel/consolidated/dispatcher/dispatcher.go 66.1% 65.5% -0.6
pkg/channel/distributed/dispatcher/dispatcher/handler.go 92.3% 92.5% 0.2
pkg/channel/distributed/receiver/producer/producer.go 78.1% 78.4% 0.3

Copy link
Contributor

@matzew matzew left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

thanks

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 30, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matzew, travis-minke-sap

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [matzew,travis-minke-sap]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit 4089422 into knative-extensions:main Nov 30, 2021
@travis-minke-sap travis-minke-sap deleted the kafkachannel-passthrough-headers branch November 30, 2021 14:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants