Repository navigation
durableemitter: add tracing spans and chip ingress client name - #2432
Merged
Merged
Conversation
Contributor
✅ API Diff Results -
|
Contributor
✅ API Diff Results -
|
pkcll
force-pushed
the
durable-emitter-tracing
branch
from
October 1, 2026 03:33
ccd2a62 to
ecb2287
Compare
Emit, delivery (linked to the emit span), retransmit tick and expiry tick now create otel spans via Config/SetupConfig.TracerProvider (global provider when nil). Setup passes the provider and client name durable_emitter to the chip ingress client. Temporarily pins pkg/chipingress to the chipingress-client-name branch; bump to the released version once that PR merges.
pkcll
force-pushed
the
durable-emitter-tracing
branch
from
October 1, 2026 03:39
ecb2287 to
30e9037
Compare
2 of 3 tasks
…nd errors, tidy go.mod The deliver span now uses the originating span as its remote parent so sampling follows the emit span (it stays linked too). Expiry and retransmit failures set error status on their tick spans. Adds tests for expiry_tick, the retransmit-phase deliver link, background error status and the nil tracer provider default, drops the stale go.sum lines flagged by check-tidy, and re-pins pkg/chipingress to the updated chipingress-client-name branch.
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.
| Benchmark suite | Current: ee21d71 | Previous: ccd2a62 | Ratio |
|---|---|---|---|
BenchmarkKeystore_Sign/nop/in-process |
738.7 ns/op |
274.9 ns/op |
2.69 |
This comment was automatically generated by workflow using github-action-benchmark.
1 of 2 tasks
Replaces the dev-branch pin now that chipingress-client-name is merged (dbc6c22). Bump to a tagged release once pkg/chipingress is released.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The retransmit tracing test has a race and does not verify that the tick span is the actual parent and link.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds OpenTelemetry tracing and client identification to the durable emitter.
Changes:
- Instruments emit, delivery, retransmission, and expiry operations.
- Propagates tracer-provider and client-name configuration.
- Adds tracing tests and updates the chip-ingress dependency.
| File | Description |
|---|---|
pkg/durableemitter/durable_emitter.go |
Implements tracing spans and error recording. |
pkg/durableemitter/setup.go |
Configures tracing and client identity. |
pkg/durableemitter/tracing_test.go |
Tests tracing behavior and relationships. |
go.mod |
Updates chip-ingress dependency. |
go.sum |
Updates dependency checksums. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+132
to
+135
| require.Len(t, retransmit.Links(), 1) | ||
| assert.Equal(t, retransmit.Links()[0].SpanContext.SpanID(), retransmit.Parent().SpanID()) | ||
| tick := endedSpan(rec, spanRetransmitTick) | ||
| require.NotNil(t, tick) |
retransmit_tick is started only when rows are pending (a ListPending failure still records an error span). expiry_tick is recorded after the pass, back-dated to its start, only when rows were purged or an error occurred. Idle ticks previously produced a root span every interval on every node.
jmank88
reviewed
Oct 2, 2026
Start the span when the expiry pass begins and set the purged count and error status when it ends, instead of recording a back-dated span afterwards. DB calls in the pass are now children of the span. Idle expiry passes (once per ExpiryInterval) are traced again; idle retransmit ticks still are not.
jmank88
approved these changes
Oct 2, 2026
jmank88
enabled auto-merge
October 2, 2026 21:16
patrickhuie19
approved these changes
Oct 2, 2026
jmank88
approved these changes
Oct 2, 2026
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.

Summary
durable_emitter.emit,durable_emitter.deliver(remote-parented on and linked to the emit/retransmit span, since delivery runs on the batcher goroutine, so sampling follows the emit span),durable_emitter.retransmit_tick,durable_emitter.expiry_tick. Idleretransmit_tickpasses are not traced;expiry_tickis traced once per pass (see Span behavior).Config.TracerProvider/SetupConfig.TracerProvider(nil uses the global provider);Setuppasses it to the chip ingress client so gRPC spans use the same provider.Setuppasseschipingress.WithClientName("durable_emitter")(the existingbatch.ClientNameDurableEmitter), so chip-ingress and the gRPC spans/metrics can identify the emitter.PR stack (merge in this order)
Jira: INFOPLAT-19423
Span behavior
durable_emitter.emit: one perEmitcall (child of the caller ctx). Attributes:source_domain,entity_type. Error status on failure.durable_emitter.deliver: one per delivered or failed event, started when the batch callback fires. Attribute:phase(batch or retransmit). Error status when the publish failed.durable_emitter.retransmit_tick: started only whenListPendingreturns rows, with apendingcount. AListPendingfailure still produces an error span. Idle ticks (the host loop runs every 1s) produce no span.durable_emitter.expiry_tick: one per expiry pass (everyExpiryInterval, 1m by default), started when the pass begins. Attribute:purgedcount, set when the pass ends. Error status on failure.Depends on
chipingress.WithClientName) is merged.go.modpinspkg/chipingressto themainpseudo-versionv0.0.11-0.20261002004536-dbc6c2240029(commit dbc6c22). No release tag is needed for this PR.Notes
Test plan
go test -race ./pkg/durableemitter/(span tests intracing_test.go: emit/deliver parent and link, deliver failure status, retransmit-phase link, expiry tick, background error status, idle retransmit ticks produce no spans, nil provider default; tracing tests stress-run under-race)go build ./pkg/...,go vet,go mod tidy -diffcleango-test-resultsartifact; CI-owner fix)