Skip to content
Draft
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
30 changes: 30 additions & 0 deletions .github/workflows/check-vendored-otel-sql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Check vendored OpenTelemetry SQL grammar'
on:
pull_request:
paths:
- '.github/workflows/check-vendored-otel-sql.yml'
- 'THIRD_PARTY_NOTICES.md'
- 'scripts/sync-otel-sql.sh'
- 'sentry/src/main/jflex/**'
- 'sentry/src/main/java/io/sentry/vendor/otel/sql/**'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Compare vendored files with upstream
run: ./scripts/sync-otel-sql.sh --check
92 changes: 92 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,98 @@ limitations under the License.

---

## OpenTelemetry Java Instrumentation — SQL grammar (Apache 2.0)

**Source:** https://github.com/open-telemetry/opentelemetry-java-instrumentation (Commit: 979e8684e783f1a710955341924bdddeff6e83f2)<br>
**License:** Apache License 2.0<br>
**Copyright:** Copyright The OpenTelemetry Authors

### Scope

The Sentry Java SDK's SQL query analyzer uses OpenTelemetry Java Instrumentation's SQL grammar and the three classes it depends on, vendored by `scripts/sync-otel-sql.sh` at the commit recorded in `sentry/src/main/java/io/sentry/vendor/otel/sql/UPSTREAM`. The script changes only package, imports and annotations; the grammar rules are unchanged:

- `sentry/src/main/jflex/SqlSanitizer.jflex` is adapted from `instrumentation-api-incubator/src/main/jflex/SqlSanitizer.jflex`.
- `io.sentry.vendor.otel.sql.AutoSqlSanitizer` is generated from that grammar at build time and is included in the published `sentry` artifact. It contains the JFlex skeleton, which is licensed under CC0-1.0; JFlex itself is a build-time tool and is not distributed.
- `io.sentry.vendor.otel.sql.SqlQuery` and `io.sentry.vendor.otel.sql.SqlDialect` are adapted from `instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/SqlQuery.java` and `SqlDialect.java`.
- `io.sentry.vendor.otel.sql.StringUtils` is adapted from `instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/internal/StringUtils.java`.

```
Copyright The OpenTelemetry Authors
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

---

## OpenTelemetry Java Instrumentation — SQL analyzer tests (Apache 2.0)

**Source:** https://github.com/open-telemetry/opentelemetry-java-instrumentation (Commit: 2acd9a5f1153e725a3b80e9b90ad55b385576fe8)<br>
**License:** Apache License 2.0<br>
**Copyright:** Copyright The OpenTelemetry Authors

### Scope

The Sentry Java SDK's SQL analyzer test suite includes test inputs adapted from the SQL analyzer tests in `instrumentation-api-incubator/src/test/java/io/opentelemetry/instrumentation/api/incubator/semconv/db/`. The adapted inputs reside in `sentry/src/test/resources/sql/analyzer-cases.json` (cases whose `source` starts with `otel-java:`) and `sentry/src/test/java/io/sentry/util/sql/SqlQueryAnalyzerPathologicalTest.kt`. These are test sources and are not part of the published artifacts.

```
Copyright The OpenTelemetry Authors
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

---

## OpenTelemetry .NET Contrib — SQL processor tests (Apache 2.0)

**Source:** https://github.com/open-telemetry/opentelemetry-dotnet-contrib (Commit: 4e3aba9ddf89f9accac004f44f32ebde335dd115)<br>
**License:** Apache License 2.0<br>
**Copyright:** Copyright The OpenTelemetry Authors

### Scope

The Sentry Java SDK's SQL analyzer test suite includes test inputs adapted from `test/OpenTelemetry.Contrib.Shared.Tests/SqlProcessorTests.cs` and `test/OpenTelemetry.Contrib.Shared.Tests/SqlProcessorTestCases.json`. The adapted inputs reside in `sentry/src/test/resources/sql/analyzer-cases.json` (cases whose `source` starts with `otel-dotnet:`). These are test sources and are not part of the published artifacts.

```
Copyright The OpenTelemetry Authors
SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

---

## SalomonBrys — ANR-WatchDog (MIT)

**Source:** https://github.com/SalomonBrys/ANR-WatchDog (Commit: 1969075f75f5980e9000eaffbaa13b0daf282dcb)<br>
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ netflix-dgs-subscriptions-websockets-autoconfigure = { module = "com.netflix.gra
jackson-bom = { module = "com.fasterxml.jackson:jackson-bom", version.ref = "jackson" }
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
jetbrains-annotations = { module = "org.jetbrains:annotations", version = "23.0.0" }
# Build-time only: generates the SQL lexer in :sentry (src/main/jflex). Upstream OpenTelemetry uses 1.9.1.
jflex = { module = "de.jflex:jflex", version = "1.9.1" }
kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
Expand Down
Loading
Loading