resource

Resource is an output type that runs a resource output by its name. This output allows you to run the same configured output resource in multiple places.

# Config fields, showing default values
output:
resource: ""

Resource outputs also have the advantage of name based metrics and logging. For example, the config:

output:
broker:
pattern: fan_out
outputs:
- kafka:
addresses: [ TODO ]
topic: foo
- gcp_pubsub:
project: bar
topic: baz

Is equivalent to:

output:
broker:
pattern: fan_out
outputs:
- resource: foo
- resource: bar
resources:
outputs:
foo:
kafka:
addresses: [ TODO ]
topic: foo
bar:
gcp_pubsub:
project: bar
topic: baz

But now the metrics path of Kafka output will be resources.outputs.foo, this way of flattening observability labels becomes more useful as configs get larger and more nested.

You can find out more about resources in this document.