Search code examples
kubernetesoperators

How to use otel collector to collect some CRD resources?


Does there are any solutions that I can use to collect resources for Operators, Helm Charts, CRD hierarchies and CD configurations via otel collector? All of them are not build-in resources for Kubernetes but kind of CRD resource, does there are any option that I can collect those info via otel? Thanks

Want to get some solution to collect above kubernetes CRD resources via otel


Solution

  • The k8sobjectreceiver in the collector may do what you want here [0]. It can be used to pull kubernetes manifests based on its configuration:

      k8sobjects:
        auth_type: serviceAccount
        objects:
          - name: <resource-name>
            group: <resource-group>
            mode: pull
            label_selector: environment in (production),tier in (frontend)
            field_selector: status.phase=Running
            interval: 15m
    

    You should be able to use this by specifying the resource name and group to pull down. You would then use this receiver in a logs pipeline.

    [0] https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/k8sobjectsreceiver