Skip to content

Commit 557d836

Browse files
committed
pr review
1 parent 617c8cd commit 557d836

File tree

10 files changed

+48
-60
lines changed

10 files changed

+48
-60
lines changed

docs/contributing/documenting-instrumentation.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ semantic_conventions:
8888
- HTTP_CLIENT_SPANS
8989
- DATABASE_CLIENT_SPANS
9090
- JVM_RUNTIME_METRICS
91-
functions:
92-
- HTTP_ROUTE_ENRICHER
91+
features:
92+
- HTTP_ROUTE
9393
- CONTEXT_PROPAGATION
9494
disabled_by_default: true
9595
classification: library
@@ -177,22 +177,19 @@ List of possible options:
177177
* [GENAI_CLIENT_SPANS](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-spans.md)
178178
* [GENAI_CLIENT_METRICS](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-metrics.md#generative-ai-client-metrics)
179179

180-
### Functions (optional)
180+
### Features (optional)
181181

182-
As a way to help further categorize instrumentations, you can add a `functions` field with a list of
182+
As a way to help further categorize instrumentations, you can add a `features` field with a list of
183183
the relevant functionality descriptions.
184184

185185
List of possible options:
186186

187-
* `HTTP_ROUTE_ENRICHER`: Instrumentation that enriches HTTP spans with route information
188-
* `LIBRARY_DOMAIN_ENRICHER`: Instrumentation that enriches spans with library-specific domain information
187+
* `HTTP_ROUTE`: Instrumentation that enriches HTTP spans with route information
189188
* `EXPERIMENTAL_ONLY`: Instrumentation that is experimental and may not be stable
190189
* `CONTEXT_PROPAGATION`: Instrumentation that provides context propagation capabilities
191-
* `UPSTREAM_ADAPTER`: Instrumentation that adapts or bridges instrumentation from upstream libraries or frameworks
192-
* `CONFIGURATION`: Instrumentation that provides configuration-related functionality
190+
* `AUTO_INSTRUMENTATION_SHIM`: Instrumentation that adapts or bridges instrumentation from upstream libraries or frameworks
193191
* `CONTROLLER_SPANS`: Instrumentation that generates controller-level spans
194192
* `VIEW_SPANS`: Instrumentation that generates view-level spans
195-
* `SYSTEM_METRICS`: Instrumentation that generates system-level metrics
196193

197194
### Library Link
198195

docs/instrumentation-list.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ libraries:
7070
description: This instrumentation provides context propagation for Akka actors,
7171
it does not emit any telemetry on its own.
7272
library_link: https://doc.akka.io/libraries/akka-core/current/typed/index.html
73-
functions:
73+
features:
7474
- CONTEXT_PROPAGATION
7575
source_path: instrumentation/akka/akka-actor-2.3
7676
scope:
@@ -85,7 +85,7 @@ libraries:
8585
description: This instrumentation provides context propagation for the Akka Fork-Join
8686
Pool, it does not emit any telemetry on its own.
8787
library_link: https://doc.akka.io/libraries/akka-core/current/typed/index.html
88-
functions:
88+
features:
8989
- CONTEXT_PROPAGATION
9090
source_path: instrumentation/akka/akka-actor-fork-join-2.5
9191
scope:
@@ -105,8 +105,8 @@ libraries:
105105
- HTTP_SERVER_SPANS
106106
- HTTP_SERVER_METRICS
107107
library_link: https://doc.akka.io/docs/akka-http/current/index.html
108-
functions:
109-
- HTTP_ROUTE_ENRICHER
108+
features:
109+
- HTTP_ROUTE
110110
source_path: instrumentation/akka/akka-http-10.0
111111
scope:
112112
name: io.opentelemetry.akka-http-10.0

instrumentation-docs/readme.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,15 @@ public class SpringWebInstrumentationModule extends InstrumentationModule
134134
* FAAS_SERVER_SPANS
135135
* GENAI_CLIENT_SPANS
136136
* GENAI_CLIENT_METRIC
137-
* functions
137+
* features
138138
* The specific functionality that the instrumentation provides
139139
* Options are:
140-
* HTTP_ROUTE_ENRICHER
141-
* LIBRARY_DOMAIN_ENRICHER
140+
* HTTP_ROUTE
142141
* EXPERIMENTAL_ONLY
143142
* CONTEXT_PROPAGATION
144-
* UPSTREAM_ADAPTER
145-
* CONFIGURATION
143+
* AUTO_INSTRUMENTATION_SHIM
146144
* CONTROLLER_SPANS
147145
* VIEW_SPANS
148-
* SYSTEM_METRICS
149146
* library_link
150147
* URL to the library or framework's main website or documentation, or if those don't exist, the
151148
GitHub repository.
@@ -185,8 +182,8 @@ semantic_conventions: # List of semantic conventions
185182
- HTTP_CLIENT_SPANS
186183
- DATABASE_CLIENT_SPANS
187184
- JVM_RUNTIME_METRICS
188-
functions: # List of functions this instrumentation provides
189-
- HTTP_ROUTE_ENRICHER
185+
features: # List of features this instrumentation provides
186+
- HTTP_ROUTE
190187
- CONTEXT_PROPAGATION
191188
disabled_by_default: true # Defaults to `false`
192189
classification: internal # instrumentation classification: library | internal | custom
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99
* Represents functionality of instrumentations. This class is internal and is hence not for public
1010
* use. Its APIs are unstable and can change at any time.
1111
*/
12-
public enum InstrumentationFunction {
13-
HTTP_ROUTE_ENRICHER,
14-
LIBRARY_DOMAIN_ENRICHER,
12+
public enum InstrumentationFeature {
13+
HTTP_ROUTE,
1514
EXPERIMENTAL_ONLY,
1615
CONTEXT_PROPAGATION,
17-
UPSTREAM_ADAPTER,
18-
CONFIGURATION,
16+
AUTO_INSTRUMENTATION_SHIM,
1917
CONTROLLER_SPANS,
2018
VIEW_SPANS,
21-
SYSTEM_METRICS
2219
}

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/internal/InstrumentationMetadata.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class InstrumentationMetadata {
4747
@Nullable
4848
private Boolean overrideTelemetry;
4949

50-
private List<InstrumentationFunction> functions = emptyList();
50+
private List<InstrumentationFeature> features = emptyList();
5151

5252
public InstrumentationMetadata() {
5353
this.classification = InstrumentationClassification.LIBRARY.name();
@@ -149,12 +149,12 @@ public void setOverrideTelemetry(@Nullable Boolean overrideTelemetry) {
149149
this.overrideTelemetry = overrideTelemetry;
150150
}
151151

152-
public List<InstrumentationFunction> getFunctions() {
153-
return functions;
152+
public List<InstrumentationFeature> getFeatures() {
153+
return features;
154154
}
155155

156-
public void setFunctions(@Nullable List<InstrumentationFunction> functions) {
157-
this.functions = Objects.requireNonNullElse(functions, emptyList());
156+
public void setFeatures(@Nullable List<InstrumentationFeature> features) {
157+
this.features = Objects.requireNonNullElse(features, emptyList());
158158
}
159159

160160
/**
@@ -172,7 +172,7 @@ public static class Builder {
172172
private List<SemanticConvention> semanticConventions = emptyList();
173173
private List<ManualTelemetryEntry> additionalTelemetry = emptyList();
174174
@Nullable private Boolean overrideTelemetry;
175-
private List<InstrumentationFunction> functions = emptyList();
175+
private List<InstrumentationFeature> features = emptyList();
176176

177177
@CanIgnoreReturnValue
178178
public Builder description(@Nullable String description) {
@@ -229,8 +229,8 @@ public Builder overrideTelemetry(@Nullable Boolean overrideTelemetry) {
229229
}
230230

231231
@CanIgnoreReturnValue
232-
public Builder functions(@Nullable List<InstrumentationFunction> functions) {
233-
this.functions = Objects.requireNonNullElse(functions, emptyList());
232+
public Builder features(@Nullable List<InstrumentationFeature> features) {
233+
this.features = Objects.requireNonNullElse(features, emptyList());
234234
return this;
235235
}
236236

@@ -248,7 +248,7 @@ public InstrumentationMetadata build() {
248248
configurations);
249249
metadata.setAdditionalTelemetry(additionalTelemetry);
250250
metadata.setOverrideTelemetry(overrideTelemetry);
251-
metadata.setFunctions(functions);
251+
metadata.setFeatures(features);
252252
return metadata;
253253
}
254254
}

instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/utils/YamlHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ private static void addMetadataProperties(
215215
if (module.getMetadata().getDisabledByDefault()) {
216216
moduleMap.put("disabled_by_default", module.getMetadata().getDisabledByDefault());
217217
}
218-
if (!module.getMetadata().getFunctions().isEmpty()) {
218+
if (!module.getMetadata().getFeatures().isEmpty()) {
219219
List<String> functionNames =
220-
module.getMetadata().getFunctions().stream()
220+
module.getMetadata().getFeatures().stream()
221221
.map(Enum::name)
222222
.collect(Collectors.toList());
223-
moduleMap.put("functions", functionNames);
223+
moduleMap.put("features", functionNames);
224224
}
225225
}
226226
}

instrumentation-docs/src/test/java/io/opentelemetry/instrumentation/docs/utils/YamlHelperTest.java

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import io.opentelemetry.instrumentation.docs.internal.EmittedMetrics;
1717
import io.opentelemetry.instrumentation.docs.internal.EmittedSpans;
1818
import io.opentelemetry.instrumentation.docs.internal.InstrumentationClassification;
19-
import io.opentelemetry.instrumentation.docs.internal.InstrumentationFunction;
19+
import io.opentelemetry.instrumentation.docs.internal.InstrumentationFeature;
2020
import io.opentelemetry.instrumentation.docs.internal.InstrumentationMetadata;
2121
import io.opentelemetry.instrumentation.docs.internal.InstrumentationModule;
2222
import io.opentelemetry.instrumentation.docs.internal.InstrumentationType;
@@ -123,10 +123,9 @@ void testGenerateInstrumentationYamlSeparatesClassifications() throws Exception
123123
.description("Spring Web 6.0 instrumentation")
124124
.classification(InstrumentationClassification.LIBRARY.name())
125125
.disabledByDefault(false)
126-
.functions(
126+
.features(
127127
List.of(
128-
InstrumentationFunction.HTTP_ROUTE_ENRICHER,
129-
InstrumentationFunction.CONTEXT_PROPAGATION))
128+
InstrumentationFeature.HTTP_ROUTE, InstrumentationFeature.CONTEXT_PROPAGATION))
130129
.semanticConventions(List.of(DATABASE_CLIENT_METRICS, DATABASE_CLIENT_SPANS))
131130
.configurations(
132131
List.of(
@@ -198,8 +197,8 @@ void testGenerateInstrumentationYamlSeparatesClassifications() throws Exception
198197
semantic_conventions:
199198
- DATABASE_CLIENT_METRICS
200199
- DATABASE_CLIENT_SPANS
201-
functions:
202-
- HTTP_ROUTE_ENRICHER
200+
features:
201+
- HTTP_ROUTE
203202
- CONTEXT_PROPAGATION
204203
source_path: instrumentation/spring/spring-web/spring-web-6.0
205204
minimum_java_version: 11
@@ -239,9 +238,9 @@ void testMetadataParser() throws JsonProcessingException {
239238
classification: internal
240239
disabled_by_default: true
241240
library_link: https://example.com/test-library
242-
functions:
243-
- HTTP_ROUTE_ENRICHER
244-
- LIBRARY_DOMAIN_ENRICHER
241+
features:
242+
- HTTP_ROUTE
243+
- CONTROLLER_SPANS
245244
configurations:
246245
- name: otel.instrumentation.common.db-statement-sanitizer.enabled
247246
description: Enables statement sanitization for database queries.
@@ -258,10 +257,9 @@ void testMetadataParser() throws JsonProcessingException {
258257
.isEqualTo("Enables statement sanitization for database queries.");
259258
assertThat(config.defaultValue()).isEqualTo("true");
260259

261-
assertThat(metadata.getFunctions())
260+
assertThat(metadata.getFeatures())
262261
.containsExactly(
263-
InstrumentationFunction.HTTP_ROUTE_ENRICHER,
264-
InstrumentationFunction.LIBRARY_DOMAIN_ENRICHER);
262+
InstrumentationFeature.HTTP_ROUTE, InstrumentationFeature.CONTROLLER_SPANS);
265263

266264
assertThat(metadata.getClassification()).isEqualTo(InstrumentationClassification.INTERNAL);
267265
assertThat(metadata.getDescription()).isEqualTo("test description");
@@ -336,19 +334,18 @@ void testMetadataParserWithOnlyConfigurations() throws JsonProcessingException {
336334
}
337335

338336
@Test
339-
void testMetadataParserWithOnlyFunctions() throws JsonProcessingException {
337+
void testMetadataParserWithOnlyFeatures() throws JsonProcessingException {
340338
String input =
341339
"""
342-
functions:
343-
- HTTP_ROUTE_ENRICHER
340+
features:
341+
- HTTP_ROUTE
344342
""";
345343
InstrumentationMetadata metadata = YamlHelper.metaDataParser(input);
346344

347345
assertThat(metadata.getClassification()).isEqualTo(InstrumentationClassification.LIBRARY);
348346
assertThat(metadata.getDescription()).isNull();
349347
assertThat(metadata.getDisabledByDefault()).isFalse();
350-
assertThat(metadata.getFunctions())
351-
.containsExactly(InstrumentationFunction.HTTP_ROUTE_ENRICHER);
348+
assertThat(metadata.getFeatures()).containsExactly(InstrumentationFeature.HTTP_ROUTE);
352349
}
353350

354351
@Test
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
display_name: Akka Actors
22
description: This instrumentation provides context propagation for Akka actors, it does not emit any telemetry on its own.
33
library_link: https://doc.akka.io/libraries/akka-core/current/typed/index.html
4-
functions:
4+
features:
55
- CONTEXT_PROPAGATION
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
display_name: Akka Actors
22
description: This instrumentation provides context propagation for the Akka Fork-Join Pool, it does not emit any telemetry on its own.
33
library_link: https://doc.akka.io/libraries/akka-core/current/typed/index.html
4-
functions:
4+
features:
55
- CONTEXT_PROPAGATION

instrumentation/akka/akka-http-10.0/metadata.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ semantic_conventions:
88
- HTTP_CLIENT_METRICS
99
- HTTP_SERVER_SPANS
1010
- HTTP_SERVER_METRICS
11-
functions:
12-
- HTTP_ROUTE_ENRICHER
11+
features:
12+
- HTTP_ROUTE

0 commit comments

Comments
 (0)