Skip to content

Commit 3d92547

Browse files
docs(opentelemetry source): Refresh documentation and examples (#13921)
* docs(opentelemetry source): Refresh documentation and examples * +cue fmt * allow multiple examples, and add multiple examples * add configuration_example * +tls options * +cue-fmt * +example feedback
1 parent 9b7e25c commit 3d92547

File tree

4 files changed

+88
-29
lines changed

4 files changed

+88
-29
lines changed

website/content/en/docs/reference/configuration/sources/opentelemetry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: OpenTelemetry
3-
description: Receive [OpenTelemetry](https://opentelemetry.io/) data directly from a SDK or an OpenTelemetry Collector.
3+
description: Receive [OTLP](https://opentelemetry.io/docs/reference/specification/protocol/otlp/) data through gRPC or HTTP.
44
kind: source
55
layout: component
66
tags: ["opentelemetry", "component", "source", "logs"]

website/cue/reference.cue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ _values: {
529529
// `examples` clarify values through examples. This should be used
530530
// when examples cannot be derived from the `default` or `enum`
531531
// options.
532-
examples: [#Object] | *[]
532+
examples: [#Object, ...#Object] | *[]
533533

534534
// `options` represent the child options for this option.
535535
options: #Schema

website/cue/reference/components/sources/opentelemetry.cue

Lines changed: 84 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ components: sources: opentelemetry: {
66

77
title: "OpenTelemetry"
88

9-
description: """
10-
Collect OpenTelemetry data over gRPC and HTTP (currently, only logs are supported).
11-
"""
12-
139
classes: {
1410
commonly_used: false
1511
delivery: "at_least_once"
@@ -42,7 +38,11 @@ components: sources: opentelemetry: {
4238

4339
support: {
4440
requirements: []
45-
warnings: []
41+
warnings: [
42+
"""
43+
The `opentelemetry` source only supports log events at this time.
44+
""",
45+
]
4646
notices: []
4747
}
4848

@@ -98,6 +98,32 @@ components: sources: opentelemetry: {
9898
}
9999
}
100100

101+
configuration_examples: [
102+
{
103+
title: "OTLP Defaults"
104+
configuration: {
105+
opentelemetry: {
106+
grpc: {
107+
address: "0.0.0.0:4317"
108+
tls: {
109+
enabled: true
110+
crt_file: "/etc/ssl/certs/vector.pem"
111+
key_file: "/etc/ssl/private/vector.key"
112+
}
113+
}
114+
http: {
115+
address: "0.0.0.0:4318"
116+
tls: {
117+
enabled: true
118+
crt_file: "/etc/ssl/certs/vector.pem"
119+
key_file: "/etc/ssl/private/vector.key"
120+
}
121+
}
122+
}
123+
}
124+
},
125+
]
126+
101127
outputs: [
102128
{
103129
name: "logs"
@@ -109,22 +135,46 @@ components: sources: opentelemetry: {
109135

110136
output: {
111137
logs: event: {
112-
description: "An individual event from a batch of events received through a gRPC request sent by OpenTelemetry SDK"
138+
description: "An individual log event from a batch of events received through an OTLP request"
113139
fields: {
114140
attributes: {
115141
description: "Attributes that describe the specific event occurrence."
116142
required: false
117143
common: true
118144
type: object: {
119-
examples: [{"k1": "v1"}]
145+
examples: [
146+
{
147+
"http.status.code": 500
148+
"http.url": "http://example.com"
149+
"my.custom.application.tag": "hello"
150+
},
151+
{
152+
"http.scheme": "https"
153+
"http.host": "donut.mycie.com"
154+
"http.target": "/order"
155+
"http.method": "post"
156+
"http.status_code": 500
157+
"http.flavor": "1.1"
158+
"http.user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
159+
},
160+
]
120161
}
121162
}
122163
resources: {
123164
description: "Set of attributes that describe the resource."
124165
required: false
125166
common: true
126167
type: object: {
127-
examples: [{"k1": "v1"}]
168+
examples: [
169+
{
170+
"service.name": "donut_shop"
171+
"service.version": "2.0.0"
172+
"k8s.pod.uid": "1138528c-c36e-11e9-a1a7-42010a800198"
173+
},
174+
{
175+
"container.name": "vector"
176+
},
177+
]
128178
}
129179
}
130180
message: {
@@ -133,7 +183,7 @@ components: sources: opentelemetry: {
133183
common: true
134184
type: string: {
135185
default: null
136-
examples: ["hello world"]
186+
examples: ["20200415T072306-0700 INFO I like donuts"]
137187
}
138188
}
139189
trace_id: {
@@ -142,7 +192,7 @@ components: sources: opentelemetry: {
142192
common: true
143193
type: string: {
144194
default: null
145-
examples: ["37e7518fe2e2fcaf22b41c2dac059221"]
195+
examples: ["66346462623365646437363566363230"]
146196
}
147197
}
148198
span_id: {
@@ -151,17 +201,21 @@ components: sources: opentelemetry: {
151201
common: true
152202
type: string: {
153203
default: null
154-
examples: ["05abe7510db73b88"]
204+
examples: ["43222c2d51a7abe3"]
155205
}
156206
}
157207
severity_number: {
158-
description: "Numerical value of the severity. Smaller numerical values correspond to less severe events (such as debug events), larger numerical values correspond to more severe events (such as errors and critical events)."
159-
required: false
160-
common: true
208+
description: """
209+
Numerical value of the severity.
210+
211+
Smaller numerical values correspond to less severe events (such as debug events), larger numerical values correspond to more severe events (such as errors and critical events).
212+
"""
213+
required: false
214+
common: true
161215
type: uint: {
162216
default: null
163217
unit: null
164-
examples: [9]
218+
examples: [3, 9, 17, 24]
165219
}
166220
}
167221
severity_text: {
@@ -170,7 +224,7 @@ components: sources: opentelemetry: {
170224
common: true
171225
type: string: {
172226
default: null
173-
examples: ["info"]
227+
examples: ["TRACE3", "INFO", "ERROR", "FATAL4"]
174228
}
175229
}
176230
flags: {
@@ -183,18 +237,22 @@ components: sources: opentelemetry: {
183237
}
184238
}
185239
timestamp: {
186-
description: "The UTC Datetime when the event occurred."
187-
required: true
188-
type: uint: {
189-
unit: null
190-
}
240+
description: """
241+
The UTC Datetime when the event occurred. If this value is unset, or `0`, it will be set to the `observed_timestamp` field.
242+
243+
This field is converted from the `time_unix_nano` Protobuf field.
244+
"""
245+
required: true
246+
type: timestamp: {}
191247
}
192248
observed_timestamp: {
193-
description: "The UTC Datetime when the event was observed by the collection system."
194-
required: true
195-
type: uint: {
196-
unit: null
197-
}
249+
description: """
250+
The UTC Datetime when the event was observed by the collection system. If this value is unset, or `0`, it will be set to the current time.
251+
252+
This field is converted from the `observed_time_unix_nano` Protobuf field.
253+
"""
254+
required: true
255+
type: timestamp: {}
198256
}
199257
dropped_attributes_count: {
200258
description: "Counts for attributes dropped due to collection limits."

website/cue/reference/urls.cue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ urls: {
362362
nixos: "https://nixos.org/"
363363
nixpkgs_9682: "\(github)/NixOS/nixpkgs/issues/9682"
364364
openssl: "https://www.openssl.org/"
365-
opentelemetry: "https://opentelemetry.io/"
365+
opentelemetry: "https://opentelemetry.io"
366+
opentelemetry_protocol: "\(opentelemetry)/docs/reference/specification/protocol/otlp/"
366367
order_of_ops: "\(wikipedia)/wiki/Order_of_operations"
367368
papertrail: "https://www.papertrail.com/"
368369
papertrail_syslog: "https://help.papertrailapp.com/kb/how-it-works/http-api/#submitting-log-messages"

0 commit comments

Comments
 (0)