Skip to content

Commit 617c8cd

Browse files
committed
updates
1 parent 841b123 commit 617c8cd

File tree

10 files changed

+62
-46
lines changed

10 files changed

+62
-46
lines changed

docs/contributing/documenting-instrumentation.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ semantic_conventions:
8888
- HTTP_CLIENT_SPANS
8989
- DATABASE_CLIENT_SPANS
9090
- JVM_RUNTIME_METRICS
91+
functions:
92+
- HTTP_ROUTE_ENRICHER
93+
- CONTEXT_PROPAGATION
9194
disabled_by_default: true
9295
classification: library
9396
library_link: https://github.com/...
@@ -174,6 +177,23 @@ List of possible options:
174177
* [GENAI_CLIENT_SPANS](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-spans.md)
175178
* [GENAI_CLIENT_METRICS](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-metrics.md#generative-ai-client-metrics)
176179

180+
### Functions (optional)
181+
182+
As a way to help further categorize instrumentations, you can add a `functions` field with a list of
183+
the relevant functionality descriptions.
184+
185+
List of possible options:
186+
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
189+
* `EXPERIMENTAL_ONLY`: Instrumentation that is experimental and may not be stable
190+
* `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
193+
* `CONTROLLER_SPANS`: Instrumentation that generates controller-level spans
194+
* `VIEW_SPANS`: Instrumentation that generates view-level spans
195+
* `SYSTEM_METRICS`: Instrumentation that generates system-level metrics
196+
177197
### Library Link
178198

179199
For library instrumentations, include a `library_link` field with a URL to the library or framework's

docs/instrumentation-list.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ 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:
74+
- CONTEXT_PROPAGATION
7375
source_path: instrumentation/akka/akka-actor-2.3
7476
scope:
7577
name: io.opentelemetry.akka-actor-2.3
@@ -83,6 +85,8 @@ libraries:
8385
description: This instrumentation provides context propagation for the Akka Fork-Join
8486
Pool, it does not emit any telemetry on its own.
8587
library_link: https://doc.akka.io/libraries/akka-core/current/typed/index.html
88+
functions:
89+
- CONTEXT_PROPAGATION
8690
source_path: instrumentation/akka/akka-actor-fork-join-2.5
8791
scope:
8892
name: io.opentelemetry.akka-actor-fork-join-2.5
@@ -101,6 +105,8 @@ libraries:
101105
- HTTP_SERVER_SPANS
102106
- HTTP_SERVER_METRICS
103107
library_link: https://doc.akka.io/docs/akka-http/current/index.html
108+
functions:
109+
- HTTP_ROUTE_ENRICHER
104110
source_path: instrumentation/akka/akka-http-10.0
105111
scope:
106112
name: io.opentelemetry.akka-http-10.0

instrumentation-docs/instrumentations.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ readonly INSTRUMENTATIONS=(
1414
"apache-dbcp-2.0:javaagent:test"
1515
"apache-dbcp-2.0:javaagent:testStableSemconv"
1616
"apache-dubbo-2.7:javaagent:testDubbo"
17-
"apache-dubbo-2.7:javaagent:testDubbo"
1817
"apache-httpasyncclient-4.1:javaagent:test"
1918
"apache-httpclient:apache-httpclient-2.0:javaagent:test"
2019
"apache-httpclient:apache-httpclient-4.0:javaagent:test"
21-
# "apache-httpclient:apache-httpclient-4.3:library:test" # See https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/14771
20+
"apache-httpclient:apache-httpclient-4.3:library:test"
2221
"apache-httpclient:apache-httpclient-5.0:javaagent:test"
23-
# "apache-httpclient:apache-httpclient-5.2:library:test" # See https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/14771
22+
"apache-httpclient:apache-httpclient-5.2:library:test"
2423
"armeria:armeria-1.3:javaagent:test"
2524
"armeria:armeria-grpc-1.14:javaagent:test"
2625
"async-http-client:async-http-client-1.9:javaagent:test"

instrumentation-docs/readme.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,18 @@ public class SpringWebInstrumentationModule extends InstrumentationModule
134134
* FAAS_SERVER_SPANS
135135
* GENAI_CLIENT_SPANS
136136
* GENAI_CLIENT_METRIC
137+
* functions
138+
* The specific functionality that the instrumentation provides
139+
* Options are:
140+
* HTTP_ROUTE_ENRICHER
141+
* LIBRARY_DOMAIN_ENRICHER
142+
* EXPERIMENTAL_ONLY
143+
* CONTEXT_PROPAGATION
144+
* UPSTREAM_ADAPTER
145+
* CONFIGURATION
146+
* CONTROLLER_SPANS
147+
* VIEW_SPANS
148+
* SYSTEM_METRICS
137149
* library_link
138150
* URL to the library or framework's main website or documentation, or if those don't exist, the
139151
GitHub repository.
@@ -173,6 +185,9 @@ semantic_conventions: # List of semantic conventions
173185
- HTTP_CLIENT_SPANS
174186
- DATABASE_CLIENT_SPANS
175187
- JVM_RUNTIME_METRICS
188+
functions: # List of functions this instrumentation provides
189+
- HTTP_ROUTE_ENRICHER
190+
- CONTEXT_PROPAGATION
176191
disabled_by_default: true # Defaults to `false`
177192
classification: internal # instrumentation classification: library | internal | custom
178193
library_link: https://... # URL to the library or framework's main website or documentation

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

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,18 @@
55

66
package io.opentelemetry.instrumentation.docs.internal;
77

8-
import com.fasterxml.jackson.annotation.JsonCreator;
9-
import com.fasterxml.jackson.annotation.JsonValue;
10-
118
/**
129
* Represents functionality of instrumentations. This class is internal and is hence not for public
1310
* use. Its APIs are unstable and can change at any time.
1411
*/
1512
public enum InstrumentationFunction {
16-
HTTP_ROUTE_ENRICHER("http-route-enricher"),
17-
LIBRARY_DOMAIN_ENRICHER("library-domain-enricher"),
18-
EXPERIMENTAL_ONLY("experimental-only"),
19-
CONTEXT_PROPAGATOR("context-propagator"),
20-
UPSTREAM_ADAPTER("upstream-adapter"),
21-
CONFIGURATION("configuration"),
22-
CONTROLLER_SPANS("controller-spans"),
23-
VIEW_SPANS("view-spans"),
24-
SYSTEM_METRICS("system-metrics");
25-
26-
private final String name;
27-
28-
InstrumentationFunction(String name) {
29-
this.name = name;
30-
}
31-
32-
@JsonValue
33-
public String getName() {
34-
return name;
35-
}
36-
37-
@JsonCreator
38-
public static InstrumentationFunction fromYamlName(String yamlName) {
39-
for (InstrumentationFunction function : values()) {
40-
if (function.name.equals(yamlName)) {
41-
return function;
42-
}
43-
}
44-
throw new IllegalArgumentException("Unknown instrumentation function: " + yamlName);
45-
}
13+
HTTP_ROUTE_ENRICHER,
14+
LIBRARY_DOMAIN_ENRICHER,
15+
EXPERIMENTAL_ONLY,
16+
CONTEXT_PROPAGATION,
17+
UPSTREAM_ADAPTER,
18+
CONFIGURATION,
19+
CONTROLLER_SPANS,
20+
VIEW_SPANS,
21+
SYSTEM_METRICS
4622
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private static void addMetadataProperties(
218218
if (!module.getMetadata().getFunctions().isEmpty()) {
219219
List<String> functionNames =
220220
module.getMetadata().getFunctions().stream()
221-
.map(function -> function.getName())
221+
.map(Enum::name)
222222
.collect(Collectors.toList());
223223
moduleMap.put("functions", functionNames);
224224
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void testGenerateInstrumentationYamlSeparatesClassifications() throws Exception
126126
.functions(
127127
List.of(
128128
InstrumentationFunction.HTTP_ROUTE_ENRICHER,
129-
InstrumentationFunction.CONTEXT_PROPAGATOR))
129+
InstrumentationFunction.CONTEXT_PROPAGATION))
130130
.semanticConventions(List.of(DATABASE_CLIENT_METRICS, DATABASE_CLIENT_SPANS))
131131
.configurations(
132132
List.of(
@@ -199,8 +199,8 @@ void testGenerateInstrumentationYamlSeparatesClassifications() throws Exception
199199
- DATABASE_CLIENT_METRICS
200200
- DATABASE_CLIENT_SPANS
201201
functions:
202-
- http-route-enricher
203-
- context-propagator
202+
- HTTP_ROUTE_ENRICHER
203+
- CONTEXT_PROPAGATION
204204
source_path: instrumentation/spring/spring-web/spring-web-6.0
205205
minimum_java_version: 11
206206
scope:
@@ -240,8 +240,8 @@ void testMetadataParser() throws JsonProcessingException {
240240
disabled_by_default: true
241241
library_link: https://example.com/test-library
242242
functions:
243-
- http-route-enricher
244-
- library-domain-enricher
243+
- HTTP_ROUTE_ENRICHER
244+
- LIBRARY_DOMAIN_ENRICHER
245245
configurations:
246246
- name: otel.instrumentation.common.db-statement-sanitizer.enabled
247247
description: Enables statement sanitization for database queries.
@@ -340,7 +340,7 @@ void testMetadataParserWithOnlyFunctions() throws JsonProcessingException {
340340
String input =
341341
"""
342342
functions:
343-
- http-route-enricher
343+
- HTTP_ROUTE_ENRICHER
344344
""";
345345
InstrumentationMetadata metadata = YamlHelper.metaDataParser(input);
346346

instrumentation/akka/akka-actor-2.3/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ 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
44
functions:
5-
- context-propagation
5+
- CONTEXT_PROPAGATION

instrumentation/akka/akka-actor-fork-join-2.5/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ 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
44
functions:
5-
- context-propagation
5+
- CONTEXT_PROPAGATION

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ semantic_conventions:
99
- HTTP_SERVER_SPANS
1010
- HTTP_SERVER_METRICS
1111
functions:
12-
- http-route-enricher
12+
- HTTP_ROUTE_ENRICHER

0 commit comments

Comments
 (0)