swarm-review-classifier: test that Otel::record exports the run's cost
Nothing exercised the real record path: the acp tests use a mock sink and the cost tests only covered amount(). Split the counter construction and the add out of Otel::record so a test can run them against an in-memory exporter, and assert the counter name, the amount and the four labels. Dev-dependency: opentelemetry_sdk's `testing` feature (same crate; adds tokio to its lockfile entry).
This commit is contained in:
parent
1b4e764e5c
commit
2c6ae15383
3 changed files with 83 additions and 13 deletions
|
|
@ -33,6 +33,8 @@ tracing.workspace = true
|
|||
|
||||
[dev-dependencies]
|
||||
tempfile = "3"
|
||||
# `InMemoryMetricExporter` for the cost counter test.
|
||||
opentelemetry_sdk = { workspace = true, features = ["testing"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
|||
Loading…
Reference in a new issue