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: docs/sources/flow/when-to-use-flow/opentelemetry-collector.md
+30-21Lines changed: 30 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,80 +18,89 @@ The Collector may be a better choice if:
18
18
* You are already using the Collector, and do not need any of the features of Flow.
19
19
* You prefer YAML syntax over River.
20
20
21
-
Below you can find more details on similarities and differences between the Collector and Flow.
22
-
23
21
## Similarities
24
22
25
23
### Many Collector components are available in Flow
26
24
27
-
Flow contains many of the components available inside the Collector:
28
-
* For example, the OTLP exporter is available as `otelcol.exporter.otlp`.
29
-
* The Grafana Agent development team is actively working on adding more of the Collector's components to Flow.
30
-
* If a Flow user needs a Collector feature to be made available in the Agent, the Agent development team could work on implementing it.
25
+
Flow contains many of the components available inside the Collector.
26
+
For example, Collector's OTLP exporter is available in Flow as `otelcol.exporter.otlp`.
27
+
28
+
The Grafana Agent development team is actively working on adding more of the Collector's components to Flow.
29
+
If a Flow user needs a Collector feature to be made available in the Agent, the Agent development team could work on implementing it.
31
30
32
31
### Similar performance when processing OpenTelemetry signals natively
33
32
34
33
Most of Flow's `otelcol` components are just thin wrappers over a Collector component.
35
-
Hence, the CPU and memory performance of Flow is similar.
34
+
As a result, the CPU and memory performance of Flow is similar.
36
35
37
36
## Differences
38
37
39
38
### Configuration language
40
39
41
-
Collector is configured using yaml, whereas Flow is configured using River.
40
+
Collector uses YAML for its configuration, and Flow uses River for its configuration.
42
41
43
42
#### Example - coalesce
44
43
45
-
One of River's main advantages is its standard library. It contains handy functions such as coalesce,
46
-
which could be used to retrieve the first argument which is not null or empty:
44
+
One of River's main advantages is its standard library. It contains handy functions such as coalesce.
45
+
You can use this function to retrieve the first argument which is not null or empty:
47
46
48
47
```river
49
48
```
50
49
51
50
### Modularity
52
51
53
-
The Agent configuration is more flexible, modular, and allows for more opportunities to chain components together in a pipeline.
52
+
The Agent configuration is flexible and modular:
53
+
* Telemetry and non-telemetry components can be combined easily.
54
+
For example, a configuration argument for `otelcol.exporter.otlp` could be supplied from the response of an HTTP request via `remote.http`.
55
+
* Some or all of the components which an Agent runs could be defined outside of its main config file.
56
+
For example, whole snippets of Flow configuration could be loaded from a file (`module.file`),
57
+
a Git repository (`module.git`), or a an HTTP endpoint (`module.http`).
54
58
55
59
#### Example - retrieving data from a file
56
60
57
-
Let's say you would like to use OAuth2 authentication in the Collector. If you need to retrieve `client_id`
58
-
or `client_secret` from a file, then you would have to use the `client_id_file` or `client_secret_file` config parameters.
61
+
Let's say you want to use OAuth2 authentication in the Collector. If you need to retrieve `client_id`
62
+
or `client_secret` from a file, then you must use the `client_id_file` or `client_secret_file` config parameters.
59
63
60
64
```yaml
61
65
```
62
66
63
67
In the Agent, you'd use `otelcol.auth.oauth2` with the normal `client_id` and `client_secret` parameters,
64
-
and you would setup another component which retrieves those from a `local.file` component.
68
+
and you would set up another component that retrieves those from a `local.file` component.
65
69
66
70
```river
67
71
```
68
72
69
-
Moreover, the string could also come from a `remote.s3`, `remote.vault`, or `remote.http`.
73
+
The string could also come from a `remote.s3`, `remote.vault`, or `remote.http`.
70
74
This gives Flow users lots of flexibility because strings coming out of those components
71
-
could be used for any parameter, in any component which requires a string - not just for
75
+
could be used for any parameter in any component which requires a string - not just for
72
76
a `client_id` for OAuth2.
73
77
74
78
```river
75
79
```
76
80
77
81
### Flow can process Prometheus signals natively
78
82
79
-
Collector needs to convert Prometheus signals to the OTLP format in order to process them.
83
+
Collector needs to convert Prometheus signals to the OTLP format to process them.
80
84
Flow, on the other hand, can process those signals natively using components such as `prometheus.relabel`, `prometheus.relabel`, and `prometheus.remote_write`.
81
85
This could lead to better performance and ease of use.
82
86
83
87
### Flow documentation is consistent and structured
84
88
85
-
Flow components tend to be documented in a more consistent way than Collector components.
89
+
Flow components are documented in a consistent and structured way.
86
90
87
91
### Some Collector features are not available in the Agent and vice-versa
88
92
89
-
Agent doesn't have all the components which the Collector has. However, the Grafana Agent development team is working on
90
-
adding new components all the time and we would be happy to add new components which Flow users need.
93
+
Agent doesn't have all the components which the Collector has. However, the Grafana Agent development team is constantly working on
94
+
adding new components, and would be happy to add new components that Flow users need.
91
95
92
96
### Flow supports "profile" telemetry signals
93
97
94
-
OpenTelemetry currently does not support "profile" signals. Flow supports them through components such as `pyroscope.scrape` and `pyroscope.ebpf`.
98
+
OpenTelemetry currently does not support "profile" signals. Flow supports "profile" signals through components such as `pyroscope.scrape` and `pyroscope.ebpf`.
99
+
100
+
### Flow can load balance scraping dynamically
101
+
102
+
Using clustering, `prometheus.scrape` and `pyroscope.scrape` use a gossip communication to load balance
103
+
scraping among each other. Agents can be added and removed from the cluster without having to restart the whole set of Agents.
95
104
96
105
### Flow is usually a few versions of OpenTelemetry behind
0 commit comments