Skip to content

Commit ec9e528

Browse files
committed
Merge branch 'main' of https://github.com/open-telemetry/opentelemetry-java into promote-component-loader
2 parents d2f36c1 + 05f6702 commit ec9e528

File tree

30 files changed

+428
-233
lines changed

30 files changed

+428
-233
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
- 23
172172
steps:
173173
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
174-
- uses: graalvm/setup-graalvm@01ed653ac833fe80569f1ef9f25585ba2811baab # v1.3.3
174+
- uses: graalvm/setup-graalvm@e1df20a713a4cc6ab5b0eb03f0e0dcdc0199b805 # v1.3.4
175175
with:
176176
java-version: ${{ matrix.test-graal-version }}
177177
distribution: 'graalvm'

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
4646

4747
- name: Initialize CodeQL
48-
uses: github/codeql-action/init@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
48+
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
4949
with:
5050
languages: ${{ matrix.language }}
5151
# using "latest" helps to keep up with the latest Kotlin support
@@ -60,6 +60,6 @@ jobs:
6060
run: ./gradlew assemble --no-build-cache --no-daemon
6161

6262
- name: Perform CodeQL analysis
63-
uses: github/codeql-action/analyze@ce28f5bb42b7a9f2c824e633a3f6ee835bab6858 # v3.29.0
63+
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
6464
with:
6565
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@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
4646
with:
4747
sarif_file: results.sarif

.github/workflows/release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
echo "version=$VERSION" >> $GITHUB_OUTPUT
134134
echo "prior-version=$PRIOR_VERSION" >> $GITHUB_OUTPUT
135135
136-
update-apidiff-baseline-to-released-version:
136+
update-apidiff-baseline-and-docs-to-released-version:
137137
permissions:
138138
contents: write # for git push to PR branch
139139
runs-on: ubuntu-latest
@@ -187,6 +187,13 @@ jobs:
187187
./gradlew --refresh-dependencies japicmp
188188
git add docs/apidiffs
189189
190+
- name: Update versions in README.md
191+
env:
192+
VERSION: ${{ needs.release.outputs.version }}
193+
run: |
194+
./gradlew updateVersionInDocs -Prelease.version=$VERSION
195+
git add README.md
196+
190197
- name: Use CLA approved bot
191198
run: .github/scripts/use-cla-approved-github-bot.sh
192199

@@ -202,9 +209,9 @@ jobs:
202209
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
203210
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
204211
run: |
205-
message="Update apidiff baseline to released version $VERSION"
206-
body="Update apidiff baseline to released version \`$VERSION\`."
207-
branch="otelbot/update-apidiff-baseline-to-released-version-${VERSION}"
212+
message="Update apidiff baseline and documentation versions to released version $VERSION"
213+
body="Update apidiff baseline and documentation versions to released version \`$VERSION\`."
214+
branch="otelbot/update-apidiff-baseline-and-documentation-to-released-version-${VERSION}"
208215
209216
git checkout -b $branch
210217
git commit -m "$message"

README.md

Lines changed: 35 additions & 37 deletions
Large diffs are not rendered by default.

RELEASING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ and deadlocks.
5757
* Review and merge the pull request that it creates for updating the change log in main
5858
(note that if this is not a patch release then the change log on main may already be up-to-date,
5959
in which case no pull request will be created).
60+
* Once the release artifacts become available on Maven Central, the system will automatically
61+
generate a new pull request titled `Update apidiff baseline and documentation versions to
62+
released version $VERSION`. This pull request will contain updates to both the API diff baseline
63+
and version references in the documentation files (README.md). Please review and merge this
64+
automated pull request.
6065
* The [website](https://github.com/open-telemetry/opentelemetry.io) contains automation to update
6166
to the newly released version. Review and approve the pull request when available.
6267
* The [website](https://opentelemetry.io/docs/languages/java/configuration/#zero-code-sdk-autoconfigure)

api/incubator/src/main/java/io/opentelemetry/api/incubator/logs/ExtendedDefaultLogger.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ static Logger getNoop() {
2727
return INSTANCE;
2828
}
2929

30+
@Override
31+
public boolean isEnabled(Severity severity, Context context) {
32+
return false;
33+
}
34+
3035
@Override
3136
public ExtendedLogRecordBuilder logRecordBuilder() {
3237
return NOOP_LOG_RECORD_BUILDER;

api/incubator/src/main/java/io/opentelemetry/api/incubator/logs/ExtendedLogger.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,41 @@
66
package io.opentelemetry.api.incubator.logs;
77

88
import io.opentelemetry.api.logs.Logger;
9+
import io.opentelemetry.api.logs.Severity;
10+
import io.opentelemetry.context.Context;
911

1012
/** Extended {@link Logger} with experimental APIs. */
1113
public interface ExtendedLogger extends Logger {
1214

1315
/**
14-
* Returns {@code true} if the logger is enabled.
16+
* Returns {@code true} if the logger is enabled for the given {@code context} and {@code
17+
* severity}.
1518
*
1619
* <p>This allows callers to avoid unnecessary compute when nothing is consuming the data. Because
1720
* the response is subject to change over the application, callers should call this before each
1821
* call to {@link #logRecordBuilder()}.
1922
*/
20-
default boolean isEnabled() {
23+
default boolean isEnabled(Severity severity, Context context) {
2124
return true;
2225
}
2326

27+
/** Overload of {@link #isEnabled(Severity, Context)} assuming {@link Context#current()}. */
28+
default boolean isEnabled(Severity severity) {
29+
return isEnabled(severity, Context.current());
30+
}
31+
32+
/**
33+
* Overload of {@link #isEnabled(Severity, Context)} assuming {@link
34+
* Severity#UNDEFINED_SEVERITY_NUMBER} and {@link Context#current()}.
35+
*
36+
* @deprecated for removal after 1.55.0. Use {@link #isEnabled(Severity, Context)} or {@link
37+
* #isEnabled(Severity)} instead.
38+
*/
39+
@Deprecated
40+
default boolean isEnabled() {
41+
return isEnabled(Severity.UNDEFINED_SEVERITY_NUMBER);
42+
}
43+
2444
@Override
2545
ExtendedLogRecordBuilder logRecordBuilder();
2646
}

api/incubator/src/main/java/io/opentelemetry/api/incubator/metrics/ExtendedDefaultMeter.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public BatchCallback batchCallback(
9494
private ExtendedDefaultMeter() {}
9595

9696
private static class NoopLongCounter implements ExtendedLongCounter {
97+
@Override
98+
public boolean isEnabled() {
99+
return false;
100+
}
101+
97102
@Override
98103
public void add(long value, Attributes attributes, Context context) {}
99104

@@ -105,6 +110,11 @@ public void add(long value) {}
105110
}
106111

107112
private static class NoopDoubleCounter implements ExtendedDoubleCounter {
113+
@Override
114+
public boolean isEnabled() {
115+
return false;
116+
}
117+
108118
@Override
109119
public void add(double value, Attributes attributes, Context context) {}
110120

@@ -186,6 +196,11 @@ public ObservableDoubleMeasurement buildObserver() {
186196
}
187197

188198
private static class NoopLongUpDownCounter implements ExtendedLongUpDownCounter {
199+
@Override
200+
public boolean isEnabled() {
201+
return false;
202+
}
203+
189204
@Override
190205
public void add(long value, Attributes attributes, Context context) {}
191206

@@ -197,6 +212,11 @@ public void add(long value) {}
197212
}
198213

199214
private static class NoopDoubleUpDownCounter implements ExtendedDoubleUpDownCounter {
215+
@Override
216+
public boolean isEnabled() {
217+
return false;
218+
}
219+
200220
@Override
201221
public void add(double value, Attributes attributes, Context context) {}
202222

@@ -281,6 +301,11 @@ public ObservableDoubleMeasurement buildObserver() {
281301
}
282302

283303
private static class NoopDoubleHistogram implements ExtendedDoubleHistogram {
304+
@Override
305+
public boolean isEnabled() {
306+
return false;
307+
}
308+
284309
@Override
285310
public void record(double value, Attributes attributes, Context context) {}
286311

@@ -292,6 +317,11 @@ public void record(double value) {}
292317
}
293318

294319
private static class NoopLongHistogram implements ExtendedLongHistogram {
320+
@Override
321+
public boolean isEnabled() {
322+
return false;
323+
}
324+
295325
@Override
296326
public void record(long value, Attributes attributes, Context context) {}
297327

@@ -385,6 +415,11 @@ public DoubleGauge build() {
385415
}
386416

387417
private static class NoopDoubleGauge implements ExtendedDoubleGauge {
418+
@Override
419+
public boolean isEnabled() {
420+
return false;
421+
}
422+
388423
@Override
389424
public void set(double value) {}
390425

@@ -426,6 +461,11 @@ public LongGauge build() {
426461
}
427462

428463
private static class NoopLongGauge implements ExtendedLongGauge {
464+
@Override
465+
public boolean isEnabled() {
466+
return false;
467+
}
468+
429469
@Override
430470
public void set(long value) {}
431471

api/incubator/src/main/java/io/opentelemetry/api/incubator/trace/ExtendedDefaultTracer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ static Tracer getNoop() {
3131
return INSTANCE;
3232
}
3333

34+
@Override
35+
public boolean isEnabled() {
36+
return false;
37+
}
38+
3439
@Override
3540
public ExtendedSpanBuilder spanBuilder(String spanName) {
3641
return NoopSpanBuilder.create();

0 commit comments

Comments
 (0)