Skip to content

Commit caf64d0

Browse files
committed
Rename
1 parent 052587d commit caf64d0

File tree

5 files changed

+20
-18
lines changed

5 files changed

+20
-18
lines changed

sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public String toString() {
161161
// the data.
162162
private static final class Worker implements Runnable {
163163

164-
private final SpanProcessorMetrics spanProcessorMetrics;
164+
private final SpanProcessorInstrumentation spanProcessorInstrumentation;
165165

166166
private final SpanExporter spanExporter;
167167
private final long scheduleDelayNanos;
@@ -201,17 +201,17 @@ private Worker(
201201
this.queue = queue;
202202
this.signal = new ArrayBlockingQueue<>(1);
203203

204-
spanProcessorMetrics =
205-
SpanProcessorMetrics.get(telemetryVersion, COMPONENT_ID, meterProvider);
204+
spanProcessorInstrumentation =
205+
SpanProcessorInstrumentation.get(telemetryVersion, COMPONENT_ID, meterProvider);
206206
this.maxQueueSize = maxQueueSize;
207207

208208
this.batch = new ArrayList<>(this.maxExportBatchSize);
209209
}
210210

211211
private void addSpan(ReadableSpan span) {
212-
spanProcessorMetrics.buildQueueMetricsOnce(maxQueueSize, queue::size);
212+
spanProcessorInstrumentation.buildQueueMetricsOnce(maxQueueSize, queue::size);
213213
if (!queue.offer(span)) {
214-
spanProcessorMetrics.dropSpans(1);
214+
spanProcessorInstrumentation.dropSpans(1);
215215
} else {
216216
if (queueSize.incrementAndGet() >= spansNeeded.get()) {
217217
signal.offer(true);
@@ -332,7 +332,7 @@ private void exportCurrentBatch() {
332332
logger.log(Level.WARNING, "Exporter threw an Exception", t);
333333
error = t.getClass().getName();
334334
} finally {
335-
spanProcessorMetrics.finishSpans(batch.size(), error);
335+
spanProcessorInstrumentation.finishSpans(batch.size(), error);
336336
batch.clear();
337337
}
338338
}

sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/LegacySpanProcessorMetrics.java renamed to sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/LegacySpanProcessorInstrumentation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import javax.annotation.Nullable;
1616

1717
/** Span processor metrics defined before they were standardized in semconv. */
18-
final class LegacySpanProcessorMetrics implements SpanProcessorMetrics {
18+
final class LegacySpanProcessorInstrumentation implements SpanProcessorInstrumentation {
1919
private static final AttributeKey<String> SPAN_PROCESSOR_TYPE_LABEL =
2020
AttributeKey.stringKey("processorType");
2121
private static final AttributeKey<Boolean> SPAN_PROCESSOR_DROPPED_LABEL =
@@ -33,7 +33,7 @@ final class LegacySpanProcessorMetrics implements SpanProcessorMetrics {
3333
@Nullable private Meter meter;
3434
@Nullable private volatile LongCounter processedSpans;
3535

36-
LegacySpanProcessorMetrics(Supplier<MeterProvider> meterProvider) {
36+
LegacySpanProcessorInstrumentation(Supplier<MeterProvider> meterProvider) {
3737
this.meterProvider = meterProvider;
3838

3939
standardAttrs =

sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/SemConvSpanProcessorMetrics.java renamed to sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/SemConvSpanProcessorInstrumentation.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* href="https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#span-metrics">semantic
2121
* conventions</a>.
2222
*/
23-
final class SemConvSpanProcessorMetrics implements SpanProcessorMetrics {
23+
final class SemConvSpanProcessorInstrumentation implements SpanProcessorInstrumentation {
2424

2525
private final Object lock = new Object();
2626
private final AtomicBoolean builtQueueMetrics = new AtomicBoolean(false);
@@ -32,7 +32,8 @@ final class SemConvSpanProcessorMetrics implements SpanProcessorMetrics {
3232
@Nullable private Meter meter;
3333
@Nullable private volatile LongCounter processedSpans;
3434

35-
SemConvSpanProcessorMetrics(ComponentId componentId, Supplier<MeterProvider> meterProvider) {
35+
SemConvSpanProcessorInstrumentation(
36+
ComponentId componentId, Supplier<MeterProvider> meterProvider) {
3637
this.meterProvider = meterProvider;
3738

3839
standardAttrs =

sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/SimpleSpanProcessor.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public final class SimpleSpanProcessor implements SpanProcessor {
4646
private final Set<CompletableResultCode> pendingExports =
4747
Collections.newSetFromMap(new ConcurrentHashMap<>());
4848
private final AtomicBoolean isShutdown = new AtomicBoolean(false);
49-
private final SpanProcessorMetrics spanProcessorMetrics;
49+
private final SpanProcessorInstrumentation spanProcessorInstrumentation;
5050

5151
private final Object exporterLock = new Object();
5252

@@ -81,8 +81,9 @@ public static SimpleSpanProcessorBuilder builder(SpanExporter exporter) {
8181
Supplier<MeterProvider> meterProvider) {
8282
this.spanExporter = requireNonNull(spanExporter, "spanExporter");
8383
this.exportUnsampledSpans = exportUnsampledSpans;
84-
spanProcessorMetrics =
85-
SpanProcessorMetrics.get(InternalTelemetryVersion.LATEST, COMPONENT_ID, meterProvider);
84+
spanProcessorInstrumentation =
85+
SpanProcessorInstrumentation.get(
86+
InternalTelemetryVersion.LATEST, COMPONENT_ID, meterProvider);
8687
}
8788

8889
@Override
@@ -119,7 +120,7 @@ public void onEnd(ReadableSpan span) {
119120
error = "export_failed";
120121
}
121122
}
122-
spanProcessorMetrics.finishSpans(1, error);
123+
spanProcessorInstrumentation.finishSpans(1, error);
123124
});
124125
} catch (RuntimeException e) {
125126
logger.log(Level.WARNING, "Exporter threw an Exception", e);

sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/SpanProcessorMetrics.java renamed to sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/SpanProcessorInstrumentation.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
import javax.annotation.Nullable;
1313

1414
/** Metrics exported by span processors. */
15-
interface SpanProcessorMetrics {
15+
interface SpanProcessorInstrumentation {
1616

17-
static SpanProcessorMetrics get(
17+
static SpanProcessorInstrumentation get(
1818
InternalTelemetryVersion telemetryVersion,
1919
ComponentId componentId,
2020
Supplier<MeterProvider> meterProvider) {
2121
switch (telemetryVersion) {
2222
case LEGACY:
23-
return new LegacySpanProcessorMetrics(meterProvider);
23+
return new LegacySpanProcessorInstrumentation(meterProvider);
2424
default:
25-
return new SemConvSpanProcessorMetrics(componentId, meterProvider);
25+
return new SemConvSpanProcessorInstrumentation(componentId, meterProvider);
2626
}
2727
}
2828

0 commit comments

Comments
 (0)