-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(OTEL) Add collector documentation
- Loading branch information
1 parent
aeb3191
commit e9f2358
Showing
6 changed files
with
535 additions
and
79 deletions.
There are no files selected for viewing
119 changes: 119 additions & 0 deletions
119
...etry-integrations/opentelemetry/collector/images/native_otlp_with_collector.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions
76
...elemetry-integrations/opentelemetry/collector/opentelemetry-collector-basic.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
title: Collector with New Relic (basic setup) | ||
tags: | ||
- Integrations | ||
- Open source telemetry integrations | ||
- OpenTelemetry | ||
metaDescription: The OpenTelemetry collector is a central tool to collect, process, and export your telemetry. | ||
--- | ||
|
||
The [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) is a configurable and extensible software component to receive, process, and export telemetry data. When you set up a collector, it can operate as a gateway or as an agent: | ||
|
||
* **Gateway:** The collector receives data from a variety of sources and applies standard processing before exporting to some backend. | ||
* **Agent:** The collector is deployed on each host in an environment and can collect telemetry data about the host and processes running on it. | ||
|
||
When you use a collector, you start by following the same routine as above for setting up OTLP in your service. In this case, instead of exporting data directly to New Relic, you export through a collector that you set up. In the collector, you configure the [OTLP exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlpexporter) to export data to New Relic. | ||
|
||
When your data goes through a collector, the transport looks like this: | ||
|
||
![Diagram showing OpenTelemetry using the OpenTelemetry Collector and New Relic's OTLP endpoint.](./images/native_otlp_with_collector.svg "Diagram of OTLP with collector") | ||
|
||
Here's a Docker example of how to set up and run an OpenTelemetry collector with the collector YAML: | ||
|
||
1. Save the following as `otel-config.yaml`: | ||
|
||
``` | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
http: | ||
processors: | ||
batch: | ||
exporters: | ||
otlp: | ||
endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT} | ||
headers: | ||
api-key: ${NEW_RELIC_LICENSE_KEY} | ||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
processors: [batch] | ||
exporters: [otlp] | ||
metrics: | ||
receivers: [otlp] | ||
processors: [batch] | ||
exporters: [otlp] | ||
logs: | ||
receivers: [otlp] | ||
processors: [batch] | ||
exporters: [otlp] | ||
``` | ||
2. Run the OpenTelemetry collector after you make the following changes: | ||
* Replace <var>OTLP_ENDPOINT_HERE</var> with the appropriate [endpoint](#review-settings. | ||
* Replace <var>YOUR_KEY_HERE</var> with your account's [license key](https://one.newrelic.com/launcher/api-keys-ui.launcher). | ||
|
||
``` | ||
export OTEL_EXPORTER_OTLP_ENDPOINT=<var>OTLP_ENDPOINT_HERE</var> | ||
export NEW_RELIC_LICENSE_KEY=<var>YOUR_KEY_HERE</var> | ||
docker run --rm \ | ||
-e OTEL_EXPORTER_OTLP_ENDPOINT \ | ||
-e NEW_RELIC_LICENSE_KEY \ | ||
-p 4317:4317 \ | ||
-v "${PWD}/otel-config.yaml":/otel-config.yaml \ | ||
--name otelcol \ | ||
otel/opentelemetry-collector \ | ||
--config otel-config.yaml | ||
``` | ||
|
||
|
||
|
||
|
Oops, something went wrong.