feat: add otel resource and instrumentation scope attributes to traces#498
Merged
svencowart merged 2 commits intomainfrom Mar 2, 2026
Merged
feat: add otel resource and instrumentation scope attributes to traces#498svencowart merged 2 commits intomainfrom
svencowart merged 2 commits intomainfrom
Conversation
- introduce otlp/resource module with detect_resource() that collects host.name, host.id, telemetry.distro.*, k8s.node.uid, k8s.node.name, k8s.cluster.uid, and k8s.namespace.name at startup - resolve host.name with priority: k8s internaldns > getaddrinfo ai_canonname > k8s hostname > gethostname() fallback - cache sdktracer with instrumentation scope set to mermin version, removing per-export provider.tracer() call - fix metrics_exporter not delegating set_resource to inner exporter, causing resource attributes to never appear in exported spans - refactor metrics_exporter export to async fn, removing unsafe transmute against a 'static bound that does not exist on the trait - bump mermin/cargo.toml version in release ci pipeline via sed - update local k8s dev docs to use colima k3s with a local docker registry
877c0e0 to
d3b166a
Compare
- collect internalip addresses from k8s node api (all addresses of type "InternalIP" from node.status.addresses) - fall back to host_interface_ips() via nix getifaddrs when k8s is unavailable, filtering loopback, point-to-point, and link-local - emit host.ip as an otel array(string) value per semantic conventions - extend get_k8s_node return type to (uid, host, ips) tuple - enable nix "net" feature for ifaddrs support
Merged
svencowart
added a commit
that referenced
this pull request
Mar 2, 2026
# Description Release the v0.3.0 version # Changelog ## [v0.3.0] - 2026-03-02 ### Features - Add otel resource and instrumentation scope attributes to traces (#498) [v0.2.1..v0.3.0](v0.2.1...v0.3.0) Co-authored-by: svencowart <8366524+svencowart@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
"InternalIP" from node.status.addresses) with fall back to host_interface_ips() via nix getifaddrs when k8s is unavailable, filtering loopback, point-to-point, and link-local
Fixes #481
Type of change
Testing
Deployed on k8s and without k8s environment and verified the results.
Proof it works
Output without k8s cluster:
Output within k8s cluster: