Skip to content

PVC-backed volumes are not collected when using k8s.volume.type #45510

@foxracle

Description

@foxracle

Component(s)

receiver/kubeletstats

What happened?

Description

After enabling the k8s.volume.type configuration in the kubeletstats receiver, volume information is collected for configMap, secret, and emptyDir volumes, but PVC-backed volumes are missing.

Steps to Reproduce

Expected Result

k8s.volume.type: Str(PersistentVolumeClaim)

Actual Result

Resource attributes:
-> k8s.pod.uid: Str(ad4d0463-d992-448c-a66e-4a0a9b3ea37c)
-> k8s.pod.name: Str(otel-agent-collector-5rlq7)
-> k8s.namespace.name: Str(opentelemetry)
-> k8s.volume.name: Str(otc-internal)
-> k8s.volume.type: Str(configMap)
-> k8s.cluster.name: Str(aks-cillium-metrics-cluster)
-> host.name: Str(otel-agent-collector-5rlq7)

Collector version

0.140.1

Environment information

Environment

We have verified this behavior on both Gardener-managed Kubernetes clusters and AKS clusters, and PVC-backed volume information is missing in both cases.

The collector is granted get permissions on nodes/stats, nodes/proxy, and nodes/metrics resources in the core API group.

OpenTelemetry Collector configuration

apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
  name: otel-agent
  namespace: opentelemetry
spec:
  mode: daemonset
  serviceAccount: otel-agent
  hostNetwork: false

  resources:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      cpu: 500m
      memory: 512Mi

  env:
    - name: GOMEMLIMIT
      value: "410MiB"
    - name: K8S_NODE_NAME
      valueFrom:
        fieldRef:
          fieldPath: spec.nodeName

  config:
      kubeletstats:
        collection_interval: 20s
        auth_type: "serviceAccount"
        endpoint: "https://${env:K8S_NODE_NAME}:10250"
        node: '${env:K8S_NODE_NAME}'
        insecure_skip_verify: true
        extra_metadata_labels:
          - k8s.volume.type
        k8s_api_config:
          auth_type: serviceAccount
        metric_groups: [node, pod, container, volume]
        metrics:
          k8s.pod.volume.usage:
            enabled: true


    processors:
      memory_limiter:
        check_interval: 1s
        limit_percentage: 85
        spike_limit_percentage: 15

      resourcedetection:
        detectors: [env, system, eks, aks, ec2, azure, gcp] 
        timeout: 2s
        override: false

      resource/cluster_id:
        attributes:
          - key: k8s.cluster.name
            value: "aks-cillium-metrics-cluster"
            action: upsert

      batch:
        send_batch_size: 10000
        send_batch_max_size: 10000
        timeout: 5s

    exporters:
      debug:
        verbosity: detailed
      otlphttp:
        endpoint: https://xxx.com

    service:
      pipelines:
        metrics:
          receivers: [kubeletstats]
          processors: [memory_limiter, resource/cluster_id, resourcedetection, batch]
          exporters: [otlphttp, debug]

Log output

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions