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: site/content/learn/opentelemetry/otel-collector.md
+38-27Lines changed: 38 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ weight: 5
16
16
17
17
## Introduction to the OpenTelemetry Collector
18
18
19
-
The OpenTelemetry Collector is a stand-alone service designed to collect, process, and export telemetry data such as logs, metrics, and traces. It provides a vendor-neutral way to manage this data, offering flexibility in configuration and deployment.
19
+
The OpenTelemetry Collector is a stand-alone service designed to collect, process, and export telemetry data such as logs, metrics, and traces. It provides a vendor-neutral way to manage this data, offering flexibility in configuration and deployment. The collector is extremely lightweight, and can run in almost any environment without significant infrastructure overhead.
20
20
21
21
## Setting Up Observability with OpenTelemetry
22
22
@@ -26,20 +26,26 @@ To begin, you need to instrument your code with OpenTelemetry client libraries.
26
26
27
27
### Data Collection and Processing
28
28
29
-
Once the telemetry data is generated, it can be exported directly to a backend or processed through the OpenTelemetry Collector. Using a collector helps offload the responsibility of data management from the application, making it easier to handle different data pipelines.
29
+
Once the telemetry data is generated, it can be exported directly to a backend or processed through the OpenTelemetry Collector. Using a collector helps offload the responsibility of data management from the application, making it easier to handle different data pipelines. To use the collector, after setting up your first collector instance, you'll configure your application's OpenTelemetry installation to send data to your collector, generally via the OpenTelemetry protocol or OTLP.
30
30
31
-
## Deployment Options
31
+
###Deployment Options
32
32
33
33
The OpenTelemetry Collector can be deployed in multiple ways:
34
34
35
-
-**As an agent:** Installed on individual hosts to collect host metrics like CPU, memory, and I/O metrics.
36
-
-**As a standalone service:** Runs independently, receiving telemetry from multiple sources.
35
+
-**As an agent:** Installed on the same host as the application reporting data. Generally one collector per application
36
+

37
+
-**As a standalone service with a gateway:** Runs independently, receiving telemetry from multiple sources, possibly with a load balancer.
38
+

39
+
*There may be a load balancer between all applications and multiple collectors, but this is the simplest version*
37
40
38
41
In larger deployments, a combination of agents and standalone services may be employed to manage scale.
39
42
40
-
## OpenTelemetry Architecture
43
+
### Data Storage
44
+
The OpenTelemetry collector is fully stateless, it produces no dashboards and stores no data. It doesn't even create an API endpoint to get status information. The collector is only useful when transmitting data, so your OpenTelemetry data needs somewhere to go. SaaS tools like Coralogix can receive your data, or you'll need to set up your own datastore with something like Prometheus.
41
45
42
-
The OpenTelemetry framework is part of the Cloud Native Computing Foundation (CNCF) and aims to standardize the handling of telemetry data. It provides a consistent interface to collect and export data across many programming languages.
46
+
## OpenTelemetry and the CNCF
47
+
48
+
The OpenTelemetry framework is part of the Cloud Native Computing Foundation (CNCF) and aims to standardize the handling of telemetry data. It provides a consistent interface to collect and export data across many programming languages. The collector is an important part of this mission, since a standardized proxy for all OpenTelemetry data helps different teams in different languages form a shared understanding of how their data is collected, processed, and transmitted.
43
49
44
50
### Key Functions of the OpenTelemetry Collector
45
51
@@ -76,12 +82,16 @@ receivers:
76
82
protocols:
77
83
grpc:
78
84
http:
79
-
jaeger:
80
-
protocols:
81
-
grpc:
82
-
thrift_http:
85
+
prometheus:
86
+
config:
87
+
scrape_configs:
88
+
- job_name: 'otel-collector'
89
+
scrape_interval: 5s
90
+
static_configs:
91
+
- targets: ['0.0.0.0:8888']
83
92
84
93
```
94
+
There are a large number of receivers for multiple formats of data coming in to an OpenTelemetry system. Note that, sadly, not all Prometheus data can be translated 1:1 into OTLP. The Prometheus receiver on Github is [currently listed as a work in progress](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/prometheusreceiver/README.md).
85
95
86
96
### Processors
87
97
@@ -97,8 +107,8 @@ processors:
97
107
queued_retry:
98
108
num_workers: 4
99
109
retry_on_failure: true
100
-
101
110
```
111
+
Processors are the most diverse component within a collector, with a processor doing anything from removing sensitive data, batching data for transmission, or filtering unwanted information. These examples are all about how data will be batched, the max memory to use (after which data will be thrown out in this reporting cycle), and retries for sending data.
102
112
103
113
### Exporters
104
114
@@ -108,24 +118,23 @@ exporters:
108
118
endpoint: "localhost:9090"
109
119
jaeger:
110
120
endpoint: "localhost:14250"
111
-
112
121
```
122
+
At their most basic, exporters will contain where the data is headed.
113
123
114
-
### Service and Pipelines
124
+
### Pipelines
115
125
116
126
```yaml
117
-
service:
118
-
pipelines:
119
-
traces:
120
-
receivers: [jaeger, otlp]
121
-
processors: [batch, memory_limiter]
122
-
exporters: [jaeger]
123
-
metrics:
124
-
receivers: [otlp]
125
-
processors: [batch]
126
-
exporters: [prometheus]
127
-
127
+
pipelines:
128
+
traces:
129
+
receivers: [jaeger, otlp]
130
+
processors: [batch, memory_limiter]
131
+
exporters: [jaeger]
132
+
metrics:
133
+
receivers: [otlp]
134
+
processors: [batch]
135
+
exporters: [prometheus]
128
136
```
137
+
Pipelines a path from receiver to exporter, and any data will go through the processors listed in order, left to right.
129
138
130
139
## Backend Options for OpenTelemetry Metrics and Traces
131
140
@@ -151,15 +160,17 @@ You don't have to use a collector to gather OpenTelemetry data. In the simplest
151
160
152
161
### What is the difference between the OpenTelemetry Agent and Collector?
153
162
154
-
The agent is deployed close to the application to collect local data, while the collector is a centralized service that gathers telemetry data from multiple agents or systems.
163
+
There isn't an 'agent' as such that's part of the OpenTelemetry model. As mentioned above the collector may be deployed in an 'agent' pattern where the collector is running on the same host as the application, but the term 'agent' is a little overloaded in observibility and requires brief disambugation. The other part of observability sometimes called an 'agent' is a process running within an application that receives data on the sytem. For example, automatic instrumentation of Java applications is made possible by the standard `javaagent` jvm argument. Using an agent to observe your application will depend on your language library's implementation.
164
+
165
+
The collector is not an 'agent' running within an application, it runs outside your application and collects and forwards data.
155
166
156
167
### How does OpenTelemetry compare with Prometheus?
157
168
158
169
Prometheus is focused on metrics, using a pull model for data collection. OpenTelemetry, on the other hand, is a broader framework that handles logs, metrics, and traces and supports multiple backends.
159
170
160
171
### What is OpenTelemetry's collector-contrib?
161
172
162
-
The `collector-contrib` repository offers community-contributed components that extend the capabilities of the core OpenTelemetry Collector. These additions provide more receivers, processors, and exporters to handle different telemetry scenarios.
173
+
The `collector-contrib` repository offers [community-contributed components](https://github.com/open-telemetry/opentelemetry-collector-contrib) that extend the capabilities of the core OpenTelemetry Collector. These additions provide more receivers, processors, and exporters to handle different telemetry scenarios.
0 commit comments