One resource for every OpenTelemetry signal in signal-kit 0.3.0
On this page
I’ve released signal-kit 0.3.0, an observability library for Rust applications built on OpenTelemetry and tracing.
What started as an observability bug discovered in Evidia became a broader investigation into resource propagation, TLS configuration, graceful shutdown and the way we test observability libraries.
Several of the defects compiled without warnings, passed the existing checks and only became apparent when inspecting the telemetry received by a collector.
When telemetry arrives but observability fails
During an observability audit of Evidia, we discovered that application logs were reaching LokiLoki Grafana's log database. It indexes only the labels attached to a log stream, not every word in it, which keeps it cheap to run; the contents are searched when you query them. with valid trace and spanSpan One timed step in a trace, such as an HTTP request or a model call. Spans nest inside each other, so a trace shows where the time in a request went. identifiers, yet Grafana could not correlate them with traces in TempoTempo Grafana's trace database. A trace records the spans of one request through a system, and Tempo keeps them so a slow request can be followed step by step after the fact..
The logs were missing their OpenTelemetry resource attributesResource attributes The key-value pairs describing the entity a signal came from, such as service name, version and deployment environment. They ride on traces, logs and metrics alike, which is how a backend knows which service produced a record.. Loki identified their source as unknown_service instead of evidia-platform-server.
The cause was a custom log processor that wrapped OpenTelemetry’s BatchLogProcessor without forwarding the set_resource() method. The trait provided a default implementation that did nothing, so the compiler had no reason to complain.
The backwards-compatible fix shipped in signal-kit 0.2.3. Further investigation revealed another inconsistency. Metrics did not inherit the custom resource attributes supplied through the observability builder.
These problems prompted a change to how signal-kit constructs its OpenTelemetry providers.
One resource, three signals
Previously, the trace, log and metric providers constructed their resources separately. Each implementation had to propagate the service identity and custom attributes correctly.
In signal-kit 0.3.0, the observability builder constructs one OpenTelemetry Resource and shares it across all three providers.
Every signal now receives consistent resource attributes, including:
service.nameservice.versionservice.namespaceservice.instance.iddeployment.environment.name- Custom application attributes
Resource attributes remain resource attributes. Signal-kit does not automatically duplicate them as individual metric instrument attributes, which avoids unnecessary metric cardinalityCardinality The number of distinct label combinations a metric series can take. Every new combination costs memory and query time, so a per-request attribute such as a user id on a metric is a classic way to blow a time-series database up..
The benefit is that a single configuration now determines the identity of an application across its traces, logs and metrics.
OpenTelemetry 0.33
This release upgrades the OpenTelemetry dependencies from 0.31 to 0.33, alongside tracing-opentelemetry 0.34 and updates to the supporting dependencies.
The newer OpenTelemetry SDK also allowed us to remove the custom log processor that caused the original resource propagation defect. The upstream implementation now provides the required shutdown and resource handling behaviour.
There is a breaking change for applications that interact directly with OpenTelemetry types. Consumers passing KeyValue instances to signal-kit or using its metrics initialisation callbacks must align their OpenTelemetry dependency versions.
The migration guide documents these changes.
Cargo features need to work together
One of the more interesting discoveries concerned TLS.
The dependency upgrade introduced a conflict between two cryptographic providers, ring and aws-lc-rs. Individually, the relevant Cargo feature combinations compiled and worked. Enabling them together could cause a panic during TLS initialisation.
Signal-kit now consistently selects ring across its TLS configurations.
The release also explicitly configures the root certificate stores for gRPCgRPC A remote-call protocol built on HTTP/2 and protobuf. OpenTelemetry uses it to stream traces, metrics and logs to a collector.. For HTTP exports using reqwest, certificate verification now uses the operating system’s trust storeTrust store The set of root certificates an operating system ships and its users trust. A TLS client verifies a server's certificate against it; a container image with no trust store has nothing to verify against. instead of bundled Mozilla root certificates.
Applications using the former reqwest-rustls-webpki-roots feature should migrate to reqwest-rustls. Minimal container images must also have the appropriate trusted certificates installed.
Invalid configurations should fail at startup
Another defect involved the blocking reqwest HTTP client.
When configured as the only HTTP client, it could panic inside the asynchronous export runtime and stop telemetry export. The application itself could continue running without exporting telemetry.
Signal-kit now rejects this configuration during initialisation. It also rejects HTTP transportOTLP OpenTelemetry Protocol, the wire format for shipping traces, metrics and logs to a collector. It runs over gRPC or HTTP, with protobuf or JSON payloads. configurations that lack a compatible HTTP client.
I would rather have an application report an invalid observability configuration at startup than discover several hours later that none of its telemetry reached the collector.
Testing what the collector receives
The most important improvement in this release might be the testing strategy.
A successful compilation cannot establish that an OpenTelemetry exporter sends the correct resource attributes, preserves trace correlation or flushes its remaining records during shutdown.
Signal-kit now runs integration tests against collectors created by the tests themselves. The tests decode the exported OpenTelemetry payloads and inspect their contents.
The continuous integration workflow runs these tests across 11 Cargo feature configurations, covering:
- Default, minimal and all-feature builds
- gRPC and HTTP transports
- JSON and protobuf payloads
- TLS connections and certificate verification
- Individual and combined HTTP clients
- Invalid transport configurations
- Resource propagation and trace correlation
- Graceful shutdown and host metrics
These tests run on every pull request. Future dependency upgrades must pass runtime verification, rather than compilation alone.
Verifiable releases
The release pipeline also received a correction to its supply chain automation.
Each release now automatically publishes a set of verifiable artefacts:
- The packaged Rust crate
- CycloneDX software bills of materials for default and all-feature configurations
- SHA-256 checksums
- Build provenance and SBOM attestations
For version 0.3.0, the published crate’s checksum matches the checksum crates.io reports for the same version, and the build-provenance and SBOM attestations attached to the GitHub release verify with gh attestation verify.
Users can verify the origin and integrity of the package independently.
Try signal-kit 0.3.0
Install the latest release using Cargo:
cargo add signal-kit@0.3.0 If you are migrating an existing application, consult the migration guide for dependency compatibility, TLS behaviour and changes to host metrics.
The next step for Evidia is to adopt this release and verify its telemetry across the deployed application and Grafana stack.