| 1 |
# General Information |
| 2 |
|
| 3 |
A receiver is how data gets into the OpenTelemetry Collector. Generally, a |
| 4 |
receiver accepts data in a specified format, translates it into the internal |
| 5 |
format and passes it to [processors](../processor/README.md) and [exporters](../exporter/README.md) defined |
| 6 |
in the applicable pipelines. |
| 7 |
|
| 8 |
This repository hosts the following receiver available in traces, metrics |
| 9 |
and logs pipelines: |
| 10 |
|
| 11 |
- [OTLP Receiver](otlpreceiver/README.md) |
| 12 |
|
| 13 |
The [contrib repository](https://github.com/open-telemetry/opentelemetry-collector-contrib) |
| 14 |
has more receivers available in its builds. |
| 15 |
|
| 16 |
## Configuring Receivers |
| 17 |
|
| 18 |
Receivers are configured via YAML under the top-level `receivers` tag. There |
| 19 |
must be at least one enabled receiver for a configuration to be considered |
| 20 |
valid. |
| 21 |
|
| 22 |
The following is a sample configuration for the `examplereceiver`. |
| 23 |
|
| 24 |
```yaml |
| 25 |
receivers: |
| 26 |
# Receiver 1. |
| 27 |
# <receiver type>: |
| 28 |
examplereceiver: |
| 29 |
# <setting one>: <value one> |
| 30 |
endpoint: 1.2.3.4:8080 |
| 31 |
# ... |
| 32 |
# Receiver 2. |
| 33 |
# <receiver type>/<name>: |
| 34 |
examplereceiver/settings: |
| 35 |
# <setting two>: <value two> |
| 36 |
endpoint: 0.0.0.0:9211 |
| 37 |
``` |
| 38 |
|
| 39 |
A receiver instance is referenced by its full name in other parts of the config, |
| 40 |
such as in pipelines. A full name consists of the receiver type, '/' and the |
| 41 |
name appended to the receiver type in the configuration. All receiver full names |
| 42 |
must be unique. |
| 43 |
|
| 44 |
For the example above: |
| 45 |
|
| 46 |
- Receiver 1 has full name `examplereceiver`. |
| 47 |
- Receiver 2 has full name `examplereceiver/settings`. |
| 48 |
|
| 49 |
Receivers are enabled upon being added to a pipeline. For example: |
| 50 |
|
| 51 |
```yaml |
| 52 |
service: |
| 53 |
pipelines: |
| 54 |
# Valid pipelines are: traces, metrics or logs |
| 55 |
# Trace pipeline 1. |
| 56 |
traces: |
| 57 |
receivers: [examplereceiver, examplereceiver/settings] |
| 58 |
processors: [] |
| 59 |
exporters: [exampleexporter] |
| 60 |
# Trace pipeline 2. |
| 61 |
traces/another: |
| 62 |
receivers: [examplereceiver, examplereceiver/settings] |
| 63 |
processors: [] |
| 64 |
exporters: [exampleexporter] |
| 65 |
``` |
| 66 |
|
| 67 |
> At least one receiver must be enabled per pipeline to be a valid configuration. |