-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Support custom metric conversions in OTLP statSink #40854
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
base: main
Are you sure you want to change the base?
Conversation
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
f9f89ae
to
1805eb8
Compare
api/envoy/extensions/stat_sinks/open_telemetry/v3/open_telemetry.proto
Outdated
Show resolved
Hide resolved
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
return std::make_unique<OpenTelemetryGrpcSink>(otlp_metrics_flusher, grpc_metrics_exporter); | ||
return std::make_unique<OpenTelemetryGrpcSink>( | ||
otlp_metrics_flusher, grpc_metrics_exporter, | ||
server.timeSource().systemTime().time_since_epoch().count()); |
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.
This looks like another change?
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.
This is the object construction time which will be used as the last flush time for this first flush.
envoy::extensions::stat_sinks::open_telemetry::v3::SinkConfig::ConversionAction> { | ||
public: | ||
explicit OnMatchAction( | ||
envoy::extensions::stat_sinks::open_telemetry::v3::SinkConfig::ConversionAction config) |
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.
Maybe pass by reference and return a reference?
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 caller create a temporary Action object so we have to do a copy.
I add a TODO to check if we can change that to a move operation.
https://screenshot.googleplex.com/7afqYYXURaDf4Lc
api/envoy/extensions/stat_sinks/open_telemetry/v3/open_telemetry.proto
Outdated
Show resolved
Hide resolved
source/extensions/stat_sinks/open_telemetry/open_telemetry_impl.cc
Outdated
Show resolved
Hide resolved
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.
Generally, looks fine to me. But it's hard to compare diff since a lot of code got moved. I'll take a deeper look later.
@@ -107,7 +107,7 @@ class OpenTelemetryGrpcIntegrationTest : public Grpc::GrpcClientIntegrationParam | |||
for (const opentelemetry::proto::metrics::v1::Metric& metric : metrics) { | |||
if (metric.name() == getFullStatName("cluster.membership_change") && metric.has_sum()) { | |||
known_counter_exists = true; | |||
EXPECT_EQ(1, metric.sum().data_points().size()); | |||
EXPECT_EQ(2, metric.sum().data_points().size()); |
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.
Why did this change?
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.
It is because we have aggregation logic so the metrics with the same name are aggregated now
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
api/envoy/extensions/matching/common_inputs/stats/v3/stats.proto
Outdated
Show resolved
Hide resolved
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
Signed-off-by: Xuyang Tao <[email protected]>
/lgtm api |
@ohadvano Looking for your feedback as you are an owner for the extension. I can give a general review. |
See the proto file for the detailed feature description.