kumar-mallikarjuna commented on code in PR #26850:
URL: https://github.com/apache/flink/pull/26850#discussion_r2245625673
##########
flink-metrics/flink-metrics-otel/src/main/java/org/apache/flink/metrics/otel/OpenTelemetryMetricReporter.java:
##########
@@ -92,10 +95,21 @@ public OpenTelemetryMetricReporter() {
public void open(MetricConfig metricConfig) {
LOG.info("Starting OpenTelemetryMetricReporter");
super.open(metricConfig);
- OtlpGrpcMetricExporterBuilder builder =
OtlpGrpcMetricExporter.builder();
- tryConfigureEndpoint(metricConfig, builder::setEndpoint);
- tryConfigureTimeout(metricConfig, builder::setTimeout);
- exporter = builder.build();
+
+ final String protocol =
+
metricConfig.getProperty(OpenTelemetryReporterOptions.EXPORTER_PROTOCOL.key());
+
+ if (Protocol.HTTP.name().equalsIgnoreCase(protocol)) {
+ OtlpHttpMetricExporterBuilder builder =
OtlpHttpMetricExporter.builder();
+ tryConfigureEndpoint(metricConfig, builder::setEndpoint);
+ tryConfigureTimeout(metricConfig, builder::setTimeout);
+ exporter = builder.build();
+ } else {
+ OtlpGrpcMetricExporterBuilder builder =
OtlpGrpcMetricExporter.builder();
+ tryConfigureEndpoint(metricConfig, builder::setEndpoint);
+ tryConfigureTimeout(metricConfig, builder::setTimeout);
+ exporter = builder.build();
Review Comment:
Done!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]