-
Notifications
You must be signed in to change notification settings - Fork 66
Unify OTLP/OTAP gRPC Configuration and Introduce Experimental Non-Tonic Receiver #1382
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
Draft
lquerel
wants to merge
91
commits into
open-telemetry:main
Choose a base branch
from
lquerel:grpc-receiver-shared-conf
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 87 commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
4f5a128
Contribute Beaubourg to OTEL
lquerel f0bf6a4
Merge branch 'main' into main
lquerel 39d3b2f
Merge branch 'open-telemetry:main' into main
lquerel 94c1c2f
Merge branch 'open-telemetry:main' into main
lquerel a6cc070
Merge branch 'open-telemetry:main' into main
lquerel 2b1c910
Merge branch 'open-telemetry:main' into main
lquerel 4646aff
Merge branch 'open-telemetry:main' into main
lquerel 15910da
Merge branch 'open-telemetry:main' into main
lquerel b3264cc
Merge branch 'open-telemetry:main' into grpc-receiver-shared-conf
lquerel c72610a
Refactor OTLP and OTAP receiver to share a more extended gRPC configu…
lquerel 237d194
Fix otap_exporter tests
lquerel 1893f32
Rename GrpcServerConfig into GrpcServerSettings
lquerel 01a68e4
Rename SharedState into AckSubscriptionState
lquerel 7067292
Change Arc into Rc in local receiver
lquerel 20de200
Refactor compression.rs
lquerel ed9ab1a
Fix documentation
lquerel 38ed5f2
Document and refactor code for clarity
lquerel 21f7e1a
Document and refactor code for clarity
lquerel a33f48d
Update rust/otap-dataflow/crates/config/src/byte_units.rs
lquerel 7c8d897
Improve effect handler implementations
lquerel 633bea0
Add concurrency per connection
lquerel 12ec6e6
Try to remove Tonic for a new otap receiver.
lquerel 5ac172a
Try to remove Tonic for a new otap receiver.
lquerel ec1581c
Code cleanup
lquerel 0c1dfb6
stream_batch_statuses returns now a concrete stream implementation
lquerel 5103f6d
Introduce an admission controller
lquerel 10fa2fe
Reuse ZstdDecompressor
lquerel aee3a0f
Reuse an output buffer when encoding BatchStatus responses so most se…
lquerel ce68e4e
Parse grpc-encoding without allocating/lowercasing by using byte-wise…
lquerel d914124
Stream frame payloads without copying every H2 chunk into a single gr…
lquerel 87d04a5
Refactor LocalFutureSet to use a FuturesUnordered instead of a Vec of…
lquerel 16b7716
Fix clippy issues
lquerel 6a5ec40
Merge remote-tracking branch 'upstream/main' into grpc-receiver-share…
lquerel e9d9d62
Merge with main
lquerel 6c48fab
Update benchmarks to use new OTAP receiver
lquerel 1cd16c8
Add support for gzip and deflate compression
lquerel 2ef166d
Add support for gzip and deflate compression on both request and resp…
lquerel ddea999
Add support http2_keepalive.
lquerel 051e9a9
Add support for timeout.
lquerel 852fa49
Adapt the unit tests used for otap_receiver.rs to otel_receiver.rs
lquerel 8b03d49
Add more unit tests for otel_receiver.rs
lquerel f31ef7c
Fix unit tests for otel_receiver.rs
lquerel 576514d
Add ToDo in otel_receiver.rs
lquerel 32d7d1b
Add more tests
lquerel 61fd7ae
Add more unit tests
lquerel 25eea44
Refactor code
lquerel e5a24f9
Refactor code
lquerel 5dad5df
Add comments
lquerel 8eb0a8c
Add comments
lquerel 3f37fcf
Add comments
lquerel ba4186a
Remove the Send constraint on BodyStream and RequestStream
lquerel 8fe13f7
More documentation
lquerel 658f09f
Reorganize the tests
lquerel 00cefa6
Add an e2e test for otel_receiver.rs
lquerel 87ad1a3
Add otel_receiver_design.png diagram
lquerel aa595fd
Merge remote-tracking branch 'origin/grpc-receiver-shared-conf' into …
lquerel a6ba0e5
Merge remote-tracking branch 'upstream/main' into grpc-receiver-share…
lquerel 3f7a532
Update diagram
lquerel 17d9974
Update documentation
lquerel 12829a6
Merge remote-tracking branch 'origin/grpc-receiver-shared-conf' into …
lquerel 1a3f06c
Update diagram
lquerel 5eb97d2
Merge remote-tracking branch 'origin/grpc-receiver-shared-conf' into …
lquerel d383878
Update documentation
lquerel caee87e
Merge remote-tracking branch 'origin/grpc-receiver-shared-conf' into …
lquerel 45ee6bd
Add OTLP support in otel_receiver.rs
lquerel 9d20625
Clean up code, define new URN for otel receiver
lquerel 82704c4
Prepare otel_receiver.rs to become the default OTLP/OTAP receiver
lquerel 7b9e9c6
Add a more complete OTLP test
lquerel 8664c2f
Add more complete tests for OTLP and OTAP
lquerel 6ecf6b4
Add new option to display on the console the signal throughput in per…
lquerel c921266
Replace Vec<u8> by bytes::Bytes in OtlpProtoByte
lquerel 65036cb
Remove redundant tcp nodelay
lquerel d845bef
Move the JoinSet:::join_next outside of the select!
lquerel 7f03421
Replace select! by a stream approach into handle_tcp_conn
lquerel 7974336
Replace select! in otel_receiver and grpc
lquerel b0fb382
Replace spawn_local tasks per stream with FutureUnordered
lquerel 8ce027f
Refactor code around the response encoder
lquerel bbff3ca
Fix unit tests
lquerel d106109
Improve ack management efficiency
lquerel f8e30f1
Use only one zstd decoder
lquerel 8bc6512
Document otel_receiver.rs
lquerel ff36a6c
Fix perf issue + Documentation
lquerel cffa021
Refactor code for clarity
lquerel c9f899a
Fix unbounded gRPC frame size & decompressed size
lquerel 594c7ef
Add timeout on HTTP2 handshake
lquerel a60680b
Fix ack slot leak on pipeline send failure
lquerel d04dc74
Fix some small corner cases
lquerel 4cd0fc7
Add security.md for otel_receiver
lquerel 63f375b
Add a security.md doc
lquerel 30d2358
Add architecture description
lquerel 5444c0a
OTLP and OTAP exporter.rs
lquerel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| // Copyright The OpenTelemetry Authors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| //! Support for byte units like "KB / KiB", "MB / MiB", "GB / GiB" in configuration files. | ||
|
|
||
| use byte_unit::Byte; | ||
| use serde::de::Error as DeError; | ||
| use serde::{Deserialize, Deserializer}; | ||
|
|
||
| #[derive(Deserialize)] | ||
| #[serde(untagged)] | ||
| enum Value { | ||
| Number(u64), | ||
| String(String), | ||
| } | ||
|
|
||
| /// Deserialize an optional byte size that can be specified either as a number (in bytes) | ||
| /// or as a string with units (e.g. "1 KB", "2 MiB"). | ||
| pub fn deserialize<'de, D>(deserializer: D) -> Result<Option<u32>, D::Error> | ||
| where | ||
| D: Deserializer<'de>, | ||
| { | ||
| let value = Option::<Value>::deserialize(deserializer)?; | ||
| let Some(value) = value else { | ||
| return Ok(None); | ||
| }; | ||
|
|
||
| let (bytes, repr) = match value { | ||
| Value::Number(value) => (value as u128, value.to_string()), | ||
| Value::String(text) => { | ||
| let parsed: Byte = text.parse().map_err(DeError::custom)?; | ||
| (parsed.as_u64() as u128, text) | ||
| } | ||
| }; | ||
|
|
||
| if bytes > u32::MAX as u128 { | ||
| return Err(DeError::custom(format!( | ||
| "byte size '{}' ({} bytes) exceeds u32::MAX ({} bytes)", | ||
| repr, | ||
| bytes, | ||
| u32::MAX | ||
| ))); | ||
| } | ||
|
|
||
| Ok(Some(bytes as u32)) | ||
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use super::deserialize; | ||
| use serde::Deserialize; | ||
|
|
||
| #[derive(Debug, Deserialize)] | ||
| struct Holder { | ||
| #[serde(default, deserialize_with = "deserialize")] | ||
| value: Option<u32>, | ||
| } | ||
|
|
||
| fn de_yaml(input: &str) -> Result<Holder, serde_yaml::Error> { | ||
| serde_yaml::from_str::<Holder>(input) | ||
| } | ||
|
|
||
| #[test] | ||
| fn parses_number_as_bytes() { | ||
| let cfg = de_yaml("value: 1024").expect("should parse numeric bytes"); | ||
| assert_eq!(cfg.value, Some(1024)); | ||
| } | ||
|
|
||
| #[test] | ||
| fn parses_string_with_iec_units() { | ||
| // 1 KiB == 1024 bytes | ||
| let cfg = de_yaml("value: 1 KiB").expect("should parse 1 KiB"); | ||
| assert_eq!(cfg.value, Some(1024)); | ||
|
|
||
| // 2 MiB == 2 * 1024 * 1024 bytes | ||
| let cfg = de_yaml("value: '2 MiB'").expect("should parse 2 MiB"); | ||
| assert_eq!(cfg.value, Some(2 * 1024 * 1024)); | ||
| } | ||
|
|
||
| #[test] | ||
| fn parses_plain_string_number() { | ||
| let cfg = de_yaml("value: '2048'").expect("should parse plain numeric string"); | ||
| assert_eq!(cfg.value, Some(2048)); | ||
| } | ||
|
|
||
| #[test] | ||
| fn missing_value_is_none() { | ||
| let cfg = de_yaml("{}").expect("should parse with missing field as None"); | ||
| assert_eq!(cfg.value, None); | ||
| } | ||
|
|
||
| #[test] | ||
| fn overflow_is_rejected() { | ||
| // 4 GiB == 4 * 1024^3 bytes = 4_294_967_296 > u32::MAX (4_294_967_295) | ||
| let err = de_yaml("value: 4 GiB").expect_err("should error for overflow"); | ||
| let msg = err.to_string(); | ||
| assert!( | ||
| msg.contains("exceeds u32::MAX"), | ||
| "unexpected error: {}", | ||
| msg | ||
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn parses_no_space_decimal_units() { | ||
| let cfg = de_yaml("value: 1KB").expect("should parse 1KB without space"); | ||
| assert_eq!(cfg.value, Some(1000)); | ||
|
|
||
| let cfg = de_yaml("value: 10MB").expect("should parse 10MB without space"); | ||
| assert_eq!(cfg.value, Some(10_000_000)); | ||
|
|
||
| // Lowercase 'b' should still be treated as bytes per crate behavior | ||
| let cfg = de_yaml("value: 1kb").expect("should parse 1kb as 1000 bits => 125 bytes"); | ||
| assert_eq!(cfg.value, Some(125)); | ||
| } | ||
|
|
||
| #[test] | ||
| fn parses_fractional_values_and_rounding() { | ||
| // Decimal unit with fraction | ||
| let cfg = de_yaml("value: '1.5 MB'").expect("should parse 1.5 MB"); | ||
| assert_eq!(cfg.value, Some(1_500_000)); | ||
|
|
||
| // Binary unit with fraction (exact) | ||
| let cfg = de_yaml("value: '0.5 KiB'").expect("should parse 0.5 KiB to 512 bytes"); | ||
| assert_eq!(cfg.value, Some(512)); | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
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.
The dependencies above are listed in alphabetical order. Rearrange these as well?