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
* Add an **otlp** receiver, under the *protocols* section, add a *HTTP* entry, with an endpoint of *"0.0.0.0:4318"* and add it to all the pipelines
34
-
* Add a **debug** exporter with *verbosity* entry set to *detailed* and also add it to all the pipelines
33
+
* Add an **otlp:** receiver, under the *protocols:* section, add a *HTTP:* entry, with an endpoint of *"0.0.0.0:4318"* and add it as a receiver to all the 8*receiver:* sections of the pipelines
34
+
* Enable the **memory_limiter:** processor by adding it in the *processor:* section of all the pipelines
35
+
* Add a **debug:* exporter with *verbosity:* entry set to *detailed* and also add it as an exporter in all *exporter:* sections of the pipelines
35
36
36
37
{{% /notice %}}
37
38
@@ -52,7 +53,7 @@ Run the following command to test your config (make sure you use the right otel
* Add an **file** exporter, add a *path* entry, with a value of *"agent.out"* and add the exporter as the first exporter entry to all the pipelines (leaving debug in place)
12
+
* Add an **file:** exporter, add a *path:* entry, with a value of *"./agent.out"*
13
+
* Configure file size constrains by adding a *rotation:* section, add a *max_megabytes:* entry with a value of *"2"* as well as and *max_backups:* also with a value of 2
14
+
* Add the exporter as the first exporter entry to all the pipelines (leaving debug as the second one )
13
15
14
16
{{% /notice %}}
15
17
16
18
Validate your new `agent.yaml` with [https://otelbin.io](https://otelbin.io), your pipelines should look like this:
17
19
18
-

20
+

19
21
20
-
---
21
-
Run the following command to test your config (make sure you use the right otel collector you downloaded):
22
+
start your collector again with your new config to test it:
22
23
23
24
```text
24
25
otelcol_darwin_arm64 --config=agent.yaml
25
26
```
26
27
27
-
If you have done everything correctly the last line of the out put should be:
28
+
Again, if you have done everything correctly, the last line of the output should be:
28
29
29
30
```text
30
-
2025-01-13T12:43:51.747+0100 info service@v0.115.0/service.go:261 Everything is ready. Begin running and processing data.
31
+
2025-01-13T12:43:51.747+0100 info service@v0.116.0/service.go:261 Everything is ready. Begin running and processing data.
31
32
```
32
33
33
-
Now start a new shell and create a file called **trace.json* and copy the following content:
34
-
35
-
```json
36
-
{
37
-
"resourceSpans": [
38
-
{
39
-
"resource": {
40
-
"attributes": [
41
-
{
42
-
"key": "service.name",
43
-
"value": {
44
-
"stringValue": "my.service"
45
-
}
46
-
},
47
-
{
48
-
"key": "deployment.environment",
49
-
"value": {
50
-
"stringValue": "my.environment"
51
-
}
52
-
}
53
-
]
54
-
},
55
-
"scopeSpans": [
56
-
{
57
-
"scope": {
58
-
"name": "my.library",
59
-
"version": "1.0.0",
60
-
"attributes": [
61
-
{
62
-
"key": "my.scope.attribute",
63
-
"value": {
64
-
"stringValue": "some scope attribute"
65
-
}
66
-
}
67
-
]
68
-
},
69
-
"spans": [
70
-
{
71
-
"traceId": "5B8EFFF798038103D269B633813FC60C",
72
-
"spanId": "EEE19B7EC3C1B174",
73
-
"parentSpanId": "EEE19B7EC3C1B173",
74
-
"name": "I'm a server span",
75
-
"startTimeUnixNano": "1544712660000000000",
76
-
"endTimeUnixNano": "1544712661000000000",
77
-
"kind": 2,
78
-
"attributes": [
79
-
{
80
-
"keytest": "my.span.attr",
81
-
"value": {
82
-
"stringValue": "some value"
83
-
}
84
-
}
85
-
]
86
-
}
87
-
]
88
-
}
89
-
]
90
-
}
91
-
]
92
-
}
93
-
```
34
+
If you send a trace again, you should get the same output as we saw previously, but you also should have a file in the same directory called **agent.out**
35
+
In the file the trace is written as a single line in oltp.json format, when you look at the file it looks like this:
94
36
95
-
In the second Shell, run the following command to test your setup:
37
+
```text
96
38
97
-
```shell
98
-
curl -X POST -i http://localhost:4318/v1/traces \
99
-
-H "Content-Type: application/json" \
100
-
-d @trace.json
101
39
```
102
40
103
-
Your collector should show the following output:
41
+
If you want it json expanded, you can cat the file and pipe it though jq ( if you have it installed)
0 commit comments