-
Notifications
You must be signed in to change notification settings - Fork 1k
Update the OpenTelemetry SDK version to 1.52.0 #14231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
instrumentation/opentelemetry-api/opentelemetry-api-1.52/javaagent/build.gradle.kts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| plugins { | ||
| id("otel.javaagent-instrumentation") | ||
| } | ||
|
|
||
| dependencies { | ||
| compileOnly(project(":opentelemetry-api-shaded-for-instrumenting", configuration = "v1_52")) | ||
| compileOnly("io.opentelemetry:opentelemetry-api-incubator") | ||
|
|
||
| implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.0:javaagent")) | ||
| implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.27:javaagent")) | ||
| implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.40:javaagent")) | ||
| implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.42:javaagent")) | ||
| implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.47:javaagent")) | ||
| implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.50:javaagent")) | ||
|
|
||
| testImplementation("io.opentelemetry:opentelemetry-api-incubator") | ||
| } |
41 changes: 41 additions & 0 deletions
41
...tion/opentelemetryapi/v1_52/incubator/OpenTelemetryApiIncubatorInstrumentationModule.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_52.incubator; | ||
|
|
||
| import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed; | ||
| import static java.util.Collections.singletonList; | ||
|
|
||
| import com.google.auto.service.AutoService; | ||
| import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule; | ||
| import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation; | ||
| import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule; | ||
| import java.util.List; | ||
| import net.bytebuddy.matcher.ElementMatcher; | ||
|
|
||
| @AutoService(InstrumentationModule.class) | ||
| public class OpenTelemetryApiIncubatorInstrumentationModule extends InstrumentationModule | ||
| implements ExperimentalInstrumentationModule { | ||
| public OpenTelemetryApiIncubatorInstrumentationModule() { | ||
| super("opentelemetry-api", "opentelemetry-api-1.52", "opentelemetry-api-incubator-1.52"); | ||
| } | ||
|
|
||
| @Override | ||
| public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() { | ||
| return hasClassesNamed( | ||
| "application.io.opentelemetry.api.common.Value", | ||
| "application.io.opentelemetry.api.incubator.common.ExtendedAttributes"); | ||
| } | ||
|
|
||
| @Override | ||
| public List<TypeInstrumentation> typeInstrumentations() { | ||
| return singletonList(new OpenTelemetryIncubatorInstrumentation()); | ||
| } | ||
|
|
||
| @Override | ||
| public String getModuleGroup() { | ||
| return "opentelemetry-api-bridge"; | ||
| } | ||
| } |
40 changes: 40 additions & 0 deletions
40
...strumentation/opentelemetryapi/v1_52/incubator/OpenTelemetryIncubatorInstrumentation.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_52.incubator; | ||
|
|
||
| import static net.bytebuddy.matcher.ElementMatchers.named; | ||
| import static net.bytebuddy.matcher.ElementMatchers.none; | ||
|
|
||
| import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation; | ||
| import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer; | ||
| import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_52.incubator.logs.ApplicationLoggerFactory152Incubator; | ||
| import net.bytebuddy.asm.Advice; | ||
| import net.bytebuddy.description.type.TypeDescription; | ||
| import net.bytebuddy.matcher.ElementMatcher; | ||
|
|
||
| public class OpenTelemetryIncubatorInstrumentation implements TypeInstrumentation { | ||
|
|
||
| @Override | ||
| public ElementMatcher<TypeDescription> typeMatcher() { | ||
| return named("application.io.opentelemetry.api.GlobalOpenTelemetry"); | ||
| } | ||
|
|
||
| @Override | ||
| public void transform(TypeTransformer transformer) { | ||
| transformer.applyAdviceToMethod( | ||
| none(), OpenTelemetryIncubatorInstrumentation.class.getName() + "$InitAdvice"); | ||
| } | ||
|
|
||
| @SuppressWarnings({"ReturnValueIgnored", "unused"}) | ||
| public static class InitAdvice { | ||
| @Advice.OnMethodEnter | ||
| public static void init() { | ||
| // the sole purpose of this advice is to ensure that ApplicationLoggerFactory152Incubator is | ||
| // recognized as helper class and injected into class loader | ||
| ApplicationLoggerFactory152Incubator.class.getName(); | ||
| } | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
.../instrumentation/opentelemetryapi/v1_52/incubator/logs/ApplicationLogger152Incubator.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_52.incubator.logs; | ||
|
|
||
| import application.io.opentelemetry.api.incubator.logs.ExtendedLogger; | ||
| import application.io.opentelemetry.api.logs.Severity; | ||
| import application.io.opentelemetry.context.Context; | ||
| import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.context.AgentContextStorage; | ||
| import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27.logs.LogBridging; | ||
| import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_50.incubator.logs.ApplicationLogger150Incubator; | ||
|
|
||
| @SuppressWarnings("deprecation") // isEnabled() in ExtendedLogger has been deprecated | ||
| class ApplicationLogger152Incubator extends ApplicationLogger150Incubator | ||
| implements ExtendedLogger { | ||
|
|
||
| private final io.opentelemetry.api.incubator.logs.ExtendedLogger agentLogger; | ||
|
|
||
| ApplicationLogger152Incubator(io.opentelemetry.api.logs.Logger agentLogger) { | ||
| super(agentLogger); | ||
| this.agentLogger = (io.opentelemetry.api.incubator.logs.ExtendedLogger) agentLogger; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isEnabled(Severity severity, Context applicationContext) { | ||
| return agentLogger.isEnabled( | ||
| LogBridging.toAgent(severity), AgentContextStorage.getAgentContext(applicationContext)); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isEnabled(Severity severity) { | ||
| return agentLogger.isEnabled(LogBridging.toAgent(severity)); | ||
| } | ||
| } | ||
19 changes: 19 additions & 0 deletions
19
...mentation/opentelemetryapi/v1_52/incubator/logs/ApplicationLoggerFactory152Incubator.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_52.incubator.logs; | ||
|
|
||
| import io.opentelemetry.api.logs.Logger; | ||
| import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27.logs.ApplicationLogger; | ||
| import io.opentelemetry.javaagent.instrumentation.opentelemetryapi.v1_27.logs.ApplicationLoggerFactory; | ||
|
|
||
| // this class is used from opentelemetry-api-1.27.0 via reflection | ||
| public class ApplicationLoggerFactory152Incubator implements ApplicationLoggerFactory { | ||
|
|
||
| @Override | ||
| public ApplicationLogger newLogger(Logger agentLogger) { | ||
| return new ApplicationLogger152Incubator(agentLogger); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the no-arg isEnabled() used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't used but errorprone produces the warning nevertheless
perhaps it sees that it is implemented in the super class? If we add
to this class then we could put the
@SuppressWarnings("deprecation")only on that methodThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, no worries, looks good as-is