Skip to content
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

Update to SDK 0.17.0 #2338

Merged
merged 4 commits into from
Feb 19, 2021
Merged

Update to SDK 0.17.0 #2338

merged 4 commits into from
Feb 19, 2021

Conversation

anuraaga
Copy link
Contributor

No description provided.

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🥳

return extract(GlobalOpenTelemetry.getPropagators(), carrier, getter);
}

public <C> Context extract(C carrier, TextMapPropagator.Getter<C> getter) {
public <C> Context extract(C carrier, TextMapGetter<C> getter) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a nice improvement 👍

@@ -35,7 +35,7 @@ void resetOpenTelemetry() {
public void shouldCreateNoopRequestIfNoPropagatorsSet() throws IOException {
// given
InputStream mock = mock(InputStream.class);
GlobalOpenTelemetry.set(OpenTelemetry.getDefault());
GlobalOpenTelemetry.set(OpenTelemetry.noop());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😁

@@ -12,7 +12,7 @@
public final class BaggageBridging {

public static Baggage toApplication(io.opentelemetry.api.baggage.Baggage agentBaggage) {
BaggageBuilder applicationBaggageBuilder = Baggage.builder().setNoParent();
BaggageBuilder applicationBaggageBuilder = Baggage.builder();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is better too 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was quite happy with how baggage turned out here and in the SDK's unit tests too, much simpler API.

Comment on lines -66 to -90

// Reread after our calls to setProperty to determine whether we need to enforce agent defaults.
Properties environmentPropertiesWithCopies =
new ConfigBuilder()
.readEnvironmentVariables()
.readSystemProperties()
.build()
.asJavaProperties();

// Agent has different defaults than SDK
if (!environmentPropertiesWithCopies.containsKey("otel.propagators")) {
System.setProperty("otel.propagators", "tracecontext,baggage");
}
String traceExporter = environmentPropertiesWithCopies.getProperty("otel.traces.exporter");
if (traceExporter == null) {
System.setProperty("otel.traces.exporter", "otlp");
} else if (traceExporter.equals("none")) {
System.clearProperty("otel.traces.exporter");
}
String metricExporter = environmentPropertiesWithCopies.getProperty("otel.metrics.exporter");
if (metricExporter == null) {
System.setProperty("otel.metrics.exporter", "otlp");
} else if (metricExporter.equals("none")) {
System.clearProperty("otel.metrics.exporter");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this :) Why is this not needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK autoconfigure now follows the same defaults as the spec, which are the same defaults our agent expected.

@anuraaga anuraaga merged commit 000df96 into open-telemetry:main Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants