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/product/drains/integration/vector.mdx
+55-27Lines changed: 55 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,11 @@ description: Learn how to set up Vector to forward logs to Sentry via OpenTeleme
6
6
7
7
You can configure [Vector](https://vector.dev/) to forward logs to Sentry using its [OpenTelemetry sink](https://vector.dev/docs/reference/configuration/sinks/opentelemetry/).
8
8
9
-
<Alertlevel="warning">
10
-
11
-
Vector's OpenTelemetry sink requires events to conform to the [OTEL proto format](https://opentelemetry.io/docs/specs/otlp/). You must use the [remap transform](https://vector.dev/docs/reference/configuration/transforms/remap/) with VRL (Vector Remap Language) to convert your log data into the proper OpenTelemetry structure before sending to Sentry.
12
-
13
-
</Alert>
14
-
15
9
## Prerequisites
16
10
17
11
Before you begin, ensure you have:
18
12
19
-
- Vector installed and running
13
+
- Vector installed and running (version 0.51.0 or higher for `otlp` codec support)
Choose your configuration based on your data source:
41
35
42
-
1.**Source**: Where your logs come from (files, syslog, etc.)
43
-
2.**Transform**: A remap transform to convert logs to OTEL format
44
-
3.**Sink**: The OpenTelemetry sink to send data to Sentry
36
+
-**Option A**: Forwarding existing OTLP data (simplest)
37
+
-**Option B**: Transforming non-OTLP data (files, syslog, etc.)
38
+
39
+
## Option A: Forwarding OTLP Data
40
+
41
+
If you're receiving data that's already in OTLP format (from an OpenTelemetry SDK or collector), you can forward it directly to Sentry using the `otlp` codec without any transformation.
The `otlp` codec requires Vector version [0.51.0](https://vector.dev/releases/0.51.0/) or higher. The `use_otlp_decoding` option was introduced in Vector [0.50.0](https://vector.dev/releases/0.50.0/).
71
+
72
+
</Alert>
73
+
74
+
## Option B: Transforming Non-OTLP Data
75
+
76
+
If your logs come from non-OTLP sources (files, syslog, etc.), you need to use a [remap transform](https://vector.dev/docs/reference/configuration/transforms/remap/) with VRL (Vector Remap Language) to convert your data into the OTEL format before sending to Sentry.
45
77
46
78
### Understanding the OTEL Log Format
47
79
48
-
The OpenTelemetry log format requires a specific structure with `resourceLogs`, `scopeLogs`, and `logRecords`. Here's the structure you need to create:
80
+
The OpenTelemetry log format requires a specific structure with `resourceLogs`, `scopeLogs`, and `logRecords`:
49
81
50
82
```json
51
83
{
@@ -74,7 +106,7 @@ The OpenTelemetry log format requires a specific structure with `resourceLogs`,
74
106
}
75
107
```
76
108
77
-
## Example: Forwarding File Logs
109
+
### Example: Forwarding File Logs
78
110
79
111
Here's a complete example that reads logs from a file and forwards them to Sentry:
0 commit comments