[Rust] Add ZerobusSdkBuilder::application_name for x-zerobus-sdk header#268
Open
flaviofcruz wants to merge 2 commits intomainfrom
Open
[Rust] Add ZerobusSdkBuilder::application_name for x-zerobus-sdk header#268flaviofcruz wants to merge 2 commits intomainfrom
flaviofcruz wants to merge 2 commits intomainfrom
Conversation
Contributor
|
Hey, we have this on our roadmap, but we will be using the user agent header instead of the x-zerobus-sdk header since we will move to a newer tonic version which doesn't override this standard header. We'll also need to modify server side handling for this and we have a couple of asks regarding it from PM side so I need to see about it first. I'll review this on Monday. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ZerobusSdkBuilder::application_name(...)so callers can append a custom identifier to thex-zerobus-sdkgRPC metadata header (e.g.zerobus-sdk-rs/1.3.0 my-app/1.0). The SDK versionprefix is preserved so server-side telemetry still sees the SDK version.
x-zerobus-sdkinjection fromOAuthHeadersProviderto the gRPC layer. The SDK now owns this header on both the proto stream and Arrow Flight paths; anyx-zerobus-sdkvalue returned bya custom
HeadersProvideris ignored.OAuthHeadersProvider::get_headersno longer setsx-zerobus-sdk(now redundant).DEFAULT_X_ZEROBUS_SDKremains exported.The intent is to set the application name in the vector zerobus sink so we know how much traffic is from vector.
Motivation
Embedders (e.g. Vector) want to identify their application in server-side telemetry without having to implement a custom
HeadersProvidersolely to set one header. Making this a first-classbuilder option also guarantees the SDK version prefix can't be accidentally dropped by a buggy custom provider.
Behavior change
Custom
HeadersProviderimplementations that previously set their ownx-zerobus-sdkvalue will now have that value silently overridden by the SDK-owned one. Use.application_name(...)tocustomize. Noted in
NEXT_CHANGELOG.md.Test plan
cargo test --release— all 107 unit + 80 arrow + integration tests passcargo clippy --release --all-targetsclean (only pre-existing warnings)application_namecasescomposition logic but not wire behavior.
Two notes: