Skip to content

Commit

Permalink
Merge pull request #136 from lquerel/example-codegen-semconv-rust
Browse files Browse the repository at this point in the history
[WIP] Code Generation with Weaver - Example of Code Generation for SemConv Attribute Registry and SemConv Metrics
  • Loading branch information
lquerel authored May 8, 2024
2 parents d9f1838 + dd0dc61 commit f4e1ff5
Show file tree
Hide file tree
Showing 40 changed files with 2,700 additions and 98 deletions.
3 changes: 2 additions & 1 deletion .github/codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ coverage:

ignore:
- "crates/xtask" # Part of the build system
- "src" # CLI (not tested yet)
- "src" # CLI (not tested yet)
- "crates/weaver_forge/codegen_examples/expected_codegen" # Generated code
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ jobs:
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Gather coverage
run: cargo tarpaulin --workspace --output-dir coverage --out lcov -e xtask -e weaver
run: cargo tarpaulin --workspace --output-dir coverage --out lcov -e xtask -e weaver --exclude-files 'crates/weaver_forge/codegen_examples/expected_codegen/*'
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
Expand Down
164 changes: 133 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ categories = ["command-line-utilities"]
license = "Apache-2.0"
readme = "README.md"
publish = false
resolver = "2"

# Workspace definition ========================================================
[workspace]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![build](https://github.com/open-telemetry/weaver/actions/workflows/audit.yml/badge.svg)](https://github.com/open-telemetry/weaver/actions/workflows/audit.yml)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
----
(CONTRIBUTING.md) | [Links](#links) |

[Getting started](#getting-started) | [Main commands](#main-commands) | [Generate Doc & Code](crates/weaver_forge/README.md) | [Architecture](docs/architecture.md) | [Change log](CHANGELOG.md) | [Contributing](CONTRIBUTING.md) | [Links](#links) |

## What is OpenTelemetry Weaver?
Expand Down
23 changes: 23 additions & 0 deletions crates/weaver_codegen_test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "weaver_codegen_test"
version = "0.1.0"
authors.workspace = true
repository.workspace = true
license.workspace = true
publish.workspace = true
edition.workspace = true
rust-version.workspace = true

[lints]
workspace = true

[build-dependencies]
weaver_common = { path = "../weaver_common" }
weaver_cache = { path = "../weaver_cache" }
weaver_forge = { path = "../weaver_forge" }
weaver_resolver = { path = "../weaver_resolver" }
weaver_semconv = { path = "../weaver_semconv" }
walkdir.workspace = true

[dependencies]
opentelemetry = { version = "0.22.0", features = ["trace", "metrics", "logs", "otel_unstable"] }
7 changes: 7 additions & 0 deletions crates/weaver_codegen_test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Weaver CodeGen Test

This crate is used to test the generation of an unofficial Rust OpenTelemetry Client API derived from a semantic
convention registry. This crate is not intended to be published. It is used solely for testing and validation purposes.

The generated Rust API client exposes a type-safe API (i.e., one that cannot be misused) that adheres to the signal
specification defined in the semantic convention registry located in the semconv_registry directory.
Loading

0 comments on commit f4e1ff5

Please sign in to comment.