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
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
version: ${{ env.ZIG_VERSION }}
mirror: 'https://zigmirror.com'
- run: zig build --fetch
- run: zig build docs
- run: zig build sdk-docs

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
- name: Fetch dependencies
run: zig build --fetch
- name: Run integration tests
run: zig build integration
run: zig build sdk-integration
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
version: ${{ env.ZIG_VERSION }}
mirror: 'https://zigmirror.com'
- run: zig build --fetch
- run: zig build test -Dtest-verbose=true
- run: zig build sdk-test -Dtest-verbose=true
timeout-minutes: 3

build_examples:
Expand All @@ -45,7 +45,7 @@ jobs:
version: ${{ env.ZIG_VERSION }}
mirror: 'https://zigmirror.com'
- run: zig build --fetch
- run: zig build examples
- run: zig build sdk-examples

# Execute bencharmks only if the PR has a specific label 'run::benchmarks'
benchmarks:
Expand All @@ -61,7 +61,7 @@ jobs:
# The optimize argument builds the SDK library with optimizations,
# benchmarks files are always compiled with ReleaseFast.
- run: |
zig build benchmarks -Doptimize=ReleaseFast -Dbenchmark-output=benchmarks-result.txt
zig build sdk-benchmarks -Doptimize=ReleaseFast -Dbenchmark-output=benchmarks-result.txt
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: benchmarks-result
Expand Down
42 changes: 21 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This compiles the OpenTelemetry SDK as a static library in `zig-out/lib/`.
Unit tests are executed as part of CI pipeline, you can run them locally while developing:

```
zig build test
zig build sdk-test
```

#### Test options
Expand All @@ -47,28 +47,28 @@ The test build supports the following options:
To run only specific tests matching a pattern, use build args:

```
zig build test -- "counter"
zig build sdk-test -- "counter"
```

Example usage:

```
# Run tests with verbose output (shows test names and timing)
zig build test -Dtest-verbose=true
zig build sdk-test -Dtest-verbose=true

# Run specific tests with verbose output and stop on first failure
zig build test -Dtest-verbose=true -Dtest-fail-first=true -- "counter"
zig build sdk-test -Dtest-verbose=true -Dtest-fail-first=true -- "counter"

# Show captured logs for tests with warnings/errors
zig build test -Dtest-show-logs=true
zig build sdk-test -Dtest-show-logs=true
```

### Running integration tests

Integration tests verify the SDK behavior against real OpenTelemetry backends. These tests require Docker to be installed and running.

```
zig build integration
zig build sdk-integration
```

Integration tests are executed as part of CI on pull requests.
Expand All @@ -81,7 +81,7 @@ Integration tests are executed as part of CI on pull requests.
Build and run all examples:

```
zig build examples
zig build sdk-examples
```

#### Examples options
Expand All @@ -90,16 +90,16 @@ Filter examples to build and run specific ones:

```
# Run only examples matching "otlp"
zig build examples -Dexamples-filter=otlp
zig build sdk-examples -Dexamples-filter=otlp

# Run only histogram examples
zig build examples -Dexamples-filter=histogram
zig build sdk-examples -Dexamples-filter=histogram
```

Examples are organized by signal type:
- `examples/metrics/` - Metrics API examples
- `examples/trace/` - Tracing API examples
- `examples/logs/` - Logging API examples
- `opentelemetry-sdk/examples/metrics/` - Metrics API examples
- `opentelemetry-sdk/examples/trace/` - Tracing API examples
- `opentelemetry-sdk/examples/logs/` - Logging API examples

### Running benchmarks

Expand All @@ -108,7 +108,7 @@ Benchmarks are executed as part of the pipeline on Pull Requests if they contain
They can be executed locally with:

```
zig build benchmarks -Doptimize=ReleaseFast
zig build sdk-benchmarks -Doptimize=ReleaseFast
```

#### Benchmark options
Expand All @@ -122,13 +122,13 @@ To run only specific benchmarks matching a pattern, use build args:

```
# Run only counter benchmarks
zig build benchmarks -Doptimize=ReleaseFast -- "counter"
zig build sdk-benchmarks -Doptimize=ReleaseFast -- "counter"

# Run a specific benchmark and save results
zig build benchmarks -Doptimize=ReleaseFast -Dbenchmark-output="results.txt" -- "hist.record"
zig build sdk-benchmarks -Doptimize=ReleaseFast -Dbenchmark-output="results.txt" -- "hist.record"

# Run benchmarks in debug mode for profiling
zig build benchmarks -Dbenchmark-debug=true -- "counter"
zig build sdk-benchmarks -Dbenchmark-debug=true -- "counter"
```

> [!NOTE]
Expand All @@ -141,7 +141,7 @@ zig build benchmarks -Dbenchmark-debug=true -- "counter"
Generate API documentation:

```
zig build docs
zig build sdk-docs
```

Documentation will be generated in `zig-out/docs/` and can be viewed by opening `index.html` in a browser.
Expand All @@ -151,10 +151,10 @@ Documentation will be generated in `zig-out/docs/` and can be viewed by opening
A typical development workflow:

1. Make your changes
2. Run unit tests: `zig build test`
3. Run integration tests: `zig build integration` (if applicable)
4. Run relevant examples: `zig build examples -Dexamples-filter=<signal>`
5. Run benchmarks: `zig build benchmarks -Doptimize=ReleaseFast` (if performance-critical)
2. Run unit tests: `zig build sdk-test`
3. Run integration tests: `zig build sdk-integration` (if applicable)
4. Run relevant examples: `zig build sdk-examples -Dexamples-filter=<signal>`
5. Run benchmarks: `zig build sdk-benchmarks -Doptimize=ReleaseFast` (if performance-critical)
6. Commit your changes


Loading
Loading