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

Adopt GDI spec 1.7.0 #2160

Merged
merged 5 commits into from
Jan 16, 2025
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this repository adheres to [Semantic Versioning](https://semver.org/spec/v2.

## Unreleased

- Rename `splunk.distro.version` to `telemetry.distro.version`.
- Declare compatibility with GDI spec 1.7.0
[#2148](https://github.com/signalfx/splunk-otel-java/issues/2148)

## v2.11.0 - 2025-01-09

### General
Expand Down
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ GitHub provides additional documentation on [forking a
repository](https://help.github.com/articles/fork-a-repo/) and [creating a pull
request](https://help.github.com/articles/creating-a-pull-request/).

Before your contribution can be accepted, you will be asked to sign our
[Splunk Contributor License Agreement (CLA)](https://github.com/splunk/cla-agreement/blob/main/CLA.md).

## Finding contributions to work on

Looking at the existing issues is a great way to find something to contribute
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Existing customers should consider migrating to version 2.5.0 or higher. To lear
<img alt="OpenTelemetry Instrumentation for Java Version" src="https://img.shields.io/badge/otel-2.11.0-blueviolet?style=for-the-badge">
</a>
<a href="https://github.com/signalfx/gdi-specification/releases/tag/v1.6.0">
<img alt="Splunk GDI specification" src="https://img.shields.io/badge/GDI-1.6.0-blueviolet?style=for-the-badge">
<img alt="Splunk GDI specification" src="https://img.shields.io/badge/GDI-1.7.0-blueviolet?style=for-the-badge">
</a>
<a href="https://github.com/signalfx/splunk-otel-java/releases">
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/signalfx/splunk-otel-java?include_prereleases&style=for-the-badge">
Expand Down
2 changes: 1 addition & 1 deletion custom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ tasks {
outputs.dir(propertiesDir)

doLast {
File(propertiesDir, "splunk.properties").writeText("splunk.distro.version=${project.version}")
File(propertiesDir, "splunk.properties").writeText("telemetry.distro.version=${project.version}")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

package com.splunk.opentelemetry;

import static io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes.TELEMETRY_DISTRO_VERSION;

import com.google.auto.service.AutoService;
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider;
Expand All @@ -28,8 +29,6 @@

@AutoService(ResourceProvider.class)
public class SplunkDistroVersionResourceProvider implements ResourceProvider {
static final AttributeKey<String> SPLUNK_DISTRO_VERSION =
AttributeKey.stringKey("splunk.distro.version");

private static final Resource DISTRO_VERSION_RESOURCE = initialize();

Expand All @@ -44,7 +43,8 @@ private static Resource initialize() {
splunkProps.load(in);
return Resource.create(
Attributes.of(
SPLUNK_DISTRO_VERSION, splunkProps.getProperty(SPLUNK_DISTRO_VERSION.getKey())));
TELEMETRY_DISTRO_VERSION,
breedx-splk marked this conversation as resolved.
Show resolved Hide resolved
splunkProps.getProperty(TELEMETRY_DISTRO_VERSION.getKey())));
} catch (IOException e) {
return Resource.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.splunk.opentelemetry;

import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
import static io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes.TELEMETRY_DISTRO_VERSION;

import org.junit.jupiter.api.Test;

Expand All @@ -31,8 +32,6 @@ void shouldGetDistroVersionFromProperties() {

// then
assertThat(resource.getAttributes().size()).isEqualTo(1);
assertThat(
resource.getAttributes().get(SplunkDistroVersionResourceProvider.SPLUNK_DISTRO_VERSION))
.isNotEmpty();
assertThat(resource.getAttributes().get(TELEMETRY_DISTRO_VERSION)).isNotEmpty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected void assertTraces(TraceInspector traces) throws IOException {

// verify that correct service name is set in the resource
assertTrue(traces.resourceExists("service.name", "smoke-test-app"));
assertTrue(traces.resourceExists("splunk.distro.version", v -> !v.isEmpty()));
assertTrue(traces.resourceExists("telemetry.distro.version", v -> !v.isEmpty()));
}

protected void assertMetrics(MetricsInspector metrics) {
Expand Down
Loading