From ebfae6bea5688a77ad4395995e444bbde210c999 Mon Sep 17 00:00:00 2001 From: Jon Esperanza Date: Tue, 7 Jul 2026 10:53:10 -0400 Subject: [PATCH 1/3] gcp_pubsub: add extract_tracing_map / inject_tracing_map support --- internal/impl/gcp/input_pubsub.go | 8 +++++- internal/impl/gcp/output_pubsub.go | 7 +++++- website/docs/components/inputs/gcp_pubsub.md | 25 +++++++++++++++++++ website/docs/components/outputs/gcp_pubsub.md | 16 ++++++++++++ 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/internal/impl/gcp/input_pubsub.go b/internal/impl/gcp/input_pubsub.go index 0207ab1518..408dd337e6 100644 --- a/internal/impl/gcp/input_pubsub.go +++ b/internal/impl/gcp/input_pubsub.go @@ -117,6 +117,8 @@ You can access these metadata fields using [function interpolation](/docs/config ). Description("Allows you to configure the input subscription and creates if it doesn't exist."). Advanced(), + service.NewExtractTracingSpanMappingField(), + service.NewRootSpanWithLinkField().Version("1.19.0"), ) } @@ -127,7 +129,11 @@ func init() { if err != nil { return nil, err } - return newGCPPubSubReader(pConf, mgr) + r, err := newGCPPubSubReader(pConf, mgr) + if err != nil { + return nil, err + } + return conf.WrapInputExtractTracingSpanMapping("gcp_pubsub", r) }) if err != nil { panic(err) diff --git a/internal/impl/gcp/output_pubsub.go b/internal/impl/gcp/output_pubsub.go index a92ad3d216..7351968478 100644 --- a/internal/impl/gcp/output_pubsub.go +++ b/internal/impl/gcp/output_pubsub.go @@ -74,6 +74,7 @@ pipeline: service.NewMetadataExcludeFilterField("metadata"). Optional(). Description("Specify criteria for which metadata values are sent as attributes, all are sent by default."), + service.NewInjectTracingSpanMappingField(), service.NewObjectField( "flow_control", service.NewIntField("max_outstanding_bytes"). @@ -360,7 +361,11 @@ func init() { return } - out, err = newPubSubOutput(conf) + if out, err = newPubSubOutput(conf); err != nil { + return + } + + out, err = conf.WrapBatchOutputExtractTracingSpanMapping("gcp_pubsub", out) return }); err != nil { diff --git a/website/docs/components/inputs/gcp_pubsub.md b/website/docs/components/inputs/gcp_pubsub.md index 252abd3fcc..d4bdce0e19 100644 --- a/website/docs/components/inputs/gcp_pubsub.md +++ b/website/docs/components/inputs/gcp_pubsub.md @@ -55,6 +55,8 @@ input: create_subscription: enabled: false topic: "" + extract_tracing_map: root = @ # No default (optional) + new_root_span_with_link: false # No default (optional) ``` @@ -156,4 +158,27 @@ Defines the topic that the subscription should be vinculated to. Type: `string` Default: `""` +### `extract_tracing_map` + +EXPERIMENTAL: A [Bloblang mapping](/docs/guides/bloblang/about) that attempts to extract an object containing tracing propagation information, which will then be used as the root tracing span for the message. The specification of the extracted fields must match the format used by the service wide tracer. + + +Type: `string` + +```yml +# Examples + +extract_tracing_map: root = @ + +extract_tracing_map: root = this.meta.span +``` + +### `new_root_span_with_link` + +EXPERIMENTAL: Starts a new root span with link to parent. + + +Type: `bool` +Requires version 1.19.0 or newer + diff --git a/website/docs/components/outputs/gcp_pubsub.md b/website/docs/components/outputs/gcp_pubsub.md index 08a0b70270..fb062fa341 100644 --- a/website/docs/components/outputs/gcp_pubsub.md +++ b/website/docs/components/outputs/gcp_pubsub.md @@ -66,6 +66,7 @@ output: publish_timeout: 1m0s metadata: exclude_prefixes: [] + inject_tracing_map: meta = @.assign(this) # No default (optional) flow_control: max_outstanding_bytes: -1 max_outstanding_messages: 1000 @@ -211,6 +212,21 @@ Provide a list of explicit metadata key prefixes to be excluded when adding meta Type: `array` Default: `[]` +### `inject_tracing_map` + +EXPERIMENTAL: A [Bloblang mapping](/docs/guides/bloblang/about) used to inject an object containing tracing propagation information into outbound messages. The specification of the injected fields will match the format used by the service wide tracer. + + +Type: `string` + +```yml +# Examples + +inject_tracing_map: meta = @.assign(this) + +inject_tracing_map: root.meta.span = this +``` + ### `flow_control` For a given topic, configures the PubSub client's internal buffer for messages to be published. From 09594b39efe00a512b293bdde58e6cd7fd7373f1 Mon Sep 17 00:00:00 2001 From: Jon Esperanza Date: Fri, 10 Jul 2026 11:05:27 -0400 Subject: [PATCH 2/3] gcp_pubsub: bump new_root_span_with_link version tag to 1.20.0 1.19.0 shipped without this change, so the next release carrying it is 1.20.0. --- internal/impl/gcp/input_pubsub.go | 2 +- website/docs/components/inputs/gcp_pubsub.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/impl/gcp/input_pubsub.go b/internal/impl/gcp/input_pubsub.go index 408dd337e6..418888e561 100644 --- a/internal/impl/gcp/input_pubsub.go +++ b/internal/impl/gcp/input_pubsub.go @@ -118,7 +118,7 @@ You can access these metadata fields using [function interpolation](/docs/config Description("Allows you to configure the input subscription and creates if it doesn't exist."). Advanced(), service.NewExtractTracingSpanMappingField(), - service.NewRootSpanWithLinkField().Version("1.19.0"), + service.NewRootSpanWithLinkField().Version("1.20.0"), ) } diff --git a/website/docs/components/inputs/gcp_pubsub.md b/website/docs/components/inputs/gcp_pubsub.md index d4bdce0e19..b81c02defe 100644 --- a/website/docs/components/inputs/gcp_pubsub.md +++ b/website/docs/components/inputs/gcp_pubsub.md @@ -179,6 +179,6 @@ EXPERIMENTAL: Starts a new root span with link to parent. Type: `bool` -Requires version 1.19.0 or newer +Requires version 1.20.0 or newer From ebfaf5e769162a622a2045743e91099b169c40a6 Mon Sep 17 00:00:00 2001 From: Greg Furman Date: Mon, 27 Jul 2026 18:06:17 +0300 Subject: [PATCH 3/3] chore: update to 1.21.0 --- internal/impl/gcp/input_pubsub.go | 4 ++-- website/docs/components/inputs/gcp_pubsub.md | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/impl/gcp/input_pubsub.go b/internal/impl/gcp/input_pubsub.go index 418888e561..74e1f6314c 100644 --- a/internal/impl/gcp/input_pubsub.go +++ b/internal/impl/gcp/input_pubsub.go @@ -117,8 +117,8 @@ You can access these metadata fields using [function interpolation](/docs/config ). Description("Allows you to configure the input subscription and creates if it doesn't exist."). Advanced(), - service.NewExtractTracingSpanMappingField(), - service.NewRootSpanWithLinkField().Version("1.20.0"), + service.NewExtractTracingSpanMappingField().Version("1.21.0"), + service.NewRootSpanWithLinkField().Version("1.21.0"), ) } diff --git a/website/docs/components/inputs/gcp_pubsub.md b/website/docs/components/inputs/gcp_pubsub.md index b81c02defe..9e4b1a8e3d 100644 --- a/website/docs/components/inputs/gcp_pubsub.md +++ b/website/docs/components/inputs/gcp_pubsub.md @@ -164,6 +164,7 @@ EXPERIMENTAL: A [Bloblang mapping](/docs/guides/bloblang/about) that attempts to Type: `string` +Requires version 1.21.0 or newer ```yml # Examples @@ -179,6 +180,6 @@ EXPERIMENTAL: Starts a new root span with link to parent. Type: `bool` -Requires version 1.20.0 or newer +Requires version 1.21.0 or newer