Skip to content

Commit

Permalink
Merge branch 'main' into remove-semconv
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg authored Sep 15, 2023
2 parents e8e02cb + 9b081e1 commit e66909f
Show file tree
Hide file tree
Showing 35 changed files with 167 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-tracecontext-testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
- uses: actions/checkout@v4

- name: Login to GitHub package registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: integration-tests/tracecontext/docker
push: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-test-containers-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Docker login
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

## Version 1.30.1 (2023-09-11)

* Fix autoconfigure bug creating multiple `PrometheusHttpServer` instances with same port
([#5911](https://github.com/open-telemetry/opentelemetry-java/pull/5811))

## Version 1.30.0 (2023-09-08)

### API
Expand Down
72 changes: 36 additions & 36 deletions README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/apidiffs/1.30.1_vs_1.30.0/opentelemetry-api.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
2 changes: 2 additions & 0 deletions docs/apidiffs/1.30.1_vs_1.30.0/opentelemetry-context.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
2 changes: 2 additions & 0 deletions docs/apidiffs/1.30.1_vs_1.30.0/opentelemetry-sdk-common.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
2 changes: 2 additions & 0 deletions docs/apidiffs/1.30.1_vs_1.30.0/opentelemetry-sdk-logs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
2 changes: 2 additions & 0 deletions docs/apidiffs/1.30.1_vs_1.30.0/opentelemetry-sdk-metrics.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
2 changes: 2 additions & 0 deletions docs/apidiffs/1.30.1_vs_1.30.0/opentelemetry-sdk-testing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
2 changes: 2 additions & 0 deletions docs/apidiffs/1.30.1_vs_1.30.0/opentelemetry-sdk-trace.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
2 changes: 2 additions & 0 deletions docs/apidiffs/1.30.1_vs_1.30.0/opentelemetry-sdk.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Comparing source compatibility of against
No changes.
2 changes: 1 addition & 1 deletion sdk-extensions/incubator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies {
// ... proceed with normal sourcesJar, compileJava, etc

// TODO(jack-berg): update ref to be released version when available
val configurationRef = "0eb96de17c6533f668163873d95bd026bce1d8fb"
val configurationRef = "0508846f82ed54b230fa638e1e7556c52efee25e"
val configurationRepoZip = "https://github.com/open-telemetry/opentelemetry-configuration/archive/$configurationRef.zip"
val buildDirectory = layout.buildDirectory.asFile.get()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

package io.opentelemetry.sdk.extension.incubator.fileconfig;

import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.OpenTelemetryConfiguration;
import java.io.InputStream;
Expand All @@ -13,7 +15,10 @@

final class ConfigurationReader {

private static final ObjectMapper MAPPER = new ObjectMapper();
private static final ObjectMapper MAPPER =
new ObjectMapper()
// Create empty object instances for keys which are present but have null values
.setDefaultSetterInfo(JsonSetter.Value.forValueNulls(Nulls.AS_EMPTY));

private ConfigurationReader() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
import io.opentelemetry.sdk.autoconfigure.internal.SpiHelper;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.Aggregation;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.Base2ExponentialBucketHistogram;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.Drop;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.ExplicitBucketHistogram;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.LastValue;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.Sum;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -45,13 +48,12 @@ private static Stream<Arguments> createTestCases() {
Arguments.of(
new Aggregation(), io.opentelemetry.sdk.metrics.Aggregation.defaultAggregation()),
Arguments.of(
new Aggregation().withDrop(new Object()),
new Aggregation().withDrop(new Drop()),
io.opentelemetry.sdk.metrics.Aggregation.drop()),
Arguments.of(
new Aggregation().withSum(new Object()),
io.opentelemetry.sdk.metrics.Aggregation.sum()),
new Aggregation().withSum(new Sum()), io.opentelemetry.sdk.metrics.Aggregation.sum()),
Arguments.of(
new Aggregation().withLastValue(new Object()),
new Aggregation().withLastValue(new LastValue()),
io.opentelemetry.sdk.metrics.Aggregation.lastValue()),
Arguments.of(
new Aggregation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.TracerProvider;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.View;
import io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.Zipkin;
import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -276,4 +278,60 @@ void read_KitchenSinkExampleFile() throws IOException {
assertThat(config).isEqualTo(expected);
}
}

@Test
void nullValuesParsedToEmptyObjects() {
String objectPlaceholderString =
"file_format: \"0.1\"\n"
+ "tracer_provider:\n"
+ " processors:\n"
+ " - batch:\n"
+ " exporter:\n"
+ " console: {}\n"
+ "meter_provider:\n"
+ " views:\n"
+ " - selector:\n"
+ " instrument_type: histogram\n"
+ " stream:\n"
+ " aggregation:\n"
+ " drop: {}\n";
OpenTelemetryConfiguration objectPlaceholderModel =
ConfigurationReader.parse(
new ByteArrayInputStream(objectPlaceholderString.getBytes(StandardCharsets.UTF_8)));

String noOjbectPlaceholderString =
"file_format: \"0.1\"\n"
+ "tracer_provider:\n"
+ " processors:\n"
+ " - batch:\n"
+ " exporter:\n"
+ " console:\n"
+ "meter_provider:\n"
+ " views:\n"
+ " - selector:\n"
+ " instrument_type: histogram\n"
+ " stream:\n"
+ " aggregation:\n"
+ " drop:\n";
OpenTelemetryConfiguration noObjectPlaceholderModel =
ConfigurationReader.parse(
new ByteArrayInputStream(noOjbectPlaceholderString.getBytes(StandardCharsets.UTF_8)));

SpanExporter exporter =
noObjectPlaceholderModel
.getTracerProvider()
.getProcessors()
.get(0)
.getBatch()
.getExporter();
assertThat(exporter.getConsole()).isNotNull();
assertThat(exporter.getOtlp()).isNull();

Aggregation aggregation =
noObjectPlaceholderModel.getMeterProvider().getViews().get(0).getStream().getAggregation();
assertThat(aggregation.getDrop()).isNotNull();
assertThat(aggregation.getSum()).isNull();

assertThat(objectPlaceholderModel).isEqualTo(noObjectPlaceholderModel);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ final class SdkMeter implements Meter {
* <li>They are not null or empty strings.
* <li>They are case-insensitive, ASCII strings.
* <li>The first character must be an alphabetic character.
* <li>Subsequent characters must belong to the alphanumeric characters, '_', '.', and '-'.
* <li>Subsequent characters must belong to the alphanumeric characters, '_', '.', '/', and '-'.
* <li>They can have a maximum length of 255 characters.
* </ul>
*/
private static final Pattern VALID_INSTRUMENT_NAME_PATTERN =
Pattern.compile("([A-Za-z]){1}([A-Za-z0-9\\_\\-\\.]){0,254}");
Pattern.compile("([A-Za-z]){1}([A-Za-z0-9\\_\\-\\./]){0,254}");

private static final Meter NOOP_METER = MeterProvider.noop().get("noop");
private static final String NOOP_INSTRUMENT_NAME = "noop";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ void checkValidInstrumentNameTest() {
assertThat(checkValidInstrumentName("a1234567890")).isTrue();
assertThat(checkValidInstrumentName("a_-.")).isTrue();
assertThat(checkValidInstrumentName(new String(new char[255]).replace('\0', 'a'))).isTrue();
assertThat(checkValidInstrumentName("a/b")).isTrue();

// Empty and null not allowed
assertThat(checkValidInstrumentName(null)).isFalse();
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginManagement {
plugins {
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.gradle.enterprise") version "3.14.1"
id("com.gradle.enterprise") version "3.15"
id("de.undercouch.download") version "5.5.0"
id("org.jsonschema2pojo") version "1.2.1"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
Expand Down

0 comments on commit e66909f

Please sign in to comment.