Skip to content

Commit 910f64e

Browse files
committed
merge maine
2 parents 65491e2 + c726d32 commit 910f64e

File tree

52 files changed

+514
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+514
-225
lines changed

.github/workflows/auto-update-pull-request.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,22 @@ jobs:
5555
git config user.name otelbot
5656
git config user.email [email protected]
5757
58+
- id: gradle-task
59+
if: steps.unzip-patch.outputs.exists == 'true'
60+
run: |
61+
if [[ "${{ github.event.workflow_run.name }}" == "Auto spotless" ]]; then
62+
echo "name=spotlessApply" >> $GITHUB_OUTPUT
63+
elif [[ "${{ github.event.workflow_run.name }}" == "Auto license report" ]]; then
64+
echo "name=generateLicenseReport" >> $GITHUB_OUTPUT
65+
else
66+
echo "name=unknown" >> $GITHUB_OUTPUT
67+
fi
68+
5869
- name: Apply patch and push
5970
if: steps.unzip-patch.outputs.exists == 'true'
6071
run: |
6172
git apply "${{ runner.temp }}/patch"
62-
git commit -a -m "./gradlew spotlessApply"
73+
git commit -a -m "./gradlew ${{ steps.gradle-task.outputs.name }}"
6374
git push
6475
6576
- id: get-pr
@@ -84,12 +95,12 @@ jobs:
8495
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
8596
PR_NUMBER: ${{ steps.get-pr.outputs.number }}
8697
run: |
87-
gh pr comment $PR_NUMBER --body "🔧 The result from spotlessApply was committed to the PR branch."
98+
gh pr comment $PR_NUMBER --body "🔧 The result from ${{ steps.gradle-task.outputs.name }} was committed to the PR branch."
8899
89100
- if: steps.unzip-patch.outputs.exists == 'true' && failure()
90101
env:
91102
GH_REPO: ${{ github.repository }}
92103
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
93104
PR_NUMBER: ${{ steps.get-pr.outputs.number }}
94105
run: |
95-
gh pr comment $PR_NUMBER --body "❌ The result from spotlessApply could not be committed to the PR branch, see logs: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID."
106+
gh pr comment $PR_NUMBER --body "❌ The result from ${{ steps.gradle-task.outputs.name }} could not be committed to the PR branch, see logs: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID."

.github/workflows/codeql.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ permissions:
2121

2222
jobs:
2323
analyze:
24+
name: Analyze (${{ matrix.language }})
2425
permissions:
2526
contents: read
2627
actions: read # for github/codeql-action/init to get workflow details
2728
security-events: write # for github/codeql-action/analyze to upload SARIF results
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
include:
33+
- language: actions
34+
- language: java
2835
runs-on: oracle-8cpu-32gb-x86-64
29-
3036
steps:
3137
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3238

@@ -44,20 +50,22 @@ jobs:
4450
# and so it uses more parallelism which uses more memory
4551
sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx8g /" gradle.properties
4652
47-
- name: Setup Gradle
53+
- name: Set up Gradle
54+
if: matrix.language == 'java'
4855
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0
4956
with:
5057
cache-read-only: ${{ github.event_name == 'pull_request' }}
5158

5259
- name: Initialize CodeQL
5360
uses: github/codeql-action/init@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
5461
with:
55-
languages: java, actions
62+
languages: ${{ matrix.language }}
5663
# using "latest" helps to keep up with the latest Kotlin support
5764
# see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433
5865
tools: latest
5966

60-
- name: Build
67+
- name: Assemble
68+
if: matrix.language == 'java'
6169
# --no-build-cache is required for codeql to analyze all modules
6270
# --no-daemon is required for codeql to observe the compilation
6371
# (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)
@@ -66,3 +74,5 @@ jobs:
6674

6775
- name: Perform CodeQL analysis
6876
uses: github/codeql-action/analyze@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
77+
with:
78+
category: "/language:${{matrix.language}}"

.github/workflows/reusable-markdown-link-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ jobs:
2222
--exclude "^http://code.google.com/p/concurrentlinkedhashmap$"
2323
--exclude "^https://softwareengineering.stackexchange.com/questions/29727"
2424
--max-retries 6
25-
--max-concurrency 1
25+
--max-concurrency 4
26+
--github-token ${{ github.token }}
2627
.

conventions/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ dependencies {
6060
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.6")
6161
implementation("org.apache.httpcomponents:httpclient:4.5.14")
6262
implementation("com.gradle.develocity:com.gradle.develocity.gradle.plugin:4.0.2")
63-
implementation("org.owasp:dependency-check-gradle:12.1.2")
63+
implementation("org.owasp:dependency-check-gradle:12.1.3")
6464
implementation("ru.vyarus:gradle-animalsniffer-plugin:2.0.1")
6565
implementation("org.spdx:spdx-gradle-plugin:0.9.0")
6666
// When updating, also update dependencyManagement/build.gradle.kts

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ val asmVersion = "9.8"
4444
val jmhVersion = "1.37"
4545
val mockitoVersion = "4.11.0"
4646
val slf4jVersion = "2.0.17"
47-
val semConvVersion = "1.32.0"
47+
val semConvVersion = "1.34.0"
4848
val semConvAlphaVersion = semConvVersion.replaceFirst("(-rc.*)?$".toRegex(), "-alpha$1")
4949

5050
val CORE_DEPENDENCIES = listOf(

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
package io.opentelemetry.instrumentation.api.incubator.semconv.db;
77

88
import static io.opentelemetry.instrumentation.api.internal.AttributesExtractorUtil.internalSet;
9+
import static io.opentelemetry.semconv.DbAttributes.DB_OPERATION_NAME;
10+
import static io.opentelemetry.semconv.DbAttributes.DB_QUERY_TEXT;
911

1012
import io.opentelemetry.api.common.AttributeKey;
1113
import io.opentelemetry.api.common.AttributesBuilder;
@@ -27,11 +29,7 @@ public final class DbClientAttributesExtractor<REQUEST, RESPONSE>
2729

2830
// copied from DbIncubatingAttributes
2931
private static final AttributeKey<String> DB_STATEMENT = AttributeKey.stringKey("db.statement");
30-
private static final AttributeKey<String> DB_QUERY_TEXT = AttributeKey.stringKey("db.query.text");
3132
static final AttributeKey<String> DB_OPERATION = AttributeKey.stringKey("db.operation");
32-
static final AttributeKey<String> DB_OPERATION_NAME = AttributeKey.stringKey("db.operation.name");
33-
static final AttributeKey<String> DB_RESPONSE_STATUS_CODE =
34-
AttributeKey.stringKey("db.response.status_code");
3533

3634
/** Creates the database client attributes extractor with default configuration. */
3735
public static <REQUEST, RESPONSE> AttributesExtractor<REQUEST, RESPONSE> create(

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientCommonAttributesExtractor.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
package io.opentelemetry.instrumentation.api.incubator.semconv.db;
77

88
import static io.opentelemetry.instrumentation.api.internal.AttributesExtractorUtil.internalSet;
9+
import static io.opentelemetry.semconv.DbAttributes.DB_NAMESPACE;
10+
import static io.opentelemetry.semconv.DbAttributes.DB_RESPONSE_STATUS_CODE;
11+
import static io.opentelemetry.semconv.DbAttributes.DB_SYSTEM_NAME;
912
import static io.opentelemetry.semconv.ErrorAttributes.ERROR_TYPE;
1013

1114
import io.opentelemetry.api.common.AttributeKey;
@@ -23,15 +26,10 @@ abstract class DbClientCommonAttributesExtractor<
2326

2427
// copied from DbIncubatingAttributes
2528
private static final AttributeKey<String> DB_NAME = AttributeKey.stringKey("db.name");
26-
static final AttributeKey<String> DB_NAMESPACE = AttributeKey.stringKey("db.namespace");
2729
static final AttributeKey<String> DB_SYSTEM = AttributeKey.stringKey("db.system");
28-
public static final AttributeKey<String> DB_SYSTEM_NAME =
29-
AttributeKey.stringKey("db.system.name");
3030
private static final AttributeKey<String> DB_USER = AttributeKey.stringKey("db.user");
3131
private static final AttributeKey<String> DB_CONNECTION_STRING =
3232
AttributeKey.stringKey("db.connection_string");
33-
private static final AttributeKey<String> DB_RESPONSE_STATUS_CODE =
34-
AttributeKey.stringKey("db.response.status_code");
3533

3634
final GETTER getter;
3735

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientMetricsAdvice.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import io.opentelemetry.api.incubator.metrics.ExtendedDoubleHistogramBuilder;
1212
import io.opentelemetry.api.metrics.DoubleHistogramBuilder;
13+
import io.opentelemetry.semconv.DbAttributes;
1314
import io.opentelemetry.semconv.ErrorAttributes;
1415
import io.opentelemetry.semconv.NetworkAttributes;
1516
import io.opentelemetry.semconv.ServerAttributes;
@@ -28,11 +29,11 @@ static void applyClientDurationAdvice(DoubleHistogramBuilder builder) {
2829
((ExtendedDoubleHistogramBuilder) builder)
2930
.setAttributesAdvice(
3031
asList(
31-
DbClientCommonAttributesExtractor.DB_SYSTEM_NAME,
32-
SqlClientAttributesExtractor.DB_COLLECTION_NAME,
33-
DbClientCommonAttributesExtractor.DB_NAMESPACE,
34-
DbClientAttributesExtractor.DB_OPERATION_NAME,
35-
DbClientAttributesExtractor.DB_RESPONSE_STATUS_CODE,
32+
DbAttributes.DB_SYSTEM_NAME,
33+
DbAttributes.DB_COLLECTION_NAME,
34+
DbAttributes.DB_NAMESPACE,
35+
DbAttributes.DB_OPERATION_NAME,
36+
DbAttributes.DB_RESPONSE_STATUS_CODE,
3637
ErrorAttributes.ERROR_TYPE,
3738
NetworkAttributes.NETWORK_PEER_ADDRESS,
3839
NetworkAttributes.NETWORK_PEER_PORT,

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlClientAttributesExtractor.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
package io.opentelemetry.instrumentation.api.incubator.semconv.db;
77

88
import static io.opentelemetry.instrumentation.api.internal.AttributesExtractorUtil.internalSet;
9+
import static io.opentelemetry.semconv.DbAttributes.DB_COLLECTION_NAME;
10+
import static io.opentelemetry.semconv.DbAttributes.DB_OPERATION_BATCH_SIZE;
11+
import static io.opentelemetry.semconv.DbAttributes.DB_OPERATION_NAME;
12+
import static io.opentelemetry.semconv.DbAttributes.DB_QUERY_TEXT;
913

1014
import io.opentelemetry.api.common.AttributeKey;
1115
import io.opentelemetry.api.common.AttributesBuilder;
@@ -32,14 +36,7 @@ public final class SqlClientAttributesExtractor<REQUEST, RESPONSE>
3236

3337
// copied from DbIncubatingAttributes
3438
private static final AttributeKey<String> DB_OPERATION = AttributeKey.stringKey("db.operation");
35-
private static final AttributeKey<String> DB_OPERATION_NAME =
36-
AttributeKey.stringKey("db.operation.name");
3739
private static final AttributeKey<String> DB_STATEMENT = AttributeKey.stringKey("db.statement");
38-
private static final AttributeKey<String> DB_QUERY_TEXT = AttributeKey.stringKey("db.query.text");
39-
static final AttributeKey<String> DB_COLLECTION_NAME =
40-
AttributeKey.stringKey("db.collection.name");
41-
private static final AttributeKey<Long> DB_OPERATION_BATCH_SIZE =
42-
AttributeKey.longKey("db.operation.batch.size");
4340
private static final AttributeKeyTemplate<String> DB_QUERY_PARAMETER =
4441
AttributeKeyTemplate.stringKeyTemplate("db.query.parameter");
4542

instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/DbClientAttributesExtractorTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import io.opentelemetry.context.Context;
1414
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
1515
import io.opentelemetry.instrumentation.api.internal.SemconvStability;
16+
import io.opentelemetry.semconv.DbAttributes;
1617
import io.opentelemetry.semconv.incubating.DbIncubatingAttributes;
1718
import java.util.Collections;
1819
import java.util.HashMap;
@@ -85,15 +86,15 @@ void shouldExtractAllAvailableAttributes() {
8586
assertThat(startAttributes.build())
8687
.containsOnly(
8788
entry(DbIncubatingAttributes.DB_SYSTEM, "myDb"),
88-
entry(DbIncubatingAttributes.DB_SYSTEM_NAME, "myDb"),
89+
entry(DbAttributes.DB_SYSTEM_NAME, "myDb"),
8990
entry(DbIncubatingAttributes.DB_USER, "username"),
9091
entry(DbIncubatingAttributes.DB_NAME, "potatoes"),
9192
entry(DbIncubatingAttributes.DB_CONNECTION_STRING, "mydb:///potatoes"),
9293
entry(DbIncubatingAttributes.DB_STATEMENT, "SELECT * FROM potato"),
9394
entry(DbIncubatingAttributes.DB_OPERATION, "SELECT"),
94-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
95-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM potato"),
96-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"));
95+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
96+
entry(DbAttributes.DB_QUERY_TEXT, "SELECT * FROM potato"),
97+
entry(DbAttributes.DB_OPERATION_NAME, "SELECT"));
9798
} else if (SemconvStability.emitOldDatabaseSemconv()) {
9899
assertThat(startAttributes.build())
99100
.containsOnly(
@@ -106,10 +107,10 @@ void shouldExtractAllAvailableAttributes() {
106107
} else if (SemconvStability.emitStableDatabaseSemconv()) {
107108
assertThat(startAttributes.build())
108109
.containsOnly(
109-
entry(DbIncubatingAttributes.DB_SYSTEM_NAME, "myDb"),
110-
entry(DbIncubatingAttributes.DB_NAMESPACE, "potatoes"),
111-
entry(DbIncubatingAttributes.DB_QUERY_TEXT, "SELECT * FROM potato"),
112-
entry(DbIncubatingAttributes.DB_OPERATION_NAME, "SELECT"));
110+
entry(DbAttributes.DB_SYSTEM_NAME, "myDb"),
111+
entry(DbAttributes.DB_NAMESPACE, "potatoes"),
112+
entry(DbAttributes.DB_QUERY_TEXT, "SELECT * FROM potato"),
113+
entry(DbAttributes.DB_OPERATION_NAME, "SELECT"));
113114
}
114115

115116
assertThat(endAttributes.build().isEmpty()).isTrue();

0 commit comments

Comments
 (0)