Skip to content

Commit 07bb4d4

Browse files
authored
Merge branch 'open-telemetry:main' into feature/cel-sampler
2 parents d24c8d7 + a4cc53f commit 07bb4d4

File tree

17 files changed

+82
-19
lines changed

17 files changed

+82
-19
lines changed

.github/workflows/codeql.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
- release/*
88
pull_request:
9+
branches:
10+
- main
11+
- release/*
912
# TODO (trask) adding this to the merge queue causes the merge queue to fail
1013
# see related issues
1114
# - https://github.com/github/codeql-action/issues/1572
@@ -20,36 +23,48 @@ permissions:
2023

2124
jobs:
2225
analyze:
26+
name: Analyze (${{ matrix.language }})
2327
permissions:
2428
contents: read
2529
actions: read # for github/codeql-action/init to get workflow details
2630
security-events: write # for github/codeql-action/analyze to upload SARIF results
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
include:
35+
- language: actions
36+
- language: java
2737
runs-on: ubuntu-latest
2838
steps:
2939
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3040

3141
- name: Set up Java 17
42+
if: matrix.language == 'java'
3243
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
3344
with:
3445
distribution: temurin
3546
java-version: 17
3647

3748
- name: Set up gradle
49+
if: matrix.language == 'java'
3850
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0
3951

4052
- name: Initialize CodeQL
4153
uses: github/codeql-action/init@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
4254
with:
43-
languages: java, actions
55+
languages: ${{ matrix.language }}
4456
# using "latest" helps to keep up with the latest Kotlin support
4557
# see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433
4658
tools: latest
4759

4860
- name: Assemble
61+
if: matrix.language == 'java'
4962
# --no-build-cache is required for codeql to analyze all modules
5063
# --no-daemon is required for codeql to observe the compilation
5164
# (see https://docs.github.com/en/code-security/codeql-cli/getting-started-with-the-codeql-cli/preparing-your-code-for-codeql-analysis#specifying-build-commands)
5265
run: ./gradlew assemble --no-build-cache --no-daemon
5366

5467
- name: Perform CodeQL analysis
5568
uses: github/codeql-action/analyze@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
69+
with:
70+
category: "/language:${{matrix.language}}"

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ In order to build and test this whole repository you need JDK 11+.
4040

4141
For developers testing code changes before a release is complete, there are
4242
snapshot builds of the `main` branch. They are available from
43-
the Sonatype OSS snapshots repository at `https://oss.sonatype.org/content/repositories/snapshots/`
44-
([browse](https://oss.sonatype.org/content/repositories/snapshots/io/opentelemetry/contrib/))
43+
the Sonatype snapshot repository at `https://central.sonatype.com/repository/maven-snapshots/`
44+
([browse](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/io/opentelemetry/contrib/)).
4545

4646
#### Building from source
4747

RELEASING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ The version is specified in [version.gradle.kts](version.gradle.kts).
77
## Snapshot builds
88

99
Every successful CI build of the main branch automatically executes `./gradlew publishToSonatype`
10-
as the last step, which publishes a snapshot build to
11-
[Sonatype OSS snapshots repository](https://oss.sonatype.org/content/repositories/snapshots/io/opentelemetry/contrib/).
10+
as the last step, which publishes a snapshot build to the
11+
[Sonatype snapshot repository](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/io/opentelemetry/contrib/).
1212

1313
## Release cadence
1414

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies {
1515
implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.4")
1616
implementation("net.ltgt.gradle:gradle-errorprone-plugin:4.2.0")
1717
implementation("net.ltgt.gradle:gradle-nullaway-plugin:2.2.0")
18-
implementation("org.owasp:dependency-check-gradle:12.1.1")
18+
implementation("org.owasp:dependency-check-gradle:12.1.3")
1919
}
2020

2121
spotless {

buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ testing {
135135
dependencies {
136136
implementation(project(project.path))
137137

138-
implementation(enforcedPlatform("org.junit:junit-bom:5.13.0"))
138+
implementation(enforcedPlatform("org.junit:junit-bom:5.13.1"))
139139
implementation(enforcedPlatform("org.testcontainers:testcontainers-bom:1.21.1"))
140140
implementation(enforcedPlatform("com.google.guava:guava-bom:33.4.8-jre"))
141141
implementation(enforcedPlatform("com.linecorp.armeria:armeria-bom:1.32.5"))

disk-buffering/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
id("com.github.johnrengelman.shadow")
88
id("me.champeau.jmh") version "0.7.3"
99
id("ru.vyarus.animalsniffer") version "2.0.1"
10-
id("com.squareup.wire") version "5.3.2"
10+
id("com.squareup.wire") version "5.3.3"
1111
}
1212

1313
description = "Exporter implementations that store signals on disk"
@@ -20,7 +20,7 @@ dependencies {
2020
implementation("io.opentelemetry:opentelemetry-api-incubator")
2121
compileOnly("com.google.auto.value:auto-value-annotations")
2222
annotationProcessor("com.google.auto.value:auto-value")
23-
signature("com.toasttab.android:gummy-bears-api-21:0.6.1:coreLib@signature")
23+
signature("com.toasttab.android:gummy-bears-api-21:0.12.0:coreLib@signature")
2424
testImplementation("org.mockito:mockito-inline")
2525
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
2626

disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/logs/LogRecordDataMapper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ private static void addExtrasToProtoBuilder(LogRecordData source, LogRecord.Buil
6464
target.trace_id(ByteStringMapper.getInstance().stringToProto(spanContext.getTraceId()));
6565
target.dropped_attributes_count(
6666
source.getTotalAttributeCount() - source.getAttributes().size());
67+
if (source.getEventName() != null) {
68+
target.event_name(source.getEventName());
69+
}
6770
}
6871

6972
public LogRecordData mapToSdk(
@@ -99,6 +102,7 @@ private static void addExtrasToSdkItemBuilder(
99102
target.setTotalAttributeCount(source.dropped_attributes_count + attributes.size());
100103
target.setResource(resource);
101104
target.setInstrumentationScopeInfo(scopeInfo);
105+
target.setEventName(source.event_name);
102106
}
103107

104108
private static AnyValue bodyToAnyValue(Value<?> body) {

disk-buffering/src/main/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/logs/models/LogRecordDataImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public ExtendedAttributes getExtendedAttributes() {
4646
@Nullable
4747
public abstract Value<?> getBodyValue();
4848

49+
@Override
50+
@Nullable
51+
public abstract String getEventName();
52+
4953
@AutoValue.Builder
5054
public abstract static class Builder {
5155
public abstract Builder setResource(Resource value);
@@ -68,6 +72,8 @@ public abstract static class Builder {
6872

6973
public abstract Builder setTotalAttributeCount(Integer value);
7074

75+
public abstract Builder setEventName(String value);
76+
7177
public abstract LogRecordDataImpl build();
7278
}
7379
}

disk-buffering/src/test/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/logs/LogRecordDataMapperTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class LogRecordDataMapperTest {
3131
.setTimestampEpochNanos(100L)
3232
.setObservedTimestampEpochNanos(200L)
3333
.setTotalAttributeCount(3)
34+
.setEventName("my.event.name")
3435
.build();
3536

3637
@Test

disk-buffering/src/test/java/io/opentelemetry/contrib/disk/buffering/internal/serialization/mapping/logs/ProtoLogsDataMapperTest.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class ProtoLogsDataMapperTest {
3737
.setTimestampEpochNanos(100L)
3838
.setObservedTimestampEpochNanos(200L)
3939
.setTotalAttributeCount(3)
40+
.setEventName("")
4041
.build();
4142

4243
private static final LogRecordData OTHER_LOG_RECORD =
@@ -51,6 +52,7 @@ class ProtoLogsDataMapperTest {
5152
.setTimestampEpochNanos(100L)
5253
.setObservedTimestampEpochNanos(200L)
5354
.setTotalAttributeCount(3)
55+
.setEventName("")
5456
.build();
5557

5658
private static final LogRecordData LOG_RECORD_WITH_DIFFERENT_SCOPE_SAME_RESOURCE =
@@ -65,6 +67,7 @@ class ProtoLogsDataMapperTest {
6567
.setTimestampEpochNanos(100L)
6668
.setObservedTimestampEpochNanos(200L)
6769
.setTotalAttributeCount(3)
70+
.setEventName("")
6871
.build();
6972

7073
private static final LogRecordData LOG_RECORD_WITH_DIFFERENT_RESOURCE =
@@ -79,6 +82,22 @@ class ProtoLogsDataMapperTest {
7982
.setTimestampEpochNanos(100L)
8083
.setObservedTimestampEpochNanos(200L)
8184
.setTotalAttributeCount(3)
85+
.setEventName("")
86+
.build();
87+
88+
private static final LogRecordData LOG_RECORD_WITH_EVENT_NAME =
89+
LogRecordDataImpl.builder()
90+
.setResource(TestData.RESOURCE_FULL)
91+
.setSpanContext(TestData.SPAN_CONTEXT)
92+
.setInstrumentationScopeInfo(TestData.INSTRUMENTATION_SCOPE_INFO_FULL)
93+
.setAttributes(TestData.ATTRIBUTES)
94+
.setBodyValue(Value.of("Log body"))
95+
.setSeverity(Severity.DEBUG)
96+
.setSeverityText("Log severity text")
97+
.setTimestampEpochNanos(100L)
98+
.setObservedTimestampEpochNanos(200L)
99+
.setTotalAttributeCount(3)
100+
.setEventName("test.event.name")
82101
.build();
83102

84103
@Test
@@ -160,6 +179,19 @@ void verifyMultipleLogsWithDifferentResource() {
160179
assertThat(mapFromProto(proto)).containsExactlyInAnyOrderElementsOf(signals);
161180
}
162181

182+
@Test
183+
void verifyLogWithEventName() {
184+
List<LogRecordData> signals = Collections.singletonList(LOG_RECORD_WITH_EVENT_NAME);
185+
186+
LogsData result = mapToProto(signals);
187+
188+
List<ResourceLogs> resourceLogsList = result.resource_logs;
189+
LogRecord firstLog = resourceLogsList.get(0).scope_logs.get(0).log_records.get(0);
190+
191+
assertEquals("test.event.name", firstLog.event_name);
192+
assertThat(mapFromProto(result)).containsExactlyInAnyOrderElementsOf(signals);
193+
}
194+
163195
private static LogsData mapToProto(Collection<LogRecordData> signals) {
164196
return ProtoLogsDataMapper.getInstance().toProto(signals);
165197
}

0 commit comments

Comments
 (0)