You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pipeline/router.md
+6-256Lines changed: 6 additions & 256 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -284,12 +284,12 @@ The following comparison operators are available for condition rules:
284
284
285
285
Conditional routing supports different signal types to route logs, metrics, and traces separately:
286
286
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 |
293
293
294
294
## Conditional routing examples
295
295
@@ -517,256 +517,6 @@ pipeline:
517
517
{% endtab %}
518
518
{% endtabs %}
519
519
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:
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.
0 commit comments