Skip to content

Commit 885c5e2

Browse files
committed
pipeline: router: Only logs are currently supported
Signed-off-by: lecaros <[email protected]>
1 parent 2153f99 commit 885c5e2

File tree

1 file changed

+6
-256
lines changed

1 file changed

+6
-256
lines changed

pipeline/router.md

Lines changed: 6 additions & 256 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,12 @@ The following comparison operators are available for condition rules:
284284

285285
Conditional routing supports different signal types to route logs, metrics, and traces separately:
286286

287-
| Signal | Description |
288-
| --- | --- |
289-
| `logs` | Routes log records |
290-
| `metrics` | Routes metric records |
291-
| `traces` | Routes trace records |
292-
| `any` | Routes all signal types |
287+
| Signal | Description | Supported |
288+
| --- | --- |---|
289+
| `logs` | Routes log records | Yes |
290+
| `metrics` | Routes metric records | No |
291+
| `traces` | Routes trace records | No |
292+
| `any` | Routes all signal types | No |
293293

294294
## Conditional routing examples
295295

@@ -517,256 +517,6 @@ pipeline:
517517
{% endtab %}
518518
{% endtabs %}
519519

520-
### Route metrics by name or labels
521-
522-
This example routes metrics to different backends based on metric name patterns:
523-
524-
{% tabs %}
525-
{% tab title="fluent-bit.yaml" %}
526-
527-
```yaml
528-
pipeline:
529-
inputs:
530-
- name: node_exporter_metrics
531-
tag: node.metrics
532-
routes:
533-
metrics:
534-
- name: cpu_metrics
535-
condition:
536-
op: or
537-
rules:
538-
- field: "$metric.name"
539-
op: regex
540-
value: "^node_cpu_.*"
541-
- field: "$metric.name"
542-
op: regex
543-
value: "^process_cpu_.*"
544-
to:
545-
outputs:
546-
- cpu_metrics_output
547-
548-
- name: memory_metrics
549-
condition:
550-
op: or
551-
rules:
552-
- field: "$metric.name"
553-
op: regex
554-
value: "^node_memory_.*"
555-
- field: "$metric.name"
556-
op: regex
557-
value: "^process_resident_memory_.*"
558-
to:
559-
outputs:
560-
- memory_metrics_output
561-
562-
- name: all_metrics
563-
condition:
564-
default: true
565-
to:
566-
outputs:
567-
- general_metrics_output
568-
569-
outputs:
570-
- name: prometheus_remote_write
571-
alias: cpu_metrics_output
572-
host: prometheus-cpu.example.com
573-
uri: /api/v1/write
574-
575-
- name: prometheus_remote_write
576-
alias: memory_metrics_output
577-
host: prometheus-memory.example.com
578-
uri: /api/v1/write
579-
580-
- name: prometheus_remote_write
581-
alias: general_metrics_output
582-
host: prometheus.example.com
583-
uri: /api/v1/write
584-
```
585-
586-
{% endtab %}
587-
{% endtabs %}
588-
589-
This configuration routes CPU-related metrics to a dedicated Prometheus instance, memory metrics to another, and all other metrics to a general metrics backend.
590-
591-
### Route traces by service or attributes
592-
593-
This example routes traces to different backends based on service name and span attributes:
594-
595-
{% tabs %}
596-
{% tab title="fluent-bit.yaml" %}
597-
598-
```yaml
599-
pipeline:
600-
inputs:
601-
- name: opentelemetry
602-
listen: 0.0.0.0
603-
port: 4318
604-
tag: otel.traces
605-
routes:
606-
traces:
607-
- name: critical_service_traces
608-
condition:
609-
op: or
610-
rules:
611-
- field: "$resource['service.name']"
612-
op: in
613-
value: ["payment-service", "auth-service", "order-service"]
614-
context: otel_resource_attributes
615-
- field: "$span.status_code"
616-
op: eq
617-
value: "ERROR"
618-
to:
619-
outputs:
620-
- critical_traces_output
621-
622-
- name: high_latency_traces
623-
condition:
624-
op: and
625-
rules:
626-
- field: "$span.duration"
627-
op: gt
628-
value: 5000000000
629-
to:
630-
outputs:
631-
- latency_traces_output
632-
633-
- name: default_traces
634-
condition:
635-
default: true
636-
to:
637-
outputs:
638-
- general_traces_output
639-
640-
outputs:
641-
- name: opentelemetry
642-
alias: critical_traces_output
643-
host: jaeger-critical.example.com
644-
port: 4317
645-
646-
- name: opentelemetry
647-
alias: latency_traces_output
648-
host: jaeger-latency.example.com
649-
port: 4317
650-
651-
- name: opentelemetry
652-
alias: general_traces_output
653-
host: jaeger.example.com
654-
port: 4317
655-
```
656-
657-
{% endtab %}
658-
{% endtabs %}
659-
660-
This configuration routes traces from critical services and error traces to a dedicated tracing backend, high-latency traces to a latency analysis backend, and all other traces to a general backend.
661-
662-
### Route multiple signal types
663-
664-
This example demonstrates routing logs, metrics, and traces with a single input configuration:
665-
666-
{% tabs %}
667-
{% tab title="fluent-bit.yaml" %}
668-
669-
```yaml
670-
pipeline:
671-
inputs:
672-
- name: opentelemetry
673-
listen: 0.0.0.0
674-
port: 4318
675-
tag: otel.data
676-
routes:
677-
logs:
678-
- name: error_logs
679-
condition:
680-
op: and
681-
rules:
682-
- field: "$severity_text"
683-
op: in
684-
value: ["ERROR", "FATAL", "CRITICAL"]
685-
to:
686-
outputs:
687-
- error_logs_output
688-
689-
- name: all_logs
690-
condition:
691-
default: true
692-
to:
693-
outputs:
694-
- general_logs_output
695-
696-
metrics:
697-
- name: application_metrics
698-
condition:
699-
op: and
700-
rules:
701-
- field: "$resource['service.namespace']"
702-
op: eq
703-
value: "production"
704-
context: otel_resource_attributes
705-
to:
706-
outputs:
707-
- prod_metrics_output
708-
709-
- name: all_metrics
710-
condition:
711-
default: true
712-
to:
713-
outputs:
714-
- general_metrics_output
715-
716-
traces:
717-
- name: sampled_traces
718-
condition:
719-
op: and
720-
rules:
721-
- field: "$resource['environment']"
722-
op: eq
723-
value: "production"
724-
context: otel_resource_attributes
725-
to:
726-
outputs:
727-
- prod_traces_output
728-
729-
- name: all_traces
730-
condition:
731-
default: true
732-
to:
733-
outputs:
734-
- general_traces_output
735-
736-
outputs:
737-
- name: loki
738-
alias: error_logs_output
739-
host: loki-errors.example.com
740-
741-
- name: loki
742-
alias: general_logs_output
743-
host: loki.example.com
744-
745-
- name: prometheus_remote_write
746-
alias: prod_metrics_output
747-
host: prometheus-prod.example.com
748-
uri: /api/v1/write
749-
750-
- name: prometheus_remote_write
751-
alias: general_metrics_output
752-
host: prometheus.example.com
753-
uri: /api/v1/write
754-
755-
- name: opentelemetry
756-
alias: prod_traces_output
757-
host: jaeger-prod.example.com
758-
port: 4317
759-
760-
- name: opentelemetry
761-
alias: general_traces_output
762-
host: jaeger.example.com
763-
port: 4317
764-
```
765-
766-
{% endtab %}
767-
{% endtabs %}
768-
769-
This configuration shows how to define separate routing rules for each signal type within the same input, enabling unified observability data collection with differentiated routing.
770520

771521
## Label-based matching
772522

0 commit comments

Comments
 (0)