Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next-release.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* Switched the default of `otel.exporter.otlp.metrics.temporality.preference` from `CUMULATIVE` to `DELTA` to improve dashboarding experience with Kibana. If you want to restore the previous behaviour, you can manually override `otel.exporter.otlp.metrics.temporality.preference` to `CUMULATIVE` via JVM-properties or environment variables. - #583
* Set elastic-specific User-Agent header for OTLP exporters - #593
* Enable Azure resource provider by default with `otel.resource.providers.azure.enabled` = `true`.
2 changes: 0 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ opentelemetryInstrumentationAlphaBom = { group = "io.opentelemetry.instrumentati

opentelemetryProto = { group = "io.opentelemetry.proto", name = "opentelemetry-proto", version.ref = "opentelemetryProto" }

awsContribResources = { group = "io.opentelemetry.contrib", name = "opentelemetry-aws-resources", version.ref = "opentelemetryContribAlpha" }
gcpContribResources = { group = "io.opentelemetry.contrib", name = "opentelemetry-gcp-resources", version.ref = "opentelemetryContribAlpha" }
contribResources = { group = "io.opentelemetry.contrib", name = "opentelemetry-resource-providers", version.ref = "opentelemetryContribAlpha" }
contribSpanStacktrace = { group = "io.opentelemetry.contrib", name = "opentelemetry-span-stacktrace", version.ref = "opentelemetryContribAlpha" }
contribInferredSpans = { group = "io.opentelemetry.contrib", name = "opentelemetry-inferred-spans", version.ref = "opentelemetryContribAlpha" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@AutoService(AutoConfigurationCustomizerProvider.class)
public class ResourcesAutoConfiguration implements AutoConfigurationCustomizerProvider {

private static final String[] PROVIDERS = {"aws", "gcp"};
private static final String[] PROVIDERS = {"aws", "gcp", "azure"};

@Override
public void customize(AutoConfigurationCustomizer autoConfiguration) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,48 +21,55 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.opentelemetry.sdk.autoconfigure.spi.internal.DefaultConfigProperties;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.jupiter.api.Test;

class ResourcesAutoConfigurationTest {

public static final String GCP_ENABLED = "otel.resource.providers.gcp.enabled";
public static final String AWS_ENABLED = "otel.resource.providers.aws.enabled";
private static final List<String> LIST =
Arrays.asList(config("gcp"), config("aws"), config("azure"));

private static String config(String provider) {
return String.format("otel.resource.providers.%s.enabled", provider);
}

@Test
void elastic_defaults() {
// default everything should be enabled

Map<String, String> explicitConfig = Collections.emptyMap();
Map<String, String> expectedResult = new HashMap<>();
expectedResult.put(GCP_ENABLED, "true");
expectedResult.put(AWS_ENABLED, "true");

LIST.forEach(v -> expectedResult.put(v, "true"));

testConfig(explicitConfig, expectedResult);
}

@Test
void explicitly_enabled() {
Map<String, String> explicitConfig = new HashMap<>();
explicitConfig.put(GCP_ENABLED, "true");
explicitConfig.put(LIST.get(0), "true");

Map<String, String> expectedResult = new HashMap<>();
expectedResult.put(GCP_ENABLED, "true");
expectedResult.put(AWS_ENABLED, "true");
LIST.forEach(v -> expectedResult.put(v, "true"));

testConfig(explicitConfig, expectedResult);
}

@Test
void explicitly_disabled() {
Map<String, String> explicitConfig = new HashMap<>();
explicitConfig.put(GCP_ENABLED, "false");
explicitConfig.put(LIST.get(0), "false");

Map<String, String> expectedResult = new HashMap<>();
expectedResult.put(GCP_ENABLED, "false");
expectedResult.put(AWS_ENABLED, "true");
expectedResult.put(LIST.get(0), "false");
for (int i = 1; i < LIST.size(); i++) {
expectedResult.put(LIST.get(i), "true");
}

testConfig(explicitConfig, expectedResult);
}
Expand Down