Exporter
Exporter Custom Resource (CR) allows you to configure and deploy a Monitoring Exporter pipeline on the Management Cluster. Each Exporter CR produces one Telegraf pod that polls a PromQL source and forwards metrics to a configured sink.
A minimal configuration requires the following fields:
- spec.source.metrics — at least one metric definition, each with a name and a query.
- spec.sink — exactly one sink type. Currently only elastic is supported.
The following example shows the minimal configuration needed to deploy a working export pipeline:
Deployment configuration
The spec.deployment section is optional. When omitted, the composition uses its built-in image and resource defaults.
Image override
The spec.deployment.image block overrides the Telegraf container image. Omit to use the chart default.
- repository — Container image repository (for example,
registry.cennso.com/cennso-dev/telegraf) - tag — Image tag (for example,
v1.39.1-cennso.0-rc.1)
Resource requests and limits
The spec.deployment.resources block sets CPU and memory requests and limits for the Telegraf container. It accepts the standard Kubernetes resource format and is passed through to the Helm Release values.
Source configuration
The spec.source section configures the PromQL endpoint and polling behavior.
Metrics URL
- metricsURL (optional, recommended) — Base URL of a PromQL-compatible HTTP API (for example,
http://mimir-gateway.cennso-monitoring/prometheus). Defaults tohttp://mimir-gateway.cennso-monitoring/prometheuswhen omitted. Explicitly setting this field is recommended to ensure the pipeline reads from the intended source. Any PromQL-compatible endpoint works: Prometheus or Grafana Mimir.
Basic authentication
The spec.source.basicAuth block configures HTTP Basic Auth for the PromQL endpoint. Both fields reference keys in pre-existing Secrets in the same namespace.
- usernameSecretRef.name / usernameSecretRef.key — Secret and key for the username.
- passwordSecretRef.name / passwordSecretRef.key — Secret and key for the password.
Polling parameters
- pollInterval — How often Telegraf queries the source (default:
30s). Maps toagent.intervalin the rendered Telegraf TOML. Set this to match the PromQL source's scrape interval to align collection boundaries with scrape timestamps. - initialLookback — The look-back window for each range query:
start = now - initialLookback(default:1m). Consecutive ticks overlap by this window; widen the step or narrow the window to reduce duplicate delivery. - requestTimeout — HTTP timeout for PromQL requests (default:
25s).
Metrics list
spec.source.metrics is a required list of at least one metric definition. Each entry has:
- name (required) — Fallback metric name used when the PromQL result lacks a
__name__label. - query (required) — Raw PromQL expression. Written directly by the operator.
- step — Range query resolution step (default:
30s). - limit — Caps the number of series returned per tick. Without a limit, large queries can cause Mimir to silently truncate results or spike Telegraf memory. Set to the expected series count plus around 20% headroom.
Sink configuration
The spec.sink section selects the output destination using a discriminated union. Exactly one sink type must be specified. Specifying zero or more than one type is rejected by the XRD schema.
elastic
The elastic sink renders an outputs.http Telegraf section with the elasticcommonschema serializer that POSTs an NDJSON stream of ECS-compliant JSON documents (one document per line, no Elasticsearch _bulk action lines) to an ingest gateway. Kubernetes resource labels are renamed to the correct ECS fieldsets: cluster and workload identity to orchestrator.*Opens in a new tab (orchestrator.cluster.name, orchestrator.namespace, orchestrator.resource.name), container to container.nameOpens in a new tab, node to host.nameOpens in a new tab, and service to service.name. The serializer expands these dotted tag keys into nested objects at the document root, so each document contains @timestamp, ecs.version, event.dataset (the measurement name), the metric value nested under the measurement name, and the ECS fieldsets as nested objects at the root. Index routing is the gateway's responsibility.
Transport options
- timeout — HTTP request timeout for the gateway endpoint (default:
30s). - batchSize — Maximum number of metrics per request (default:
5000). - flushInterval — How often Telegraf flushes the output buffer (default:
30s). - enableGzip — Enable gzip compression on requests (default:
true).
TLS options
The spec.sink.elastic.tls block is optional.
- insecureSkipVerify — Skip TLS certificate verification (default:
false). Use only for development or testing. - caCertSecretRef.name / caCertSecretRef.key — Secret and key holding the PEM-encoded CA certificate to trust for the Elasticsearch endpoint.
Authentication
The spec.sink.elastic.auth block is optional but required to deliver authenticated requests. It uses the same discriminated-union pattern as spec.sink: exactly one auth type must be specified.
oauth2 configures the Telegraf secretstores.oauth2 plugin for OAuth 2.0 client-credentials token management. The resulting bearer token is passed to outputs.http as an Authorization: Bearer header.
- secretRef.name (required) — Name of a core/v1 Secret in the same namespace. The Secret must contain four keys:
client_id,client_secret,token_endpoint, andapi_endpoint. The composition projects these as environment variables on the Telegraf container.api_endpointis the exact URL the NDJSON document stream is POSTed to (the ingest gateway endpoint); it is used verbatim, with no path appended. - scopes — Optional list of OAuth 2.0 scopes to request (for example,
["metrics:write"]). - audience — Optional audience claim for the token request.
See the full configuration example:
Status
The status section reflects the observed state of the export pipeline.
- phase — Current deployment phase, mirrored from the underlying Helm Release:
Pending,Ready, orFailed. - renderedConfigMap — Name of the ConfigMap holding the rendered
telegraf.conf. - conditions — Standard Crossplane conditions (
Ready,Synced) with details about the last reconciliation.