Skip to content

Commit 740f98b

Browse files
authored
Fix declarative configuration example (#760)
1 parent 10823a3 commit 740f98b

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,40 @@ jobs:
4242

4343
- run: java -cp sdk-usage/build/libs/opentelemetry-examples-sdk-usage-0.1.0-SNAPSHOT-all.jar io.opentelemetry.sdk.example.ConfigureSpanProcessorExample
4444

45+
test-declarative-configuration-run:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
49+
50+
- name: Set up JDK for running Gradle
51+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
52+
with:
53+
distribution: temurin
54+
java-version: 17
55+
56+
- name: Set up gradle
57+
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
58+
with:
59+
cache-read-only: ${{ github.event_name == 'pull_request' }}
60+
61+
- name: Run declarative-configuration
62+
working-directory: declarative-configuration
63+
run: |
64+
export OTEL_EXPERIMENTAL_CONFIG_FILE=$(pwd)/otel-sdk-config.yaml
65+
../gradlew run
66+
4567
# this is not a required check to avoid blocking pull requests if external links break
4668
markdown-link-check:
4769
uses: ./.github/workflows/reusable-markdown-link-check.yml
4870

4971
required-status-check:
5072
needs:
5173
- build
74+
- test-declarative-configuration-run
5275
runs-on: ubuntu-latest
5376
if: always()
5477
steps:
55-
- if: needs.build.result != 'success'
56-
run: exit 1
78+
- if: >
79+
needs.build.result != 'success' ||
80+
needs.test-declarative-configuration-run.result != 'success'
81+
run: exit 1

declarative-configuration/otel-sdk-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# See https://github.com/open-telemetry/opentelemetry-configuration for details on schema and examples
22

3-
file_format: "0.3"
3+
file_format: "1.0-rc.1"
44

55
resource:
66
attributes:
77
- name: service.name
88
value: file-configuration-example
99

10+
propagator:
11+
composite:
12+
- tracecontext:
13+
- baggage:
14+
1015
tracer_provider:
1116
processors:
1217
- batch:
@@ -23,9 +28,4 @@ meter_provider:
2328
instrument_type: histogram
2429
stream:
2530
aggregation:
26-
drop:
27-
28-
propagator:
29-
composite:
30-
- tracecontext
31-
- baggage
31+
drop:

0 commit comments

Comments
 (0)