MetoroClusterIngestionRule under the observability.metoro.io/v1alpha1 API group. Rules are enforced by the Metoro exporter inside the cluster, so matching log lines and trace spans are dropped before they leave the cluster, the same enforcement point as UI filters. This lets you keep ingestion filtering in version control and roll it out through GitOps alongside the workloads it applies to.
How it works
- The
MetoroClusterIngestionRuleCRD is installed by the Metoro exporter chart on every monitored cluster, so it is available on both Metoro cloud and on-prem. It ships withmetoro-exporterchart version 0.476.0 or later (Metoro cloud) andmetoro-exporter-onpremchart version 11.0.0 or later. On an older chart the CRD does not exist andkubectl applyfails withno matches for kind "MetoroClusterIngestionRule". On Metoro cloud, upgrade the exporter chart first. On-prem, the CRD is available from the 11.x release line; existing 10.x installations cannot upgrade to 11.x in place, see Upgrading from 10.x for the supported path. - Exporters fetch the active filter set about once a minute and enforce it before telemetry egress.
- Rules sync near real time: a new or changed rule takes effect about a minute after you apply it. Telemetry produced before the rule takes effect is ingested normally.
METORO_K8S_RESOURCES allowlist restricting which Kubernetes resources it watches, the list must include mcingrule (or another MetoroClusterIngestionRule alias); otherwise applied rules are never discovered and never take effect. If the variable is unset, all resources including ingestion rules are watched.
Scope and semantics
- Cluster-scoped, per-cluster effect. A rule only affects telemetry from the cluster where the custom resource is created; there is no cross-cluster field. To apply the same rules in several clusters, apply the same manifest to each of them.
- Exclude-only. The only supported
actionisExclude, and it is required: every rule states explicitly that it removes data. Rules declared in Kubernetes cannot include/allow telemetry; include filters remain UI-only. - Rules are ORed. Each entry in
spec.rulesis an independent rule: a record is excluded when any single rule matches it. Rules from all sources compose the same way: a record is dropped if any exclude filter matches it, whether it came from the UI or from aMetoroClusterIngestionRule.
Match semantics
Within one rule, a record matches when every entry inmatch.matchExpressions matches it (expressions are ANDed). Within a single expression, the values are ORed: the attribute matches if it equals (In) or matches (RegexIn, unanchored RE2) any of them. To exclude on independent conditions, add separate rules.
For logs rules a record is a log line. For traces rules it is an individual span: each span that matches is dropped, and other spans of the same trace are exported normally. To drop everything a trace contains, make sure the rule’s expressions match every span of it.
Trace attribute matching is limited to string-valued attributes: a span attribute carrying a non-string OTLP value (for example, an integer http.status_code on traces sent from an OpenTelemetry SDK) is read as an empty string, so an In expression on its displayed value will not match it.
Attribute keys
These keys are supported on both CRD families with the same meaning:
Any other key is matched verbatim against the record’s resource and log/span attributes, for example
http.path, http.method or net.peer.name on spans, or a field of your structured logs. To target one side of a span explicitly, use the stored keys server.service.name, client.service.name, server.namespace, client.namespace.
Spec reference
The resource is cluster-scoped, with short name
mcingrule and category metoro:
kubectl get mcingrules lists them.
Examples
Silence a namespace and drop probe noise, one resource
Drop all debug logs from this cluster
Drop successful health-check spans
Validation and failure modes
- The CRD schema validates rules at
kubectl applytime: unknown fields, invalid signals or operators, a missing or non-Excludeaction, duplicate expression keys,messageon atracesrule, and emptyrulesare all rejected by the Kubernetes API server with specific messages. - The sync validates each rule again before it reaches enforcement, most importantly that every regex compiles as RE2 and that reserved keys are used on the right signal. An invalid resource is skipped and logged; it never partially applies.
- When a resource is skipped as invalid, every previously synced rule of it stays in effect unchanged. You can spot this in the UI: the Last synced time on the managed filters stops advancing. Fix the custom resource and it syncs again within about a minute.
Deleting rules
Delete the custom resource; all of its managed filters are removed and exporters stop applying them within a couple of minutes:spec.rules (or a signal from a rule’s signals) removes exactly the corresponding managed filters.
If a cluster stops reporting to Metoro entirely (for example, its exporter is down), its rules are deliberately kept at their last-synced state rather than removed: a disconnected cluster keeps filtering the way it did when it was last seen.