-
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.
Adjust toggle names in OTel InstrumentBuildTimeConfig
This is to be consistent with the new extension names.
- Loading branch information
Showing
5 changed files
with
93 additions
and
11 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
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
40 changes: 40 additions & 0 deletions
40
...emetry/runtime/config/build/InstrumentBuildTimeConfigFallbackConfigSourceInterceptor.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,40 @@ | ||
package io.quarkus.opentelemetry.runtime.config.build; | ||
|
||
import java.util.function.Function; | ||
|
||
import io.smallrye.config.FallbackConfigSourceInterceptor; | ||
|
||
/** | ||
* @deprecated maps the old config to the new config, should be removed at some point | ||
*/ | ||
@Deprecated(forRemoval = true, since = "3.9") | ||
public class InstrumentBuildTimeConfigFallbackConfigSourceInterceptor extends FallbackConfigSourceInterceptor { | ||
|
||
private static final Function<String, String> RENAME_FUNCTION = new Function<String, String>() { | ||
@Override | ||
public String apply(String s) { | ||
if (!s.startsWith("quarkus.otel.instrument.")) { | ||
return s; | ||
} | ||
|
||
if ("quarkus.otel.instrument.messaging".equals(s)) { | ||
return "quarkus.otel.instrument.reactive-messaging"; | ||
} | ||
if ("quarkus.otel.instrument.resteasy-client".equals(s)) { | ||
return "quarkus.otel.instrument.rest-client-classic"; | ||
} | ||
if ("quarkus.otel.instrument.rest".equals(s)) { | ||
return "quarkus.otel.instrument.resteasy-reactive"; | ||
} | ||
if ("quarkus.otel.instrument.resteasy".equals(s)) { | ||
return "quarkus.otel.instrument.resteasy-classic"; | ||
} | ||
|
||
return s; | ||
} | ||
}; | ||
|
||
public InstrumentBuildTimeConfigFallbackConfigSourceInterceptor() { | ||
super(RENAME_FUNCTION); | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...emetry/runtime/config/build/InstrumentBuildTimeConfigRelocateConfigSourceInterceptor.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,40 @@ | ||
package io.quarkus.opentelemetry.runtime.config.build; | ||
|
||
import java.util.function.Function; | ||
|
||
import io.smallrye.config.RelocateConfigSourceInterceptor; | ||
|
||
/** | ||
* @deprecated maps the old config to the new config, should be removed at some point | ||
*/ | ||
@Deprecated(forRemoval = true, since = "3.9") | ||
public class InstrumentBuildTimeConfigRelocateConfigSourceInterceptor extends RelocateConfigSourceInterceptor { | ||
|
||
private static final Function<String, String> RENAME_FUNCTION = new Function<String, String>() { | ||
@Override | ||
public String apply(String s) { | ||
if (!s.startsWith("quarkus.otel.instrument.")) { | ||
return s; | ||
} | ||
|
||
if ("quarkus.otel.instrument.reactive-messaging".equals(s)) { | ||
return "quarkus.otel.instrument.messaging"; | ||
} | ||
if ("quarkus.otel.instrument.rest-client-classic".equals(s)) { | ||
return "quarkus.otel.instrument.resteasy-client"; | ||
} | ||
if ("quarkus.otel.instrument.resteasy-reactive".equals(s)) { | ||
return "quarkus.otel.instrument.rest"; | ||
} | ||
if ("quarkus.otel.instrument.resteasy-classic".equals(s)) { | ||
return "quarkus.otel.instrument.resteasy"; | ||
} | ||
|
||
return s; | ||
} | ||
}; | ||
|
||
public InstrumentBuildTimeConfigRelocateConfigSourceInterceptor() { | ||
super(RENAME_FUNCTION); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...y/runtime/src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceInterceptor
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
io.quarkus.opentelemetry.runtime.config.OTelFallbackConfigSourceInterceptor | ||
io.quarkus.opentelemetry.runtime.config.build.InstrumentBuildTimeConfigFallbackConfigSourceInterceptor | ||
io.quarkus.opentelemetry.runtime.config.build.InstrumentBuildTimeConfigRelocateConfigSourceInterceptor |