kumar-mallikarjuna commented on code in PR #26850:
URL: https://github.com/apache/flink/pull/26850#discussion_r2245625003


##########
flink-metrics/flink-metrics-otel/src/main/java/org/apache/flink/events/otel/OpenTelemetryEventReporter.java:
##########
@@ -60,11 +64,21 @@ public OpenTelemetryEventReporter() {
     @Override
     public void open(MetricConfig metricConfig) {
         LOG.info("Starting OpenTelemetryEventReporter");
-        OtlpGrpcLogRecordExporterBuilder builder = 
OtlpGrpcLogRecordExporter.builder();
-        tryConfigureEndpoint(metricConfig, builder::setEndpoint);
-        tryConfigureTimeout(metricConfig, builder::setTimeout);
+        final String protocol =
+                
metricConfig.getProperty(OpenTelemetryReporterOptions.EXPORTER_PROTOCOL.key());
+
+        if (Protocol.HTTP.name().equalsIgnoreCase(protocol)) {
+            OtlpHttpLogRecordExporterBuilder builder = 
OtlpHttpLogRecordExporter.builder();
+            tryConfigureEndpoint(metricConfig, builder::setEndpoint);
+            tryConfigureTimeout(metricConfig, builder::setTimeout);
+            logRecordExporter = builder.build();
+        } else {
+            OtlpGrpcLogRecordExporterBuilder builder = 
OtlpGrpcLogRecordExporter.builder();
+            tryConfigureEndpoint(metricConfig, builder::setEndpoint);
+            tryConfigureTimeout(metricConfig, builder::setTimeout);
+            logRecordExporter = 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]

Reply via email to