Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(external): improve proto codecs docs #22280

Merged
merged 3 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions lib/codecs/src/decoding/format/protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,15 @@ impl ProtobufDeserializerConfig {
#[derive(Debug, Clone, PartialEq, Eq, Derivative)]
#[derivative(Default)]
pub struct ProtobufDeserializerOptions {
/// Path to desc file
/// The path to the protobuf descriptor set file.
///
/// This file is the output of `protoc -I <include path> -o <desc output path> <proto>`
///
/// You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
pub desc_file: PathBuf,

/// message type. e.g package.message
/// The name of the message type to use for serializing.
#[configurable(metadata(docs::examples = "package.Message"))]
pub message_type: String,
}

Expand Down
4 changes: 3 additions & 1 deletion lib/codecs/src/encoding/format/protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ impl ProtobufSerializerConfig {
pub struct ProtobufSerializerOptions {
/// The path to the protobuf descriptor set file.
///
/// This file is the output of `protoc -o <path> ...`
/// This file is the output of `protoc -I <include path> -o <desc output path> <proto>`
///
/// You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
#[configurable(metadata(docs::examples = "/etc/vector/protobuf_descriptor_set.desc"))]
pub desc_file: PathBuf,

Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/amqp.cue
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,9 @@ base: components: sinks: amqp: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ base: components: sinks: aws_cloudwatch_logs: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,9 @@ base: components: sinks: aws_kinesis_firehose: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,9 @@ base: components: sinks: aws_kinesis_streams: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/aws_s3.cue
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,9 @@ base: components: sinks: aws_s3: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/aws_sns.cue
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,9 @@ base: components: sinks: aws_sns: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/aws_sqs.cue
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,9 @@ base: components: sinks: aws_sqs: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,9 @@ base: components: sinks: azure_blob: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/console.cue
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,9 @@ base: components: sinks: console: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/file.cue
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ base: components: sinks: file: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,9 @@ base: components: sinks: gcp_chronicle_unstructured: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,9 @@ base: components: sinks: gcp_cloud_storage: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,9 @@ base: components: sinks: gcp_pubsub: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/http.cue
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,9 @@ base: components: sinks: http: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ base: components: sinks: humio_logs: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/kafka.cue
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,9 @@ base: components: sinks: kafka: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/loki.cue
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ base: components: sinks: loki: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/mqtt.cue
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ base: components: sinks: mqtt: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/nats.cue
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,9 @@ base: components: sinks: nats: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ base: components: sinks: opentelemetry: configuration: protocol: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,9 @@ base: components: sinks: papertrail: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/pulsar.cue
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,9 @@ base: components: sinks: pulsar: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/redis.cue
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,9 @@ base: components: sinks: redis: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
17 changes: 7 additions & 10 deletions website/cue/reference/components/sinks/base/socket.cue
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,9 @@ base: components: sinks: socket: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down Expand Up @@ -383,7 +385,7 @@ base: components: sinks: socket: configuration: {
}
framing: {
description: "Framing configuration."
relevant_when: "mode = \"tcp\" or mode = \"unix_stream\" or mode = \"unix_datagram\""
relevant_when: "mode = \"tcp\" or mode = \"unix_stream\""
required: false
type: object: options: {
character_delimited: {
Expand Down Expand Up @@ -453,13 +455,8 @@ base: components: sinks: socket: configuration: {
description: "The type of socket to use."
required: true
type: string: enum: {
tcp: "Send over TCP."
udp: "Send over UDP."
unix_datagram: """
Send over a Unix domain socket (UDS), in datagram mode.
Unavailable on macOS, due to send(2)'s apparent non-blocking behavior,
resulting in ENOBUFS errors which we currently don't handle.
"""
tcp: "Send over TCP."
udp: "Send over UDP."
unix_stream: "Send over a Unix domain socket (UDS), in stream mode."
}
}
Expand All @@ -469,7 +466,7 @@ base: components: sinks: socket: configuration: {

This should be an absolute path.
"""
relevant_when: "mode = \"unix_stream\" or mode = \"unix_datagram\""
relevant_when: "mode = \"unix_stream\""
required: true
type: string: examples: ["/path/to/socket"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ base: components: sinks: splunk_hec_logs: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/webhdfs.cue
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ base: components: sinks: webhdfs: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
4 changes: 3 additions & 1 deletion website/cue/reference/components/sinks/base/websocket.cue
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,9 @@ base: components: sinks: websocket: configuration: {
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -o <path> ...`
This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: true
type: string: examples: ["/etc/vector/protobuf_descriptor_set.desc"]
Expand Down
17 changes: 13 additions & 4 deletions website/cue/reference/components/sources/base/amqp.cue
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,23 @@ base: components: sources: amqp: configuration: {
required: false
type: object: options: {
desc_file: {
description: "Path to desc file"
required: false
description: """
The path to the protobuf descriptor set file.

This file is the output of `protoc -I <include path> -o <desc output path> <proto>`

You can read more [here](https://buf.build/docs/reference/images/#how-buf-images-work).
"""
required: false
type: string: default: ""
}
message_type: {
description: "message type. e.g package.message"
description: "The name of the message type to use for serializing."
required: false
type: string: default: ""
type: string: {
default: ""
examples: ["package.Message"]
}
}
}
}
Expand Down
Loading
Loading