-
Notifications
You must be signed in to change notification settings - Fork 849
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
Remove -alpha artifacts from runtime classpath of stable components #6944
Open
jack-berg
wants to merge
8
commits into
open-telemetry:main
Choose a base branch
from
jack-berg:alpha-compile-only
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d9261e4
wip
jack-berg 6361036
Remove alpha artifacts from runtime classpath of stable artifacts
jack-berg d5a8535
Clean up reflective access
jack-berg 33f6493
Add graal test
jack-berg c8d7adc
Merge branch 'main' of https://github.com/open-telemetry/opentelemetr…
jack-berg 414a5e7
Revert temp stuff
jack-berg d11991c
Cleanup
jack-berg ed35f93
Fix build
jack-berg 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 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 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 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 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
24 changes: 24 additions & 0 deletions
24
...nsions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/IncubatingUtil.java
This file contains 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,24 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.sdk.autoconfigure; | ||
|
||
import io.opentelemetry.api.incubator.events.GlobalEventLoggerProvider; | ||
import io.opentelemetry.sdk.logs.SdkLoggerProvider; | ||
import io.opentelemetry.sdk.logs.internal.SdkEventLoggerProvider; | ||
|
||
/** | ||
* Utilities for interacting with {@code io.opentelemetry:opentelemetry-api-incubator}, which is not | ||
* guaranteed to be present on the classpath. For all methods, callers MUST first separately | ||
* reflectively confirm that the incubator is available on the classpath. | ||
*/ | ||
final class IncubatingUtil { | ||
|
||
private IncubatingUtil() {} | ||
|
||
static void setGlobalEventLoggerProvider(SdkLoggerProvider sdkLoggerProvider) { | ||
GlobalEventLoggerProvider.set(SdkEventLoggerProvider.create(sdkLoggerProvider)); | ||
} | ||
} |
This file contains 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
62 changes: 62 additions & 0 deletions
62
...g/java/io/opentelemetry/sdk/autoconfigure/AutoconfigureGlobalEventLoggerProviderTest.java
This file contains 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,62 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.sdk.autoconfigure; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import io.opentelemetry.api.GlobalOpenTelemetry; | ||
import io.opentelemetry.api.OpenTelemetry; | ||
import io.opentelemetry.api.incubator.events.GlobalEventLoggerProvider; | ||
import io.opentelemetry.sdk.OpenTelemetrySdk; | ||
import io.opentelemetry.sdk.logs.internal.SdkEventLoggerProvider; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.function.Supplier; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class AutoconfigureGlobalEventLoggerProviderTest { | ||
|
||
private AutoConfiguredOpenTelemetrySdkBuilder builder; | ||
|
||
@BeforeEach | ||
void resetGlobal() { | ||
GlobalOpenTelemetry.resetForTest(); | ||
GlobalEventLoggerProvider.resetForTest(); | ||
builder = | ||
AutoConfiguredOpenTelemetrySdk.builder() | ||
.addPropertiesSupplier(disableExportPropertySupplier()); | ||
} | ||
|
||
@Test | ||
void builder_setResultAsGlobalFalse() { | ||
GlobalOpenTelemetry.set(OpenTelemetry.noop()); | ||
|
||
OpenTelemetrySdk openTelemetry = builder.build().getOpenTelemetrySdk(); | ||
|
||
assertThat(GlobalOpenTelemetry.get()).extracting("delegate").isNotSameAs(openTelemetry); | ||
assertThat(GlobalEventLoggerProvider.get()).isNotSameAs(openTelemetry.getSdkLoggerProvider()); | ||
} | ||
|
||
@Test | ||
void builder_setResultAsGlobalTrue() { | ||
OpenTelemetrySdk openTelemetry = builder.setResultAsGlobal().build().getOpenTelemetrySdk(); | ||
|
||
assertThat(GlobalOpenTelemetry.get()).extracting("delegate").isSameAs(openTelemetry); | ||
assertThat(GlobalEventLoggerProvider.get()) | ||
.isInstanceOf(SdkEventLoggerProvider.class) | ||
.extracting("delegateLoggerProvider") | ||
.isSameAs(openTelemetry.getSdkLoggerProvider()); | ||
} | ||
|
||
private static Supplier<Map<String, String>> disableExportPropertySupplier() { | ||
Map<String, String> props = new HashMap<>(); | ||
props.put("otel.metrics.exporter", "none"); | ||
props.put("otel.traces.exporter", "none"); | ||
props.put("otel.logs.exporter", "none"); | ||
return () -> props; | ||
} | ||
} |
This file contains 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
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.
Not sure why, but these new graal
nativeTest
woked without any additionalreflect-config.json
entries, despite new reflective access in the SDK viaClass.forName
. 🤔