Skip to content

Commit 49a2e90

Browse files
committed
Address review comments
1 parent 47bf9da commit 49a2e90

File tree

7 files changed

+25
-29
lines changed

7 files changed

+25
-29
lines changed

examples/distro/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ The following description follows one specific use-case:
3737
As an example, let us take some database client instrumentation that creates a span for database call
3838
and extracts data from db connection to provide attributes for that span.
3939

40-
### I want to customize instrumentation without modifying core code
40+
### I want to customize instrumentation without modifying the instrumentation
4141

42-
The `InstrumenterCustomizerProvider` extension point allows you to customize instrumentation behavior without modifying core code:
42+
The `InstrumenterCustomizerProvider` extension point allows you to customize instrumentation behavior without modifying the instrumentation:
4343

4444
- Add custom attributes and metrics to existing instrumentations
45-
- Implement context customizers for request correlation
45+
- Customize context
4646
- Transform span names to match your naming conventions
4747
- Apply customizations conditionally based on instrumentation type and span kind
4848

examples/distro/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ subprojects {
4545
}
4646

4747
repositories {
48-
mavenLocal()
4948
mavenCentral()
5049
maven {
5150
name = "sonatype"

examples/distro/custom/src/main/java/com/example/javaagent/DemoInstrumenterCustomizerProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ public Context onStart(Context context, Object request, Attributes startAttribut
126126
String requestId = "req-" + requestIdCounter.getAndIncrement();
127127

128128
// Add custom context data that can be accessed throughout the request lifecycle
129-
// This follows the pattern used in real implementations like UndertowSingletons
130129
context = context.with(REQUEST_ID_KEY, requestId);
131130
return context;
132131
}

examples/extension/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ Extensions are designed to override or customize the instrumentation provided by
6767

6868
Consider an instrumented database client that creates a span per database call and extracts data from the database connection to provide span attributes. The following are sample use cases for that scenario that can be solved by using extensions.
6969

70-
### "I want to customize instrumentation without modifying core code"
70+
### "I want to customize instrumentation without modifying the instrumentation"
7171

72-
The `InstrumenterCustomizerProvider` extension point allows you to customize instrumentation behavior without modifying core code:
72+
The `InstrumenterCustomizerProvider` extension point allows you to customize instrumentation behavior without modifying the instrumentation:
7373

7474
- Add custom attributes and metrics to existing instrumentations
75-
- Implement context customizers for request correlation
75+
- Customize context
7676
- Transform span names to match your naming conventions
7777
- Apply customizations conditionally based on instrumentation type and span kind
7878

examples/extension/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ ext {
3636
}
3737

3838
repositories {
39-
mavenLocal()
4039
mavenCentral()
4140
maven {
4241
name = "sonatype"

examples/extension/src/main/java/com/example/javaagent/DemoInstrumenterCustomizerProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ public Context onStart(Context context, Object request, Attributes startAttribut
128128
String requestId = "req-" + requestIdCounter.getAndIncrement();
129129

130130
// Add custom context data that can be accessed throughout the request lifecycle
131-
// This follows the pattern used in real implementations like UndertowSingletons
132131
context = context.with(REQUEST_ID_KEY, requestId);
133132
return context;
134133
}

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/instrumenter/InstrumenterCustomizer.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,36 @@
1212
import java.util.function.Function;
1313

1414
/**
15-
* A service provider interface (SPI) for providing customizations for instrumentation, including
16-
* operation metrics, attributes extraction, and context customization.
15+
* Provides customizations for instrumentation, including operation metrics, attributes extraction,
16+
* and context customization.
1717
*
18-
* <p>This allows external modules or plugins to contribute custom logic for specific instrumented
19-
* libraries, without modifying core instrumentation code. This class is internal and is hence not
20-
* for public use. Its APIs are unstable and can change at any time.
18+
* <p>This class is passed to {@link
19+
* InstrumenterCustomizerProvider#customize(InstrumenterCustomizer)} to allow external modules or
20+
* plugins to contribute custom logic for specific instrumented libraries, without modifying core
21+
* instrumentation code. This class is internal and is hence not for public use. Its APIs are
22+
* unstable and can change at any time.
2123
*/
2224
public interface InstrumenterCustomizer {
2325

2426
/**
25-
* Returns the name of the instrumentation that this customizer applies to. This allows for
26-
* efficient mapping of customizers to specific instrumentations rather than using predicates for
27-
* matching.
27+
* Returns the name of the instrumentation that this customizer applies to.
2828
*
2929
* @return the name of the instrumentation this customizer targets
3030
*/
3131
String getInstrumentationName();
3232

3333
/**
34-
* Adds a single AttributesExtractor to the instrumenter. This extractor will be used to extract
35-
* attributes from requests and responses during span creation and enrichment.
34+
* Adds a single {@link AttributesExtractor} to the instrumenter. This extractor will be used to
35+
* extract attributes from requests and responses during the request lifecycle.
3636
*
3737
* @param extractor the attributes extractor to add
3838
* @return this InstrumenterCustomizer for method chaining
3939
*/
4040
InstrumenterCustomizer addAttributesExtractor(AttributesExtractor<?, ?> extractor);
4141

4242
/**
43-
* Adds multiple AttributesExtractors to the instrumenter. These extractors will be used to
44-
* extract attributes from requests and responses during span creation and enrichment.
43+
* Adds multiple {@link AttributesExtractor}s to the instrumenter. These extractors will be used
44+
* to extract attributes from requests and responses during the request lifecycle.
4545
*
4646
* @param extractors the collection of attributes extractors to add
4747
* @return this InstrumenterCustomizer for method chaining
@@ -50,26 +50,26 @@ InstrumenterCustomizer addAttributesExtractors(
5050
Iterable<? extends AttributesExtractor<?, ?>> extractors);
5151

5252
/**
53-
* Adds an OperationMetrics implementation to the instrumenter. This will be used to create
54-
* metrics capturing the request processing metrics for the instrumented operations.
53+
* Adds an {@link OperationMetrics} implementation to the instrumenter. This will be used to
54+
* create metrics for the instrumented operations.
5555
*
5656
* @param operationMetrics the metrics factory to add
5757
* @return this InstrumenterCustomizer for method chaining
5858
*/
5959
InstrumenterCustomizer addOperationMetrics(OperationMetrics operationMetrics);
6060

6161
/**
62-
* Sets a ContextCustomizer for the instrumenter. The customizer will modify the context during
63-
* the Instrumenter.start() operation, allowing custom context propagation or enrichment.
62+
* Adds a {@link ContextCustomizer} that will customize the context during {@link
63+
* Instrumenter#start(Context, Object)}.
6464
*
65-
* @param customizer the context customizer to set
65+
* @param customizer the context customizer to add
6666
* @return this InstrumenterCustomizer for method chaining
6767
*/
6868
InstrumenterCustomizer addContextCustomizer(ContextCustomizer<?> customizer);
6969

7070
/**
71-
* Sets a transformer function that will modify the SpanNameExtractor. This allows customizing how
72-
* span names are generated for the instrumented operations.
71+
* Sets a transformer function that will modify the {@link SpanNameExtractor}. This allows
72+
* customizing how span names are generated for the instrumented operations.
7373
*
7474
* @param spanNameExtractorTransformer function that transforms the original span name extractor
7575
* @return this InstrumenterCustomizer for method chaining

0 commit comments

Comments
 (0)