-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Add auto-configuration for OTLP gRPC format #35863
Labels
status: superseded
An issue that has been superseded by another
Comments
mhalbritter
added
type: enhancement
A general enhancement
theme: observability
Issues related to observability
labels
Jun 13, 2023
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Maybe it will be useful to someone. Until autoconfiguration is implemented out-of-the-box, you can use this code in your project. package org.example.infrastructure.monitoring;
import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter;
import org.springframework.boot.actuate.autoconfigure.tracing.otlp.OtlpProperties;
import org.springframework.boot.actuate.autoconfigure.tracing.otlp.OtlpTracingConnectionDetails;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
class OtlpGrpcExporterAutoConfiguration {
/**
* This is a copy of autoconfiguration {@link io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter} from
* {@link org.springframework.boot.actuate.autoconfigure.tracing.otlp.OtlpTracingConfigurations}, but for gRPC.
*/
@Bean
OtlpGrpcSpanExporter otlpGrpcSpanExporter(OtlpProperties properties, OtlpTracingConnectionDetails connectionDetails) {
var builder = OtlpGrpcSpanExporter.builder()
.setEndpoint(connectionDetails.getUrl())
.setTimeout(properties.getTimeout())
// TODO: use Enum#name instead of String#valueof. OtlpProperties#Compression
// enum has package private access
.setCompression(String.valueOf(properties.getCompression()).toLowerCase());
properties.getHeaders().forEach(builder::addHeader);
return builder.build();
}
} application.yml: management:
otlp:
tracing:
endpoint: http://localhost:4317/v1/traces
compression: gzip |
I've provided an initial proposal to support |
timpeeters
added a commit
to timpeeters/spring-boot
that referenced
this issue
Jul 1, 2024
…-config-for-otlp-grpc
mhalbritter
added
status: superseded
An issue that has been superseded by another
and removed
type: enhancement
A general enhancement
theme: observability
Issues related to observability
labels
Jul 4, 2024
Superseded by #41213. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implement auto-configuration for OpenTelemetry's
OtlpGrpcSpanExporter
.Originally posted by @vpavic in #35596 (comment)
The text was updated successfully, but these errors were encountered: