Skip to content

Commit 1106d44

Browse files
committed
feat: remove thread.name from attributes
See: [#13407](#13407)
1 parent 565a5ca commit 1106d44

File tree

5 files changed

+15
-27
lines changed

5 files changed

+15
-27
lines changed

instrumentation/runtime-telemetry/runtime-telemetry-java17/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java17/internal/cpu/LongLockHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public JfrFeature getFeature() {
5151

5252
@Override
5353
public Consumer<RecordedEvent> createPerThreadSummarizer(String threadName) {
54-
return new PerThreadLongLockHandler(histogram, threadName);
54+
return new PerThreadLongLockHandler(histogram);
5555
}
5656

5757
@Override
@@ -65,9 +65,9 @@ private static class PerThreadLongLockHandler implements Consumer<RecordedEvent>
6565
private final DoubleHistogram histogram;
6666
private final Attributes attributes;
6767

68-
public PerThreadLongLockHandler(DoubleHistogram histogram, String threadName) {
68+
public PerThreadLongLockHandler(DoubleHistogram histogram) {
6969
this.histogram = histogram;
70-
this.attributes = Attributes.of(Constants.ATTR_THREAD_NAME, threadName);
70+
this.attributes = Attributes.empty();
7171
}
7272

7373
@Override

instrumentation/runtime-telemetry/runtime-telemetry-java17/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java17/internal/memory/ObjectAllocationInNewTlabHandler.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public JfrFeature getFeature() {
5050

5151
@Override
5252
public Consumer<RecordedEvent> createPerThreadSummarizer(String threadName) {
53-
return new PerThreadObjectAllocationInNewTlabHandler(histogram, threadName);
53+
return new PerThreadObjectAllocationInNewTlabHandler(histogram);
5454
}
5555

5656
/** This class aggregates all TLAB allocation JFR events for a single thread */
@@ -61,10 +61,9 @@ private static class PerThreadObjectAllocationInNewTlabHandler
6161
private final LongHistogram histogram;
6262
private final Attributes attributes;
6363

64-
public PerThreadObjectAllocationInNewTlabHandler(LongHistogram histogram, String threadName) {
64+
public PerThreadObjectAllocationInNewTlabHandler(LongHistogram histogram) {
6565
this.histogram = histogram;
66-
this.attributes =
67-
Attributes.of(Constants.ATTR_THREAD_NAME, threadName, Constants.ATTR_ARENA_NAME, "TLAB");
66+
this.attributes = Attributes.of(Constants.ATTR_ARENA_NAME, "TLAB");
6867
}
6968

7069
@Override

instrumentation/runtime-telemetry/runtime-telemetry-java17/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java17/internal/memory/ObjectAllocationOutsideTlabHandler.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public JfrFeature getFeature() {
5050

5151
@Override
5252
public Consumer<RecordedEvent> createPerThreadSummarizer(String threadName) {
53-
return new PerThreadObjectAllocationOutsideTlabHandler(histogram, threadName);
53+
return new PerThreadObjectAllocationOutsideTlabHandler(histogram);
5454
}
5555

5656
/** This class aggregates all non-TLAB allocation JFR events for a single thread */
@@ -61,10 +61,9 @@ private static class PerThreadObjectAllocationOutsideTlabHandler
6161
private final LongHistogram histogram;
6262
private final Attributes attributes;
6363

64-
public PerThreadObjectAllocationOutsideTlabHandler(LongHistogram histogram, String threadName) {
64+
public PerThreadObjectAllocationOutsideTlabHandler(LongHistogram histogram) {
6565
this.histogram = histogram;
66-
this.attributes =
67-
Attributes.of(Constants.ATTR_THREAD_NAME, threadName, Constants.ATTR_ARENA_NAME, "Main");
66+
this.attributes = Attributes.of(Constants.ATTR_ARENA_NAME, "Main");
6867
}
6968

7069
@Override

instrumentation/runtime-telemetry/runtime-telemetry-java17/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java17/internal/network/NetworkReadHandler.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public JfrFeature getFeature() {
5656

5757
@Override
5858
public Consumer<RecordedEvent> createPerThreadSummarizer(String threadName) {
59-
return new PerThreadNetworkReadHandler(bytesHistogram, durationHistogram, threadName);
59+
return new PerThreadNetworkReadHandler(bytesHistogram, durationHistogram);
6060
}
6161

6262
private static class PerThreadNetworkReadHandler implements Consumer<RecordedEvent> {
@@ -67,15 +67,10 @@ private static class PerThreadNetworkReadHandler implements Consumer<RecordedEve
6767
private final Attributes attributes;
6868

6969
public PerThreadNetworkReadHandler(
70-
LongHistogram bytesHistogram, DoubleHistogram durationHistogram, String threadName) {
70+
LongHistogram bytesHistogram, DoubleHistogram durationHistogram) {
7171
this.bytesHistogram = bytesHistogram;
7272
this.durationHistogram = durationHistogram;
73-
this.attributes =
74-
Attributes.of(
75-
Constants.ATTR_THREAD_NAME,
76-
threadName,
77-
Constants.ATTR_NETWORK_MODE,
78-
Constants.NETWORK_MODE_READ);
73+
this.attributes = Attributes.of(Constants.ATTR_NETWORK_MODE, Constants.NETWORK_MODE_READ);
7974
}
8075

8176
@Override

instrumentation/runtime-telemetry/runtime-telemetry-java17/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java17/internal/network/NetworkWriteHandler.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public JfrFeature getFeature() {
7474

7575
@Override
7676
public Consumer<RecordedEvent> createPerThreadSummarizer(String threadName) {
77-
return new PerThreadNetworkWriteHandler(bytesHistogram, durationHistogram, threadName);
77+
return new PerThreadNetworkWriteHandler(bytesHistogram, durationHistogram);
7878
}
7979

8080
private static final class PerThreadNetworkWriteHandler implements Consumer<RecordedEvent> {
@@ -85,15 +85,10 @@ private static final class PerThreadNetworkWriteHandler implements Consumer<Reco
8585
private final Attributes attributes;
8686

8787
private PerThreadNetworkWriteHandler(
88-
LongHistogram bytesHistogram, DoubleHistogram durationHistogram, String threadName) {
88+
LongHistogram bytesHistogram, DoubleHistogram durationHistogram) {
8989
this.bytesHistogram = bytesHistogram;
9090
this.durationHistogram = durationHistogram;
91-
this.attributes =
92-
Attributes.of(
93-
Constants.ATTR_THREAD_NAME,
94-
threadName,
95-
Constants.ATTR_NETWORK_MODE,
96-
Constants.NETWORK_MODE_WRITE);
91+
this.attributes = Attributes.of(Constants.ATTR_NETWORK_MODE, Constants.NETWORK_MODE_WRITE);
9792
}
9893

9994
@Override

0 commit comments

Comments
 (0)