-
Notifications
You must be signed in to change notification settings - Fork 1k
Change Spring starter default otlp protocol from gRPC to http/protobuf #10212
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,14 +8,17 @@ | |
| import io.opentelemetry.exporter.otlp.internal.OtlpConfigUtil; | ||
| import java.time.Duration; | ||
| import java.util.Map; | ||
| import java.util.Objects; | ||
| import java.util.function.BiConsumer; | ||
| import java.util.function.Function; | ||
| import java.util.function.Supplier; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| class OtlpExporterUtil { | ||
| private OtlpExporterUtil() {} | ||
|
|
||
| private static final Logger logger = LoggerFactory.getLogger(OtlpExporterUtil.class); | ||
|
|
||
| static <G, H, E> E applySignalProperties( | ||
| String dataType, | ||
| OtlpExporterProperties properties, | ||
|
|
@@ -39,7 +42,17 @@ static <G, H, E> E applySignalProperties( | |
| G grpcBuilder = newGrpcBuilder.get(); | ||
| H httpBuilder = newHttpBuilder.get(); | ||
|
|
||
| boolean isHttpProtobuf = Objects.equals(protocol, OtlpConfigUtil.PROTOCOL_HTTP_PROTOBUF); | ||
| boolean isHttpProtobuf = !"grpc".equals(protocol); | ||
|
|
||
| if (protocol != null | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sdk chooses to fail when invalid protocol is specified, see https://github.com/open-telemetry/opentelemetry-java/blob/d9f9812d4375a4229caff43bd681c50b7a45776a/exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/internal/OtlpLogRecordExporterProvider.java#L75
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps it could be rediscussed later with the perspective of what to do with the OTel starter configurations.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have created #10213 |
||
| && !"grpc".equals(protocol) | ||
| && !OtlpConfigUtil.PROTOCOL_HTTP_PROTOBUF.equals(protocol)) { | ||
| logger.warn( | ||
| protocol | ||
| + " protocol is not managed. " | ||
|
||
| + OtlpConfigUtil.PROTOCOL_HTTP_PROTOBUF | ||
| + " will be used."); | ||
| } | ||
|
|
||
| String endpoint = signalProperties.getEndpoint(); | ||
| if (endpoint == null) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.