Repository navigation
feat(policies): name the OTLP policy scope attribute pktvisor.policy.name - #814
leoparente wants to merge 2 commits into
Conversation
Each policy's OTLP instrumentation scope now carries its name under orb.policy.name, following OpenTelemetry attribute naming, instead of policy_name. The scope name (pktvisor/<policy>), the attribute value, the datapoint labels and the Prometheus output are unchanged. The orb-agent OTLP bridge reads orb.policy.name and falls back to policy_name, so agents keep attributing series from older pktvisor builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
|
/ai-review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
AI Code Review — risk tier: Advisory only. A human owns the merge decision. Summary — Straightforward rename of the OTLP policy scope attribute key from 🤖 AI Code Review · run · prompts: |
|
AI Code Review — risk tier: Advisory only. A human owns the merge decision. Summary — Clean, net-positive change: renames the OTLP metric attribute key from No findings. 🤖 AI Code Review · run · prompts: Previous review · 2026-11-16 · 7299703AI Code Review — risk tier: Advisory only. A human owns the merge decision. Summary — Net-positive, trivial rename of the OTLP policy scope attribute key from 🤖 AI Code Review · run · prompts: |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
LCOV of commit
|
pktvisor is used outside orb-agent, so the scope attribute takes the project's own namespace, pktvisor.policy.name, rather than orb's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI Code Review updated for |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
pktvisor tags each policy's OTLP instrumentation scope with the policy name, which the orb-agent OTLP bridge reads to attribute the series. The attribute key moves from
policy_nametopktvisor.policy.name, following the OpenTelemetry naming conventions: dot-delimited namespaces, and the application's own namespace for custom attributes. pktvisor is used outside orb-agent, so it takes its own namespace rather than orb's.Merge after the orb-agent bridge change, netboxlabs/orb-agent#814, which reads
pktvisor.policy.nameand falls back topolicy_name. The orb-agent image takes pktvisor'sdevelop-alpineat build time, so a pktvisor with the new key under a bridge that only knowspolicy_namewould leave pktvisor's series unattributed.Change
PolicyManager::opentelemetry_metricssets the scope attribute key topktvisor.policy.name.pktvisor/<policy>), the value, the datapoint labels and the Prometheus output are unchanged.Test
"OpenTelemetry push tags each policy's scope with pktvisor.policy.name" (
src/tests/test_policies.cpp) loads two policies, closes a window on each, and checks that each scope:pktvisor/<policy>;pktvisor.policy.name=<policy>;policy_name.On the previous key, the key assertion fails for both policies.
Verification
ctest on macOS: 24/25.
unit-tests-input-netprobefails the same way on develop on this machine and passes in CI.🤖 Generated with Claude Code