> For the complete documentation index, see [llms.txt](https://docs.cennso.com/cennso/monitoring/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/cennso/monitoring/latest/technical-reference/crds/exporter.md).

# Exporter Custom Resource Definition

`Exporter` Custom Resource (CR) is used to define and configure an exporter pipeline on the Management Cluster.

## Configuration example

This is a sample `Exporter` CR that configures a pipeline named `platform-metrics` in the `my-namespace` namespace, polling Mimir and writing ECS-compliant JSON documents to Elasticsearch with OAuth 2.0 authentication:

Documents written to Elasticsearch conform to the [Elastic Common Schema (ECS)](https://www.elastic.co/docs/reference/ecs). Kubernetes resource labels are mapped to the correct ECS fieldsets: cluster and workload identity to `orchestrator.*`, container to `container.name`, node to `host.name`, and service to `service.name`.

```yaml
apiVersion: monitoring.cennso.com/v1alpha1
kind: Exporter
metadata:
  name: platform-metrics
  namespace: my-namespace
spec:
  compositionRevisionSelector:
    matchLabels:
      cennso.com/version: 0.1.0

  deployment:
    resources:
      requests:
        memory: "256Mi"
        cpu: "200m"
      limits:
        memory: "512Mi"
        cpu: "1000m"

  source:
    metricsURL: http://mimir-gateway.cennso-monitoring/prometheus
    pollInterval: "30s"
    initialLookback: "1m"
    requestTimeout: "25s"
    metrics:
      - name: up
        query: 'up{job=~"cennso-.*"}'
        step: "30s"
        limit: 500
      - name: smc_session_active_total
        query: 'smc_session_active_total{namespace="cennso-system"}'
        step: "60s"
        limit: 200

  sink:
    elastic:
      timeout: "30s"
      batchSize: 5000
      flushInterval: "30s"
      enableGzip: true
      tls:
        insecureSkipVerify: false
      auth:
        oauth2:
          secretRef:
            name: elastic-oauth-credentials
          scopes: ["metrics:write"]
          audience: elastic
```

## Configuration parameters

These are all parameters that you can use to configure the `Exporter` CR:

**CRD specification:** [exporter_definition.yaml](https://docs.cennso.com/api/spec/cennso/monitoring/latest/assets/xrds/monitoring/exporter_definition.yaml?form=bundled&kind=crd)
