Skip to content

Commit 229fd1b

Browse files
authored
Adopt GDI spec 1.7.0 (#2160)
* add CLA note in CONTRIBUTING.md * change splunk.distro.version to telemetry.distro.version * update badge * remove unused * remove unused
1 parent c172819 commit 229fd1b

File tree

7 files changed

+16
-10
lines changed

7 files changed

+16
-10
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this repository adheres to [Semantic Versioning](https://semver.org/spec/v2.
88

99
## Unreleased
1010

11+
- Rename `splunk.distro.version` to `telemetry.distro.version`.
12+
- Declare compatibility with GDI spec 1.7.0
13+
[#2148](https://github.com/signalfx/splunk-otel-java/issues/2148)
14+
1115
## v2.11.0 - 2025-01-09
1216

1317
### General

CONTRIBUTING.md

+3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ GitHub provides additional documentation on [forking a
7575
repository](https://help.github.com/articles/fork-a-repo/) and [creating a pull
7676
request](https://help.github.com/articles/creating-a-pull-request/).
7777

78+
Before your contribution can be accepted, you will be asked to sign our
79+
[Splunk Contributor License Agreement (CLA)](https://github.com/splunk/cla-agreement/blob/main/CLA.md).
80+
7881
## Finding contributions to work on
7982

8083
Looking at the existing issues is a great way to find something to contribute

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Existing customers should consider migrating to version 2.5.0 or higher. To lear
2929
<img alt="OpenTelemetry Instrumentation for Java Version" src="https://img.shields.io/badge/otel-2.11.0-blueviolet?style=for-the-badge">
3030
</a>
3131
<a href="https://github.com/signalfx/gdi-specification/releases/tag/v1.6.0">
32-
<img alt="Splunk GDI specification" src="https://img.shields.io/badge/GDI-1.6.0-blueviolet?style=for-the-badge">
32+
<img alt="Splunk GDI specification" src="https://img.shields.io/badge/GDI-1.7.0-blueviolet?style=for-the-badge">
3333
</a>
3434
<a href="https://github.com/signalfx/splunk-otel-java/releases">
3535
<img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/signalfx/splunk-otel-java?include_prereleases&style=for-the-badge">

custom/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ tasks {
4646
outputs.dir(propertiesDir)
4747

4848
doLast {
49-
File(propertiesDir, "splunk.properties").writeText("splunk.distro.version=${project.version}")
49+
File(propertiesDir, "splunk.properties").writeText("telemetry.distro.version=${project.version}")
5050
}
5151
}
5252
}

custom/src/main/java/com/splunk/opentelemetry/SplunkDistroVersionResourceProvider.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

1717
package com.splunk.opentelemetry;
1818

19+
import static io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes.TELEMETRY_DISTRO_VERSION;
20+
1921
import com.google.auto.service.AutoService;
20-
import io.opentelemetry.api.common.AttributeKey;
2122
import io.opentelemetry.api.common.Attributes;
2223
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
2324
import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider;
@@ -28,8 +29,6 @@
2829

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

3433
private static final Resource DISTRO_VERSION_RESOURCE = initialize();
3534

@@ -44,7 +43,8 @@ private static Resource initialize() {
4443
splunkProps.load(in);
4544
return Resource.create(
4645
Attributes.of(
47-
SPLUNK_DISTRO_VERSION, splunkProps.getProperty(SPLUNK_DISTRO_VERSION.getKey())));
46+
TELEMETRY_DISTRO_VERSION,
47+
splunkProps.getProperty(TELEMETRY_DISTRO_VERSION.getKey())));
4848
} catch (IOException e) {
4949
return Resource.empty();
5050
}

custom/src/test/java/com/splunk/opentelemetry/SplunkDistroVersionResourceProviderTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.splunk.opentelemetry;
1818

1919
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
20+
import static io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes.TELEMETRY_DISTRO_VERSION;
2021

2122
import org.junit.jupiter.api.Test;
2223

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

3233
// then
3334
assertThat(resource.getAttributes().size()).isEqualTo(1);
34-
assertThat(
35-
resource.getAttributes().get(SplunkDistroVersionResourceProvider.SPLUNK_DISTRO_VERSION))
36-
.isNotEmpty();
35+
assertThat(resource.getAttributes().get(TELEMETRY_DISTRO_VERSION)).isNotEmpty();
3736
}
3837
}

smoke-tests/src/test/java/com/splunk/opentelemetry/SpringBootSmokeTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected void assertTraces(TraceInspector traces) throws IOException {
8989

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

9595
protected void assertMetrics(MetricsInspector metrics) {

0 commit comments

Comments
 (0)