Skip to content

feat(resume-build): add optional telemetry/tracing support#2345

Merged
arkamar merged 5 commits intomainfrom
feat/resume-build-telemetry
Apr 14, 2026
Merged

feat(resume-build): add optional telemetry/tracing support#2345
arkamar merged 5 commits intomainfrom
feat/resume-build-telemetry

Conversation

@arkamar
Copy link
Copy Markdown
Contributor

@arkamar arkamar commented Apr 9, 2026

Wire telemetry.New() into resume-build so traces and metrics are exported when OTEL_COLLECTOR_GRPC_ENDPOINT is set. When unset, behavior is unchanged (noop client, zero overhead).


This is useful for sandbox debugging.

Wire telemetry.New() into resume-build so traces and metrics are
exported when OTEL_COLLECTOR_GRPC_ENDPOINT is set. When unset,
behavior is unchanged (noop client, zero overhead).
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 9, 2026

PR Summary

Low Risk
Low risk because telemetry is only activated when OTEL_COLLECTOR_GRPC_ENDPOINT is set; otherwise it uses a noop client. Main risk is added startup/shutdown paths that could fail or slightly impact performance when exporting metrics/traces.

Overview
resume-build now initializes a telemetry client and uses its MeterProvider for TCP firewall and block metrics instrumentation, exporting metrics/traces/logs when OTEL_COLLECTOR_GRPC_ENDPOINT is set and shutting telemetry down on exit. The shared telemetry package adds NewAnonymous to simplify creating a client for CLIs/tools by auto-filling resource metadata (hostname, generated instance ID, and default commit/version).

Reviewed by Cursor Bugbot for commit c418c9a. Bugbot is set up for automated code reviews on this repo. Configure here.

@arkamar arkamar marked this pull request as ready for review April 9, 2026 20:45
…l pointer panic

With a real OTEL provider, instrument registration can fail, leaving
the Metrics struct with nil fields that cause panics on first use.
Matches the pattern in the production orchestrator.
@sitole sitole self-requested a review April 10, 2026 08:07
arkamar added 2 commits April 14, 2026 12:23
…ew()

Move the env var documentation from the resume-build call site to
the telemetry.New() function definition where it belongs.
…metadata

Add telemetry.NewAnonymous(ctx, serviceName) for CLI tools that lack
build-time injected values. Uses hostname as nodeID and sensible
defaults for the rest. Update resume-build to use it.
@arkamar arkamar requested a review from sitole April 14, 2026 10:43
@arkamar arkamar merged commit d99e630 into main Apr 14, 2026
45 checks passed
@arkamar arkamar deleted the feat/resume-build-telemetry branch April 14, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants