@@ -46,7 +46,6 @@ This blog post shows how to set up this solution step by step.
46
46
ingest the logs.
47
47
- Finally, we'll show a Kubernetes-specific setup to handle container logs.
48
48
49
-
50
49
![ OTLP/JSON Architecture] ( otlpjson-architecture.png )
51
50
52
51
## Configure Java application to output OTLP/JSON logs
@@ -118,91 +117,90 @@ OTLP/JSON format, with a JSON object per line. The log records are nested in the
118
117
119
118
``` json
120
119
{
121
- "resourceLogs" :[
120
+ "resourceLogs" : [
122
121
{
123
- "resource" :{
124
- "attributes" :[
122
+ "resource" : {
123
+ "attributes" : [
125
124
{
126
- "key" :" deployment.environment.name" ,
127
- "value" :{
128
- "stringValue" :" staging"
125
+ "key" : " deployment.environment.name" ,
126
+ "value" : {
127
+ "stringValue" : " staging"
129
128
}
130
129
},
131
130
{
132
- "key" :" service.instance.id" ,
133
- "value" :{
134
- "stringValue" :" 6ad88e10-238c-4fb7-bf97-38df19053366"
131
+ "key" : " service.instance.id" ,
132
+ "value" : {
133
+ "stringValue" : " 6ad88e10-238c-4fb7-bf97-38df19053366"
135
134
}
136
135
},
137
136
{
138
- "key" :" service.name" ,
139
- "value" :{
140
- "stringValue" :" checkout"
137
+ "key" : " service.name" ,
138
+ "value" : {
139
+ "stringValue" : " checkout"
141
140
}
142
141
},
143
142
{
144
- "key" :" service.namespace" ,
145
- "value" :{
146
- "stringValue" :" shop"
143
+ "key" : " service.namespace" ,
144
+ "value" : {
145
+ "stringValue" : " shop"
147
146
}
148
147
},
149
148
{
150
- "key" :" service.version" ,
151
- "value" :{
152
- "stringValue" :" 1.1"
149
+ "key" : " service.version" ,
150
+ "value" : {
151
+ "stringValue" : " 1.1"
153
152
}
154
153
}
155
154
]
156
155
},
157
- "scopeLogs" :[
156
+ "scopeLogs" : [
158
157
{
159
- "scope" :{
160
- "name" :" com.mycompany.checkout.CheckoutServiceServer$CheckoutServiceImpl" ,
161
- "attributes" :[
162
-
163
- ]
158
+ "scope" : {
159
+ "name" : " com.mycompany.checkout.CheckoutServiceServer$CheckoutServiceImpl" ,
160
+ "attributes" : []
164
161
},
165
- "logRecords" :[
162
+ "logRecords" : [
166
163
{
167
- "timeUnixNano" :" 1730435085776869000" ,
168
- "observedTimeUnixNano" :" 1730435085776944000" ,
169
- "severityNumber" :9 ,
170
- "severityText" :" INFO" ,
171
- "body" :{
172
- "stringValue" :" Order order-12035 successfully placed"
164
+ "timeUnixNano" : " 1730435085776869000" ,
165
+ "observedTimeUnixNano" : " 1730435085776944000" ,
166
+ "severityNumber" : 9 ,
167
+ "severityText" : " INFO" ,
168
+ "body" : {
169
+ "stringValue" : " Order order-12035 successfully placed"
173
170
},
174
- "attributes" :[
171
+ "attributes" : [
175
172
{
176
- "key" :" customerId" ,
177
- "value" :{
178
- "stringValue" :" customer-49"
173
+ "key" : " customerId" ,
174
+ "value" : {
175
+ "stringValue" : " customer-49"
179
176
}
180
177
},
181
178
{
182
- "key" :" thread.id" ,
183
- "value" :{
184
- "intValue" :" 44"
179
+ "key" : " thread.id" ,
180
+ "value" : {
181
+ "intValue" : " 44"
185
182
}
186
183
},
187
184
{
188
- "key" :" thread.name" ,
189
- "value" :{
190
- "stringValue" :" grpc-default-executor-1"
185
+ "key" : " thread.name" ,
186
+ "value" : {
187
+ "stringValue" : " grpc-default-executor-1"
191
188
}
192
189
}
193
190
],
194
- "flags" :1 ,
195
- "traceId" :" 42de1f0dd124e27619a9f3c10bccac1c" ,
196
- "spanId" :" 270984d03e94bb8b"
191
+ "flags" : 1 ,
192
+ "traceId" : " 42de1f0dd124e27619a9f3c10bccac1c" ,
193
+ "spanId" : " 270984d03e94bb8b"
197
194
}
198
195
]
199
196
}
200
197
],
201
- "schemaUrl" :" https://opentelemetry.io/schemas/1.24.0"
198
+ "schemaUrl" : " https://opentelemetry.io/schemas/1.24.0"
202
199
}
203
200
]
204
201
}
205
202
```
203
+
206
204
</details >
207
205
208
206
## Configure the Collector to ingest the OTLP/JSON logs
@@ -313,8 +311,8 @@ After the pipeline works end-to-end, ensure production readiness:
313
311
314
312
## Configure an OpenTelemetry Collector in Kubernetes to handle container logs
315
313
316
- To support Kubernetes and container specifics, add the built-in
317
- [ ` container ` ] ( https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/docs/operators/container.md )
314
+ To support Kubernetes and container specifics, add the built-in
315
+ [ ` container ` ] ( https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/docs/operators/container.md )
318
316
parsing step in the pipeline without needing specific mapping configuration.
319
317
320
318
Replace ` <<namespace>> ` , ` <<pod_name>> ` , and ` <<container_name>> ` with the
0 commit comments