Skip to content

feat(stg): Add OTel Pod CONSUMES PersistentVolumeClaim relationship - #3349

Merged
vlopeziglesias merged 3 commits into
newrelic:mainfrom
codylawson:otel-pod-pvc-relationship-stg
Nov 6, 2026
Merged

vlopeziglesias merged 3 commits into
newrelic:mainfrom
codylawson:otel-pod-pvc-relationship-stg

Conversation

@codylawson

@codylawson codylawson commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Relevant information

Adds the missing OpenTelemetry Pod → PersistentVolumeClaim relationship, as a staging-only override (.stg.yml). Today only the Kubernetes Integration rule (keyed on K8sVolumeSample) exists, so OTel PVCs have no pod edge.

New rule: otelKsmK8sPodConsumesPersistentVolumeClaim

  • Trigger: kube-state-metrics kube_pod_spec_volumes_persistentvolumeclaims_info (pod-centric, one row per pod per PVC volume).
  • Source: Pod, extractGuid from entity.guid.
  • Target: PVC, buildGuid from {k8s.cluster.name}:{k8s.namespace.name}:{k8s.pvc.name}, FARM_HASH, account: lookup: true. This matches the PVC entity's compositeIdentifier and the other OTel rules (e.g. otelKsmK8sPersistentVolumeManagesPersistentVolumeClaim).
  • Relationship type CONSUMES, same as the Kubernetes Integration rule, which is carried over unchanged.

Verified on staging (account 10885357, cluster otel-dev): the metric is emitted with the Pod entity.guid on every row, and carries k8s.cluster.name, k8s.namespace.name, k8s.pod.name and k8s.pvc.name. A matching PVC entity exists for each pair, and e.g. working-pvc currently has only the PV→PVC edge and no pod edge.

Not yet verified: that the built PVC GUID resolves to the real PVC entity. I couldn't reproduce the hash offline. After this deploys to staging, otel-dev:detector-tests:working-pvc should gain a CONSUMES edge from working-pvc-pod.

Not promoting to production: PR #3158 is held for performance concerns, and this adds one lookup per pod per PVC per scrape.

Api Review Board (ARB)

Staging-only relationship change; no entity type or identifier changes.

ARB Jira ticket:
https://new-relic.atlassian.net/browse/NR-XXXX

Checklist

  • I've read the guidelines and understand the acceptance criteria.
  • The value of the attribute marked as identifier will be unique and valid.
  • I've confirmed that my entity type wasn't already defined. If it is I'm providing an explanation above.
  • I've linked an ARB ticket & received approval from API Review Board in order to make these changes

🤖 Generated with Claude Code

Add otelKsmK8sPodConsumesPersistentVolumeClaim to a staging override of the
Pod-to-PVC relationship file. It keys on the kube-state-metrics
kube_pod_spec_volumes_persistentvolumeclaims_info metric, which is
pod-centric: entity.guid is the Pod, and k8s.pvc.name, k8s.namespace.name and
k8s.cluster.name identify the PVC. The Pod is extracted from entity.guid and
the PVC GUID is built from cluster:namespace:pvc, matching the PVC entity's
compositeIdentifier. The existing Kubernetes Integration rule is carried over
unchanged.

Add a kube_pod_spec_volumes_persistentvolumeclaims_info row to the Pod OTel
test fixture.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
entityBot
entityBot previously approved these changes Nov 5, 2026

@entityBot entityBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't think these changes require an API Review Board (ARB) review, so it is not required to merge this PR. Note that all API changes do require one: if you believe this PR needs an ARB review, please create the ticket and add the ARB:pending label. Reach #api-review-board in case of doubts.

@entityBot
entityBot requested a review from a team November 5, 2026 17:26
The fixture only exercises Pod entity synthesis, which already matches any
kube_pod_* metric. It is not needed for the relationship rule.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
entityBot
entityBot previously approved these changes Nov 5, 2026

@entityBot entityBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't think these changes require an API Review Board (ARB) review, so it is not required to merge this PR. Note that all API changes do require one: if you believe this PR needs an ARB review, please create the ticket and add the ARB:pending label. Reach #api-review-board in case of doubts.

@entityBot
entityBot requested review from a team and removed request for a team November 5, 2026 17:32
Add present: true conditions for k8s.namespace.name and k8s.cluster.name,
which the target PVC GUID is built from, so the rule never builds a partial
identifier.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@entityBot entityBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't think these changes require an API Review Board (ARB) review, so it is not required to merge this PR. Note that all API changes do require one: if you believe this PR needs an ARB review, please create the ticket and add the ARB:pending label. Reach #api-review-board in case of doubts.

@vlopeziglesias
vlopeziglesias merged commit eae7700 into newrelic:main Nov 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants