Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ static String[] getSegments(String property) {
property = property.substring(OTEL_INSTRUMENTATION_PREFIX.length());
}
// Split the remainder of the property on "."
return property.replace('-', '_').split("\\.");
return property
.replaceAll(".experimental[.-]([^.]+)", ".$1/development")
.replace('-', '_')
.split("\\.");
}

private String translateProperty(String property) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void getProperties() {
.isTrue();

// common cases
assertThat(bridge.getBoolean("otel.instrumentation.runtime-telemetry.enabled")).isFalse();
assertThat(bridge.getBoolean("otel.instrumentation.runtime-telemetry.enabled")).isTrue();

// check all the types
Map<String, String> expectedMap = new HashMap<>();
Expand Down Expand Up @@ -141,4 +141,18 @@ void agentTranslation() {
assertThat(bridge.getBoolean("otel.javaagent.experimental.indy")).isTrue();
assertThat(bridge.getString("otel.javaagent.logging")).isEqualTo("application");
}

@Test
void developmentTranslation() {
String prefix = "otel.instrumentation.runtime-telemetry";
assertThat(bridge.getBoolean(prefix + ".experimental-gc-profiler.experimental-metrics"))
.isTrue();
assertThat(bridge.getBoolean(prefix + ".experimental.gc-profiler.experimental.metrics"))
.isTrue();

// experimental in the middle of the property name should be preserved
assertThat(
bridge.getBoolean("otel.instrumentation.runtime-telemetry.emit-experimental-telemetry"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's really only this setting - so we can define a custom mapping like emit-experimental-telemetry/development

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added this mapping

.isTrue();
}
}
8 changes: 5 additions & 3 deletions declarative-config-bridge/src/test/resources/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ instrumentation/development:
full_name:
preserved: true
agent:
experimental:
indy: true
indy/development: true
runtime_telemetry:
enabled: false
emit_experimental_telemetry: true
enabled: true
gc_profiler/development:
metrics/development: true
example_instrumentation:
string_key: value
bool_key: true
Expand Down
Loading