Skip to content

Commit 7c65895

Browse files
authored
Merge branch 'main' into lychee
2 parents d989c7a + 8bcdeff commit 7c65895

File tree

13 files changed

+76
-240
lines changed

13 files changed

+76
-240
lines changed

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
cache-read-only: ${{ github.event_name == 'pull_request' }}
5858

5959
- name: Initialize CodeQL
60-
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
60+
uses: github/codeql-action/init@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1
6161
with:
6262
languages: ${{ matrix.language }}
6363
# using "latest" helps to keep up with the latest Kotlin support
@@ -73,6 +73,6 @@ jobs:
7373
run: ./gradlew assemble -x javadoc -x :instrumentation:quarkus-resteasy-reactive:quarkus3-testing:quarkusGenerateCodeDev -x :instrumentation:quarkus-resteasy-reactive:quarkus2-testing:quarkusGenerateCodeDev --no-build-cache --no-daemon
7474

7575
- name: Perform CodeQL analysis
76-
uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
76+
uses: github/codeql-action/analyze@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1
7777
with:
7878
category: "/language:${{matrix.language}}"

.github/workflows/ossf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ jobs:
4242
# Upload the results to GitHub's code scanning dashboard (optional).
4343
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
4444
- name: "Upload to code-scanning"
45-
uses: github/codeql-action/upload-sarif@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
45+
uses: github/codeql-action/upload-sarif@39edc492dbe16b1465b0cafca41432d857bdb31a # v3.29.1
4646
with:
4747
sarif_file: results.sarif

.github/workflows/reusable-misspell-check.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ jobs:
1414

1515
- name: Install misspell
1616
run: |
17-
curl -L -o install-misspell.sh \
18-
https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh
19-
sh ./install-misspell.sh
17+
curl -sfL https://raw.githubusercontent.com/golangci/misspell/master/install-misspell.sh | sh -s -- -b bin
2018
2119
- name: Run misspell
2220
run: |

conventions/src/main/kotlin/otel.java-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ codenarc {
431431
checkstyle {
432432
configFile = rootProject.file("buildscripts/checkstyle.xml")
433433
// this version should match the version of google_checks.xml used as basis for above configuration
434-
toolVersion = "10.26.0"
434+
toolVersion = "10.26.1"
435435
maxWarnings = 0
436436
}
437437

instrumentation/restlet/restlet-1.1/javaagent/build.gradle.kts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@ muzzle {
88
module.set("org.restlet")
99
versions.set("[1.1.0, 1.2-M1)")
1010
extraDependency("com.noelios.restlet:com.noelios.restlet")
11-
// missing dependencies
12-
skip("2.5.0", "2.5.1", "2.5.2")
13-
assertInverse.set(true)
11+
}
12+
13+
// assertInverse was removed because extraDependency is not available in later versions (e.g., 2.5.x),
14+
// which causes exception during muzzle. #14159
15+
fail {
16+
group.set("org.restlet")
17+
module.set("org.restlet")
18+
versions.set("[,1.1.0)")
19+
}
20+
21+
fail {
22+
group.set("org.restlet")
23+
module.set("org.restlet")
24+
versions.set("[1.2-M1,)")
1425
}
1526
}
1627

instrumentation/runtime-telemetry/runtime-telemetry-java17/library/src/main/java/io/opentelemetry/instrumentation/runtimemetrics/java17/HandlerRegistry.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import io.opentelemetry.api.metrics.MeterBuilder;
1111
import io.opentelemetry.instrumentation.api.internal.EmbeddedInstrumentationProperties;
1212
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.RecordedEventHandler;
13-
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.ThreadGrouper;
1413
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.buffer.DirectBufferStatisticsHandler;
1514
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.classes.ClassesLoadedHandler;
1615
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.container.ContainerConfigurationHandler;
@@ -84,17 +83,16 @@ static List<RecordedEventHandler> getHandlers(
8483
}
8584
}
8685

87-
ThreadGrouper grouper = new ThreadGrouper();
8886
List<RecordedEventHandler> basicHandlers =
8987
List.of(
90-
new ObjectAllocationInNewTlabHandler(meter, grouper),
91-
new ObjectAllocationOutsideTlabHandler(meter, grouper),
92-
new NetworkReadHandler(meter, grouper),
93-
new NetworkWriteHandler(meter, grouper),
88+
new ObjectAllocationInNewTlabHandler(meter),
89+
new ObjectAllocationOutsideTlabHandler(meter),
90+
new NetworkReadHandler(meter),
91+
new NetworkWriteHandler(meter),
9492
new ContextSwitchRateHandler(meter),
9593
new OverallCpuLoadHandler(meter),
9694
new ContainerConfigurationHandler(meter),
97-
new LongLockHandler(meter, grouper),
95+
new LongLockHandler(meter),
9896
new ThreadCountHandler(meter),
9997
new ClassesLoadedHandler(meter),
10098
new MetaspaceSummaryHandler(meter),

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

Lines changed: 0 additions & 38 deletions
This file was deleted.

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

Lines changed: 0 additions & 27 deletions
This file was deleted.

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

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,34 @@
99
import io.opentelemetry.api.metrics.DoubleHistogram;
1010
import io.opentelemetry.api.metrics.Meter;
1111
import io.opentelemetry.instrumentation.runtimemetrics.java17.JfrFeature;
12-
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.AbstractThreadDispatchingHandler;
1312
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.Constants;
1413
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.DurationUtil;
15-
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.ThreadGrouper;
14+
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.RecordedEventHandler;
1615
import java.time.Duration;
1716
import java.util.Optional;
18-
import java.util.function.Consumer;
1917
import jdk.jfr.consumer.RecordedEvent;
2018

2119
/**
2220
* This class is internal and is hence not for public use. Its APIs are unstable and can change at
2321
* any time.
2422
*/
25-
public final class LongLockHandler extends AbstractThreadDispatchingHandler {
23+
public final class LongLockHandler implements RecordedEventHandler {
2624
private static final String METRIC_NAME = "jvm.cpu.longlock";
2725
private static final String METRIC_DESCRIPTION = "Long lock times";
2826
private static final String EVENT_NAME = "jdk.JavaMonitorWait";
2927

3028
private final DoubleHistogram histogram;
29+
private final Attributes attributes;
3130

32-
public LongLockHandler(Meter meter, ThreadGrouper grouper) {
33-
super(grouper);
31+
public LongLockHandler(Meter meter) {
3432
histogram =
3533
meter
3634
.histogramBuilder(METRIC_NAME)
3735
.setDescription(METRIC_DESCRIPTION)
3836
.setUnit(Constants.SECONDS)
3937
.build();
38+
39+
attributes = Attributes.empty();
4040
}
4141

4242
@Override
@@ -50,34 +50,17 @@ public JfrFeature getFeature() {
5050
}
5151

5252
@Override
53-
public Consumer<RecordedEvent> createPerThreadSummarizer(String threadName) {
54-
return new PerThreadLongLockHandler(histogram, threadName);
53+
public void accept(RecordedEvent recordedEvent) {
54+
histogram.record(DurationUtil.toSeconds(recordedEvent.getDuration()), attributes);
55+
// What about the class name in MONITOR_CLASS ?
56+
// We can get a stack trace from the thread on the event
57+
// if (recordedEvent.hasField("eventThread")) {
58+
// var eventThread = recordedEvent.getThread("eventThread");
59+
// }
5560
}
5661

5762
@Override
5863
public Optional<Duration> getThreshold() {
5964
return Optional.empty();
6065
}
61-
62-
private static class PerThreadLongLockHandler implements Consumer<RecordedEvent> {
63-
private static final String EVENT_THREAD = "eventThread";
64-
65-
private final DoubleHistogram histogram;
66-
private final Attributes attributes;
67-
68-
public PerThreadLongLockHandler(DoubleHistogram histogram, String threadName) {
69-
this.histogram = histogram;
70-
this.attributes = Attributes.of(Constants.ATTR_THREAD_NAME, threadName);
71-
}
72-
73-
@Override
74-
public void accept(RecordedEvent recordedEvent) {
75-
if (recordedEvent.hasField(EVENT_THREAD)) {
76-
histogram.record(DurationUtil.toSeconds(recordedEvent.getDuration()), attributes);
77-
}
78-
// What about the class name in MONITOR_CLASS ?
79-
// We can get a stack trace from the thread on the event
80-
// var eventThread = recordedEvent.getThread(EVENT_THREAD);
81-
}
82-
}
8366
}

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

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
import io.opentelemetry.api.metrics.LongHistogram;
1010
import io.opentelemetry.api.metrics.Meter;
1111
import io.opentelemetry.instrumentation.runtimemetrics.java17.JfrFeature;
12-
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.AbstractThreadDispatchingHandler;
1312
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.Constants;
14-
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.ThreadGrouper;
15-
import java.util.function.Consumer;
13+
import io.opentelemetry.instrumentation.runtimemetrics.java17.internal.RecordedEventHandler;
1614
import jdk.jfr.consumer.RecordedEvent;
1715

1816
/**
@@ -22,20 +20,22 @@
2220
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
2321
* at any time.
2422
*/
25-
public final class ObjectAllocationInNewTlabHandler extends AbstractThreadDispatchingHandler {
23+
public final class ObjectAllocationInNewTlabHandler implements RecordedEventHandler {
2624
private static final String EVENT_NAME = "jdk.ObjectAllocationInNewTLAB";
25+
private static final String TLAB_SIZE = "tlabSize";
2726

2827
private final LongHistogram histogram;
28+
private final Attributes attributes;
2929

30-
public ObjectAllocationInNewTlabHandler(Meter meter, ThreadGrouper grouper) {
31-
super(grouper);
30+
public ObjectAllocationInNewTlabHandler(Meter meter) {
3231
histogram =
3332
meter
3433
.histogramBuilder(Constants.METRIC_NAME_MEMORY_ALLOCATION)
3534
.setDescription(Constants.METRIC_DESCRIPTION_MEMORY_ALLOCATION)
3635
.setUnit(Constants.BYTES)
3736
.ofLongs()
3837
.build();
38+
attributes = Attributes.of(Constants.ATTR_ARENA_NAME, "TLAB");
3939
}
4040

4141
@Override
@@ -49,29 +49,9 @@ public JfrFeature getFeature() {
4949
}
5050

5151
@Override
52-
public Consumer<RecordedEvent> createPerThreadSummarizer(String threadName) {
53-
return new PerThreadObjectAllocationInNewTlabHandler(histogram, threadName);
54-
}
55-
56-
/** This class aggregates all TLAB allocation JFR events for a single thread */
57-
private static class PerThreadObjectAllocationInNewTlabHandler
58-
implements Consumer<RecordedEvent> {
59-
private static final String TLAB_SIZE = "tlabSize";
60-
61-
private final LongHistogram histogram;
62-
private final Attributes attributes;
63-
64-
public PerThreadObjectAllocationInNewTlabHandler(LongHistogram histogram, String threadName) {
65-
this.histogram = histogram;
66-
this.attributes =
67-
Attributes.of(Constants.ATTR_THREAD_NAME, threadName, Constants.ATTR_ARENA_NAME, "TLAB");
68-
}
69-
70-
@Override
71-
public void accept(RecordedEvent ev) {
72-
histogram.record(ev.getLong(TLAB_SIZE), attributes);
73-
// Probably too high a cardinality
74-
// ev.getClass("objectClass").getName();
75-
}
52+
public void accept(RecordedEvent ev) {
53+
histogram.record(ev.getLong(TLAB_SIZE), attributes);
54+
// Probably too high a cardinality
55+
// ev.getClass("objectClass").getName();
7656
}
7757
}

0 commit comments

Comments
 (0)