Skip to content

[BUG] custom_resource doesn't work #37500

Open
@AndMerlin

Description

@AndMerlin

Agent Environment

Agent version: 7.65.2

**Config ***

apiVersion: v1
data:
  kubernetes_apiserver.yaml: |-
    init_config:
    instances:
      -
        filtering_enabled: false
        unbundle_events: false
  kubernetes_state_core.yaml.default: |-
    init_config:
    instances:
      - collectors:
        - secrets
        - configmaps
        - customresourcedefinitions
        - nodes
        - pods
        - services
        - resourcequotas
        - replicationcontrollers
        - limitranges
        - persistentvolumeclaims
        - persistentvolumes
        - namespaces
        - endpoints
        - daemonsets
        - deployments
        - replicasets
        - statefulsets
        - cronjobs
        - jobs
        - horizontalpodautoscalers
        - poddisruptionbudgets
        - storageclasses
        - volumeattachments
        - ingresses
        labels_as_tags:
          {}
        annotations_as_tags:
          {}
        custom_resource:
          spec:
            resources:
              - commonLabels:
                  crd_type: eniconfig
                groupVersionKind:
                  group: crd.k8s.amazonaws.com
                  kind: ENIConfig
                  version: v1alpha1
                labelsFromPath:
                  crd_name:
                  - metadata
                  - name
                metrics:
                - each:
                    gauge:
                      path:
                      - metadata
                      - generation
                    type: gauge
                  help: ENI Config
                  name: eniconfig
              - groupVersionKind:
                  group: cilium.io
                  kind: CiliumEndpoint
                  version: v2
                metrics:
                - each:
                    info:
                      labelsFromPath:
                        name:
                        - metadata
                        - name
                    type: Info
                  help: The test
                  labelsFromPath:
                    id:
                    - status
                    - id
                  name: test_info
              - groupVersionKind:
                  group: kustomize.toolkit.fluxcd.io
                  kind: Kustomization
                  version: v1
                metricNamePrefix: gotk
                metrics:
                - each:
                    info:
                      labelsFromPath:
                        name:
                        - metadata
                        - name
                    type: Info
                  help: The current state of a Flux Kustomization resource.
                  labelsFromPath:
                    exported_namespace:
                    - metadata
                    - namespace
                    ready:
                    - status
                    - conditions
                    - '[type=Ready]'
                    - status
                    revision:
                    - status
                    - lastAppliedRevision
                    source_name:
                    - spec
                    - sourceRef
                    - name
                    suspended:
                    - spec
                    - suspend
                  name: resource_info
              - groupVersionKind:
                  group: helm.toolkit.fluxcd.io
                  kind: HelmRelease
                  version: v2
                metricNamePrefix: gotk
                metrics:
                - each:
                    info:
                      labelsFromPath:
                        name:
                        - metadata
                        - name
                    type: Info
                  help: The current state of a Flux HelmRelease resource.
                  labelsFromPath:
                    chart_app_version:
                    - status
                    - history
                    - "0"
                    - appVersion
                    chart_name:
                    - status
                    - history
                    - "0"
                    - chartName
                    chart_ref_name:
                    - spec
                    - chartRef
                    - name
                    chart_source_name:
                    - spec
                    - chart
                    - spec
                    - sourceRef
                    - name
                    exported_namespace:
                    - metadata
                    - namespace
                    ready:
                    - status
                    - conditions
                    - '[type=Ready]'
                    - status
                    revision:
                    - status
                    - history
                    - "0"
                    - chartVersion
                    suspended:
                    - spec
                    - suspend
                  name: resource_info
                - each:
                    info:
                      labelsFromPath:
                        app_version:
                        - status
                        - history
                        - "0"
                        - appVersion
                        chart_version:
                        - status
                        - history
                        - "0"
                        - chartVersion
                    type: Info
                  help: The version information of helm release resource.
                  labelsFromPath:
                    chart_name:
                    - spec
                    - chart
                    - spec
                    - chart
                    exported_namespace:
                    - metadata
                    - namespace
                    name:
                    - metadata
                    - name
                  name: helmrelease_version_info
              - groupVersionKind:
                  group: source.toolkit.fluxcd.io
                  kind: HelmChart
                  version: v1
                metricNamePrefix: gotk
                metrics:
                - each:
                    info:
                      labelsFromPath:
                        name:
                        - metadata
                        - name
                    type: Info
                  help: The current state of a Flux HelmChart resource.
                  labelsFromPath:
                    chart_name:
                    - spec
                    - chart
                    chart_version:
                    - spec
                    - version
                    exported_namespace:
                    - metadata
                    - namespace
                    ready:
                    - status
                    - conditions
                    - '[type=Ready]'
                    - status
                    revision:
                    - status
                    - artifact
                    - revision
                    suspended:
                    - spec
                    - suspend
                  name: resource_info
  orchestrator.yaml: "init_config:\ninstances: \n  - crd_collectors:\n      - helm.toolkit.fluxcd.io/v2/helmreleases\n
    \     - kustomize.toolkit.fluxcd.io/v1beta2/kustomizations\n      - kustomize.toolkit.fluxcd.io/v1/kustomizations"
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: datadog
    meta.helm.sh/release-namespace: datadog
  creationTimestamp: "2023-12-06T18:35:01Z"
  labels:
    app.kubernetes.io/instance: datadog
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: datadog
    app.kubernetes.io/version: "7"
    helm.sh/chart: datadog-3.116.3
    helm.toolkit.fluxcd.io/name: datadog
    helm.toolkit.fluxcd.io/namespace: datadog
  name: datadog-cluster-agent-confd
  namespace: datadog

Only one thing I see in logs:

cluster-agent 2025-05-29 13:56:03 UTC | CLUSTER | DEBUG | (pkg/collector/corechecks/cluster/kubernetesapiserver/events_common.go:291 in getInvolvedObjectTags) | error getting entity for entity ID 'kubernetes_metadata://kustomize.toolkit.fluxcd.io/kustomizations/flux-system/cloudflared': tags may be missing

Describe what happened:
No customer metrics

Describe what you expected:
Expected new metrics
for example: gotk.resource_info or kubernetes_state_customresource.eniconfig

Steps to reproduce the issue:

Additional environment details (Operating System, Cloud provider, etc):
EKS 1.30 / Helm

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