Wire resource attributes into Beholder ChipIngress emitters#2216
Conversation
✅ API Diff Results -
|
e6eabcc to
fdb6dee
Compare
✅ API Diff Results -
|
606a264 to
ada7f9b
Compare
| gopkg.in/yaml.v2 v2.4.0 // indirect | ||
| ) | ||
|
|
||
| replace github.com/smartcontractkit/chainlink-common/pkg/chipingress => ./pkg/chipingress |
There was a problem hiding this comment.
any way to avoid the local replace?
There was a problem hiding this comment.
For sure, will clean this up.
aa6b73c to
d6a531b
Compare
|
overall approach lgtm. Adding the CloudEvent extensions as the guaranteed propagation path makes sense, and we're keeping the gRPC header route for observability is reasonable |
2a6fa46 to
3ebb388
Compare
Pick up chip-ingress resource attribute propagation from smartcontractkit/chainlink-common#2216. Co-authored-by: Cursor <cursoragent@cursor.com>
e7e82a2 to
1f79a15
Compare
Pick up chip-ingress resource attribute propagation from smartcontractkit/chainlink-common#2216. Co-authored-by: Cursor <cursoragent@cursor.com>
Pick up chip-ingress resource attribute propagation from smartcontractkit/chainlink-common#2216. Co-authored-by: Cursor <cursoragent@cursor.com>
1f79a15 to
e1e0648
Compare
Pick up chip-ingress resource attribute propagation from smartcontractkit/chainlink-common#2216.
f5eda78 to
0a22a31
Compare
Pick up chip-ingress resource attribute propagation from smartcontractkit/chainlink-common#2216.
Pick up chip-ingress resource attribute propagation from smartcontractkit/chainlink-common#2216.
|
Split into two PRs:
|
327f9ca to
fccea7a
Compare
Pick up chip-ingress resource attribute propagation from smartcontractkit/chainlink-common#2216.
There was a problem hiding this comment.
Pull request overview
Wires beholder.Config.ResourceAttributes into ChipIngress emitters so node resource attributes propagate to the cre topic (via CloudEvent extensions, and as gRPC metadata headers on the client).
Changes:
- Add
resourceAttributesToStringMaphelper to canonicalize OTel resource attributes intomap[string]string. - Stamp resource attributes onto ChipIngress events for both sync and batch emitters via
chipingress.WithResourceAttributeExtensions. - Pass resource attributes into the ChipIngress client as a static header provider (sanitized for gRPC metadata), and bump
pkg/chipingressto the needed pseudo-version.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/beholder/resource_attributes.go | Adds helper to convert OTel resource attributes to string map. |
| pkg/beholder/resource_attributes_test.go | Tests conversion/encoding behavior for several attribute types. |
| pkg/beholder/client.go | Plumbs resource attributes into ChipIngress client headers and emitter construction. |
| pkg/beholder/chip_ingress_emitter.go | Adds emitter support for stamping resource attributes as CE extensions. |
| pkg/beholder/chip_ingress_emitter_test.go | Verifies CE extension stamping + backward-compat behavior when unset. |
| pkg/beholder/batch_emitter_service.go | Stores resource attributes and stamps them on each batched event. |
| pkg/beholder/batch_emitter_service_test.go | Adds coverage asserting resource attributes appear in emitted batches. |
| go.mod | Bumps github.com/smartcontractkit/chainlink-common/pkg/chipingress version. |
| go.sum | Updates sums for the bumped pkg/chipingress dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var resourceAttrs *resourceAttrExtensions | ||
| if len(attrs) > 0 { | ||
| resourceAttrs = &resourceAttrExtensions{attrs: attrs} | ||
| } |
Summary
Wire node resource attributes from
beholder.Config.ResourceAttributesinto the ChipIngress batch and sync emitters via CloudEvent extensions, so they reach thecretopic asce_<sanitized>Kafka headers.Changes
pkg/beholder/batch_emitter_service.go: store resource attributes and stamp them on each emitted event viachipingress.WithResourceAttributeExtensions.pkg/beholder/chip_ingress_emitter.go: same for the sync emitter.pkg/beholder/client.go: pass resource attributes into the ChipIngress client header provider.pkg/beholder/resource_attributes.go: addresourceAttributesToStringMaphelper.go.mod: bumppkg/chipingressto the resource-attributes branch (Add resource attribute support to ChipIngress client #2267).Related PRs
Test plan
go test ./pkg/beholder/...Notes
Co-authored-by: Cursorattribution has been removed from the commit history.ce_<name>headers immediately.pkg/durableemitterremains out of scope.