-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OpenTelemetry traces and metrics config fallback to base
- Loading branch information
Showing
8 changed files
with
283 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 0 additions & 92 deletions
92
.../io/quarkus/opentelemetry/runtime/config/HierarchicalOTelConnectionConfigInterceptor.java
This file was deleted.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
...in/java/io/quarkus/opentelemetry/runtime/config/OpenTelemetryConfigBuilderCustomizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package io.quarkus.opentelemetry.runtime.config; | ||
|
||
import static io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterConfig.DEFAULT_GRPC_BASE_URI; | ||
import static io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterConfig.Protocol.GRPC; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import io.smallrye.config.FallbackConfigSourceInterceptor; | ||
import io.smallrye.config.SmallRyeConfigBuilder; | ||
import io.smallrye.config.SmallRyeConfigBuilderCustomizer; | ||
|
||
public class OpenTelemetryConfigBuilderCustomizer implements SmallRyeConfigBuilderCustomizer { | ||
@Override | ||
public void configBuilder(final SmallRyeConfigBuilder builder) { | ||
// Main defaults | ||
builder.withDefaultValue("quarkus.otel.exporter.otlp.endpoint", DEFAULT_GRPC_BASE_URI); | ||
builder.withDefaultValue("quarkus.otel.exporter.otlp.protocol", GRPC); | ||
builder.withDefaultValue("quarkus.otel.exporter.otlp.timeout", "10s"); | ||
builder.withDefaultValue("quarkus.otel.exporter.otlp.proxy-options.enabled", "false"); | ||
|
||
Map<String, String> fallbacks = new HashMap<>(30); | ||
// Traces | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.endpoint", "quarkus.otel.exporter.otlp.endpoint"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.headers", "quarkus.otel.exporter.otlp.headers"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.compression", "quarkus.otel.exporter.otlp.compression"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.timeout", "quarkus.otel.exporter.otlp.timeout"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.protocol", "quarkus.otel.exporter.otlp.protocol"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.key-cert.keys", "quarkus.otel.exporter.otlp.key-cert.keys"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.key-cert.certs", "quarkus.otel.exporter.otlp.key-cert.certs"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.trust-cert.certs", "quarkus.otel.exporter.otlp.trust-cert.certs"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.tls-configuration-name", | ||
"quarkus.otel.exporter.otlp.tls-configuration-name"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.proxy-options.enabled", | ||
"quarkus.otel.exporter.otlp.proxy-options.enabled"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.proxy-options.username", | ||
"quarkus.otel.exporter.otlp.proxy-options.username"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.proxy-options.password", | ||
"quarkus.otel.exporter.otlp.proxy-options.password"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.proxy-options.host", "quarkus.otel.exporter.otlp.proxy-options.host"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.traces.proxy-options.port", "quarkus.otel.exporter.otlp.proxy-options.port"); | ||
|
||
// Metrics | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.endpoint", "quarkus.otel.exporter.otlp.endpoint"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.headers", "quarkus.otel.exporter.otlp.headers"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.compression", "quarkus.otel.exporter.otlp.compression"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.timeout", "quarkus.otel.exporter.otlp.timeout"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.protocol", "quarkus.otel.exporter.otlp.protocol"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.key-cert.keys", "quarkus.otel.exporter.otlp.key-cert.keys"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.key-cert.certs", "quarkus.otel.exporter.otlp.key-cert.certs"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.trust-cert.certs", "quarkus.otel.exporter.otlp.trust-cert.certs"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.tls-configuration-name", | ||
"quarkus.otel.exporter.otlp.tls-configuration-name"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.proxy-options.enabled", | ||
"quarkus.otel.exporter.otlp.proxy-options.enabled"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.proxy-options.username", | ||
"quarkus.otel.exporter.otlp.proxy-options.username"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.proxy-options.password", | ||
"quarkus.otel.exporter.otlp.proxy-options.password"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.proxy-options.host", "quarkus.otel.exporter.otlp.proxy-options.host"); | ||
fallbacks.put("quarkus.otel.exporter.otlp.metrics.proxy-options.port", "quarkus.otel.exporter.otlp.proxy-options.port"); | ||
|
||
builder.withInterceptors(new FallbackConfigSourceInterceptor(fallbacks)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...y/runtime/src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceInterceptor
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...e/src/main/resources/META-INF/services/io.smallrye.config.SmallRyeConfigBuilderCustomizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
io.quarkus.opentelemetry.runtime.config.OpenTelemetryConfigBuilderCustomizer |
62 changes: 0 additions & 62 deletions
62
...quarkus/opentelemetry/runtime/config/HierarchicalOTelConnectionConfigInterceptorTest.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.