Skip to content

Create Otlp specific blackhole#1365

Merged
blt merged 4 commits intomainfrom
blt/create_otlp_specific_blackhole
May 28, 2025
Merged

Create Otlp specific blackhole#1365
blt merged 4 commits intomainfrom
blt/create_otlp_specific_blackhole

Conversation

@blt
Copy link
Copy Markdown
Collaborator

@blt blt commented May 22, 2025

What does this PR do?

The handling of Otlp is specialized enough that having a distinct
blackhole for it makes good sense, especially because we want to be
able to support gRPC request/response and could not with our existing
blackhole. In a subsequent PR I will remove the OtlpMetrics support
in the http blackhole. I believe I also understand how how to make
an otlp_grpc generator.

Motivation

REF SMPTNG-659

Copy link
Copy Markdown
Collaborator Author

blt commented May 22, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@blt blt marked this pull request as ready for review May 22, 2025 19:00
@blt blt requested a review from a team as a code owner May 22, 2025 19:00
@blt blt force-pushed the blt/create_otlp_specific_blackhole branch from 2031a4b to 0980921 Compare May 22, 2025 21:49
@blt blt force-pushed the blt/add_otlpmetric_variant_body_to_http_generator branch from 24189a2 to 782b23f Compare May 22, 2025 21:49
@blt blt force-pushed the blt/create_otlp_specific_blackhole branch from 0980921 to 37ff197 Compare May 22, 2025 21:52
@blt blt force-pushed the blt/add_otlpmetric_variant_body_to_http_generator branch 2 times, most recently from ab8327a to 698d55b Compare May 23, 2025 17:12
@blt blt force-pushed the blt/create_otlp_specific_blackhole branch from 37ff197 to 4813280 Compare May 23, 2025 17:12
@blt blt changed the base branch from blt/add_otlpmetric_variant_body_to_http_generator to graphite-base/1365 May 27, 2025 15:07
@blt blt force-pushed the blt/create_otlp_specific_blackhole branch from 4813280 to 55cba53 Compare May 27, 2025 15:07
@blt blt force-pushed the graphite-base/1365 branch from 698d55b to 6138689 Compare May 27, 2025 15:07
@blt blt changed the base branch from graphite-base/1365 to main May 27, 2025 15:07
@blt blt force-pushed the blt/create_otlp_specific_blackhole branch from 55cba53 to 8d31a7d Compare May 27, 2025 16:43
let request = request.into_inner();
let size = request.encoded_len();

counter!("bytes_received", &self.labels).increment(size as u64);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This blackhole produces multiple bytes_received series and will be incompatible with regression detector ingress analysis. No change required, just something that might be surprising & additional motivation to do aggregation in analysis.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I hadn't remember this but looking at this now, yeah, I feel like it strongly supports aggregation in analysis. Else we end up with sort of a goofy setup here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Changed my mind here. I do still think this needs to be repaired in analysis, but I do also need this data to work near-term. Adjusted in befba08. CC @truthbk .

req: Request<hyper::body::Incoming>,
) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> {
counter!("requests_received", &self.labels).increment(1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two thoughts on Content-Type. Should this apply a label by incoming content type?

Is this compatible with JSON-encoded protobufs? Naively I see serde support in the otel-proto crate, but I don't expect prost's decode to attempt JSON deserialization. I'm not familiar with Rust's JSON proto situation, but I think there might be a piece missing here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Two thoughts on Content-Type. Should this apply a label by incoming content type?

I don't see why not.

Is this compatible with JSON-encoded protobufs? Naively I see serde support in the otel-proto crate, but I don't expect prost's decode to attempt JSON deserialization. I'm not familiar with Rust's JSON proto situation, but I think there might be a piece missing here.

Let me look. Now that you ask I assumed that the decode would happen transparently but that's not a given.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yep, that was entirely broken. Good catch. Handled in 2e6decc.

@blt blt force-pushed the blt/create_otlp_specific_blackhole branch from dc1df06 to ea0a742 Compare May 27, 2025 18:17
Copy link
Copy Markdown
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

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

Won't comment on lading, or SMP specifics, but this blackhole implementation makes sense to me (slight concern on the aggregation in analysis and the current "incompatibility" with the regression detector analysis, and what its implications are today to compare performance and make claims).

@blt
Copy link
Copy Markdown
Collaborator Author

blt commented May 28, 2025

Won't comment on lading, or SMP specifics, but this blackhole implementation makes sense to me (slight concern on the aggregation in analysis and the current "incompatibility" with the regression detector analysis, and what its implications are today to compare performance and make claims).

Yeah. Having slept on this, I'm going to remove the incompatibility and we'll lose the inability to make claims that one signal received more bytes than another or that one protocol received more than another but we won't goof analysis.

@blt blt force-pushed the blt/create_otlp_specific_blackhole branch from 2e6decc to 7235a60 Compare May 28, 2025 22:00
blt added 4 commits May 28, 2025 15:09
The handling of Otlp is specialized enough that having a distinct
blackhole for it makes good sense, especially because we want to be
able to support gRPC request/response and could not with our existing
blackhole. In a subsequent PR I will remove the OtlpMetrics support
in the http blackhole. I believe I also understand how how to make
an otlp_grpc generator.

REF SMPTNG-659

Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
@blt blt force-pushed the blt/create_otlp_specific_blackhole branch from 7235a60 to af52d5a Compare May 28, 2025 22:10
@blt blt enabled auto-merge (squash) May 28, 2025 22:16
@blt blt merged commit 3c2c850 into main May 28, 2025
20 checks passed
@blt blt deleted the blt/create_otlp_specific_blackhole branch May 28, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants