From 259494592e74932be445b0d28baa6da0f8348a48 Mon Sep 17 00:00:00 2001 From: Francisco Valente <1435136+franciscovalentecastro@users.noreply.github.com> Date: Fri, 14 Nov 2025 19:36:12 +0000 Subject: [PATCH 01/25] Implement `LoggingReceiverFluentForward` in Otel Logging. --- confgenerator/logging_receivers.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/confgenerator/logging_receivers.go b/confgenerator/logging_receivers.go index c75dd8929e..4c86c0b03c 100644 --- a/confgenerator/logging_receivers.go +++ b/confgenerator/logging_receivers.go @@ -427,6 +427,24 @@ func (r LoggingReceiverFluentForward) Components(ctx context.Context, tag string }} } +func (r LoggingReceiverFluentForward) Pipelines(ctx context.Context) ([]otel.ReceiverPipeline, error) { + return []otel.ReceiverPipeline{{ + Receiver: otel.Component{ + Type: "fluentforward", + Config: map[string]any{ + "endpoint": fmt.Sprintf("%s:%d", r.ListenHost, r.ListenPort), + }, + }, + Processors: map[string][]otel.Component{ + "logs": []otel.Component{}, + }, + + ExporterTypes: map[string]otel.ExporterType{ + "logs": otel.OTel, + }, + }}, nil +} + func init() { LoggingReceiverTypes.RegisterType(func() LoggingReceiver { return &LoggingReceiverFluentForward{} }) } From 4f57eec76b784e48471707d5558ba3287c4eb291 Mon Sep 17 00:00:00 2001 From: Francisco Valente <1435136+franciscovalentecastro@users.noreply.github.com> Date: Fri, 14 Nov 2025 19:36:32 +0000 Subject: [PATCH 02/25] Update otelopscol with `fluentforward` otel receiver. --- submodules/opentelemetry-operations-collector | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/opentelemetry-operations-collector b/submodules/opentelemetry-operations-collector index 8ceed6a23d..108f0b4b16 160000 --- a/submodules/opentelemetry-operations-collector +++ b/submodules/opentelemetry-operations-collector @@ -1 +1 @@ -Subproject commit 8ceed6a23db8053470bb5b2a87d21043b1b8655b +Subproject commit 108f0b4b1604d5b669c69565555984183d41f212 From 9eaa3860bc52dd39e840710f2761f9c9c973c488 Mon Sep 17 00:00:00 2001 From: Francisco Valente <1435136+franciscovalentecastro@users.noreply.github.com> Date: Fri, 14 Nov 2025 19:36:46 +0000 Subject: [PATCH 03/25] Add `otel_logging` to `TestFluentForwardLog`. --- integration_test/ops_agent_test/main_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_test/ops_agent_test/main_test.go b/integration_test/ops_agent_test/main_test.go index 6d6e5c6acc..087502f83b 100644 --- a/integration_test/ops_agent_test/main_test.go +++ b/integration_test/ops_agent_test/main_test.go @@ -2148,7 +2148,7 @@ func TestTCPLog(t *testing.T) { func TestFluentForwardLog(t *testing.T) { t.Parallel() - gce.RunForEachImage(t, func(t *testing.T, imageSpec string) { + RunForEachImageAndFeatureFlag(t, []string{OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() ctx, logger, vm := setupMainLogAndVM(t, imageSpec) @@ -2164,7 +2164,7 @@ func TestFluentForwardLog(t *testing.T) { fluent_pipeline: receivers: [fluent_logs] ` - if err := agents.SetupOpsAgent(ctx, logger, vm, config); err != nil { + if err := SetupOpsAgentWithFeatureFlag(ctx, logger, vm, config, feature); err != nil { t.Fatal(err) } From 3409ae098290502f142a0a732f235b1b73200beb Mon Sep 17 00:00:00 2001 From: Francisco Valente <1435136+franciscovalentecastro@users.noreply.github.com> Date: Fri, 14 Nov 2025 19:37:00 +0000 Subject: [PATCH 04/25] Add `logging-otel-receiver_forward` confgenerator test. --- .../EXPERIMENTAL_FEATURES | 1 + .../0f15dbe303dc7122d43443c9a4c31632.lua | 28 + .../4d6012ff003886818fb9b9285b4af962.lua | 19 + .../5fc5f42c16c9e1ab8292e3d42f74f3be.lua | 49 + .../b4a0dead382dce7b4fe011d3f59fdb6d.lua | 17 + .../linux-gpu/enabled_receivers_otlp.json | 1 + .../linux-gpu/feature_tracking_otlp.json | 1 + .../golden/linux-gpu/features.yaml | 20 + .../golden/linux-gpu/fluent_bit_main.conf | 153 ++ .../golden/linux-gpu/fluent_bit_parser.conf | 13 + .../golden/linux-gpu/otel.yaml | 840 +++++++++++ .../0f15dbe303dc7122d43443c9a4c31632.lua | 28 + .../4d6012ff003886818fb9b9285b4af962.lua | 19 + .../5fc5f42c16c9e1ab8292e3d42f74f3be.lua | 49 + .../b4a0dead382dce7b4fe011d3f59fdb6d.lua | 17 + .../golden/linux/enabled_receivers_otlp.json | 1 + .../golden/linux/feature_tracking_otlp.json | 1 + .../golden/linux/features.yaml | 20 + .../golden/linux/fluent_bit_main.conf | 153 ++ .../golden/linux/fluent_bit_parser.conf | 13 + .../golden/linux/otel.yaml | 800 +++++++++++ .../0f15dbe303dc7122d43443c9a4c31632.lua | 28 + .../4d6012ff003886818fb9b9285b4af962.lua | 19 + .../5fc5f42c16c9e1ab8292e3d42f74f3be.lua | 49 + .../b4a0dead382dce7b4fe011d3f59fdb6d.lua | 17 + .../windows-2012/enabled_receivers_otlp.json | 1 + .../windows-2012/feature_tracking_otlp.json | 1 + .../golden/windows-2012/features.yaml | 20 + .../golden/windows-2012/fluent_bit_main.conf | 153 ++ .../windows-2012/fluent_bit_parser.conf | 13 + .../golden/windows-2012/otel.yaml | 1247 +++++++++++++++++ .../0f15dbe303dc7122d43443c9a4c31632.lua | 28 + .../4d6012ff003886818fb9b9285b4af962.lua | 19 + .../5fc5f42c16c9e1ab8292e3d42f74f3be.lua | 49 + .../b4a0dead382dce7b4fe011d3f59fdb6d.lua | 17 + .../windows/enabled_receivers_otlp.json | 1 + .../golden/windows/feature_tracking_otlp.json | 1 + .../golden/windows/features.yaml | 20 + .../golden/windows/fluent_bit_main.conf | 153 ++ .../golden/windows/fluent_bit_parser.conf | 13 + .../golden/windows/otel.yaml | 1247 +++++++++++++++++ .../logging-otel-receiver_forward/input.yaml | 25 + .../linux-gpu/feature_tracking_otlp.json | 2 +- .../golden/linux-gpu/features.yaml | 2 +- .../golden/linux/feature_tracking_otlp.json | 2 +- .../golden/linux/features.yaml | 2 +- .../windows-2012/feature_tracking_otlp.json | 2 +- .../golden/windows-2012/features.yaml | 2 +- .../golden/windows/feature_tracking_otlp.json | 2 +- .../golden/windows/features.yaml | 2 +- .../linux-gpu/feature_tracking_otlp.json | 2 +- .../golden/linux-gpu/features.yaml | 2 +- .../golden/linux/feature_tracking_otlp.json | 2 +- .../golden/linux/features.yaml | 2 +- .../windows-2012/feature_tracking_otlp.json | 2 +- .../golden/windows-2012/features.yaml | 2 +- .../golden/windows/feature_tracking_otlp.json | 2 +- .../golden/windows/features.yaml | 2 +- .../linux-gpu/feature_tracking_otlp.json | 2 +- .../golden/linux-gpu/features.yaml | 2 +- .../golden/linux/feature_tracking_otlp.json | 2 +- .../golden/linux/features.yaml | 2 +- .../windows-2012/feature_tracking_otlp.json | 2 +- .../golden/windows-2012/features.yaml | 2 +- .../golden/windows/feature_tracking_otlp.json | 2 +- .../golden/windows/features.yaml | 2 +- .../linux-gpu/feature_tracking_otlp.json | 2 +- .../golden/linux-gpu/features.yaml | 2 +- .../golden/linux/feature_tracking_otlp.json | 2 +- .../golden/linux/features.yaml | 2 +- .../windows-2012/feature_tracking_otlp.json | 2 +- .../golden/windows-2012/features.yaml | 2 +- .../golden/windows/feature_tracking_otlp.json | 2 +- .../golden/windows/features.yaml | 2 +- 74 files changed, 5396 insertions(+), 32 deletions(-) create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/EXPERIMENTAL_FEATURES create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/0f15dbe303dc7122d43443c9a4c31632.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/4d6012ff003886818fb9b9285b4af962.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/5fc5f42c16c9e1ab8292e3d42f74f3be.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/b4a0dead382dce7b4fe011d3f59fdb6d.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/enabled_receivers_otlp.json create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/feature_tracking_otlp.json create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/features.yaml create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/fluent_bit_main.conf create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/fluent_bit_parser.conf create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/otel.yaml create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux/0f15dbe303dc7122d43443c9a4c31632.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux/4d6012ff003886818fb9b9285b4af962.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux/5fc5f42c16c9e1ab8292e3d42f74f3be.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux/b4a0dead382dce7b4fe011d3f59fdb6d.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux/enabled_receivers_otlp.json create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux/feature_tracking_otlp.json create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux/features.yaml create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux/fluent_bit_main.conf create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux/fluent_bit_parser.conf create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux/otel.yaml create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows-2012/0f15dbe303dc7122d43443c9a4c31632.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows-2012/4d6012ff003886818fb9b9285b4af962.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows-2012/5fc5f42c16c9e1ab8292e3d42f74f3be.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows-2012/b4a0dead382dce7b4fe011d3f59fdb6d.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows-2012/enabled_receivers_otlp.json create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows-2012/feature_tracking_otlp.json create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows-2012/features.yaml create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows-2012/fluent_bit_main.conf create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows-2012/fluent_bit_parser.conf create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows-2012/otel.yaml create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows/0f15dbe303dc7122d43443c9a4c31632.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows/4d6012ff003886818fb9b9285b4af962.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows/5fc5f42c16c9e1ab8292e3d42f74f3be.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows/b4a0dead382dce7b4fe011d3f59fdb6d.lua create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows/enabled_receivers_otlp.json create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows/feature_tracking_otlp.json create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows/features.yaml create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows/fluent_bit_main.conf create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows/fluent_bit_parser.conf create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/windows/otel.yaml create mode 100644 confgenerator/testdata/goldens/logging-otel-receiver_forward/input.yaml diff --git a/confgenerator/testdata/goldens/logging-otel-receiver_forward/EXPERIMENTAL_FEATURES b/confgenerator/testdata/goldens/logging-otel-receiver_forward/EXPERIMENTAL_FEATURES new file mode 100644 index 0000000000..d934c8d47b --- /dev/null +++ b/confgenerator/testdata/goldens/logging-otel-receiver_forward/EXPERIMENTAL_FEATURES @@ -0,0 +1 @@ +otel_logging diff --git a/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/0f15dbe303dc7122d43443c9a4c31632.lua b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/0f15dbe303dc7122d43443c9a4c31632.lua new file mode 100644 index 0000000000..dda27aee97 --- /dev/null +++ b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/0f15dbe303dc7122d43443c9a4c31632.lua @@ -0,0 +1,28 @@ + +function process(tag, timestamp, record) +local v = "ops-agent"; +(function(value) +if record["logging.googleapis.com/labels"] == nil +then +record["logging.googleapis.com/labels"] = {} +end +record["logging.googleapis.com/labels"]["agent.googleapis.com/health/agentKind"] = value +end)(v) +local v = "latest"; +(function(value) +if record["logging.googleapis.com/labels"] == nil +then +record["logging.googleapis.com/labels"] = {} +end +record["logging.googleapis.com/labels"]["agent.googleapis.com/health/agentVersion"] = value +end)(v) +local v = "v1"; +(function(value) +if record["logging.googleapis.com/labels"] == nil +then +record["logging.googleapis.com/labels"] = {} +end +record["logging.googleapis.com/labels"]["agent.googleapis.com/health/schemaVersion"] = value +end)(v) +return 2, timestamp, record +end diff --git a/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/4d6012ff003886818fb9b9285b4af962.lua b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/4d6012ff003886818fb9b9285b4af962.lua new file mode 100644 index 0000000000..c225be24d5 --- /dev/null +++ b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/4d6012ff003886818fb9b9285b4af962.lua @@ -0,0 +1,19 @@ + +function process(tag, timestamp, record) +local __field_0 = (function() +return record["severity"] +end)(); +(function(value) +record["severity"] = value +end)(nil); +local v = __field_0; +if v == "debug" then v = "DEBUG" +elseif v == "error" then v = "ERROR" +elseif v == "info" then v = "INFO" +elseif v == "warn" then v = "WARNING" +end +(function(value) +record["logging.googleapis.com/severity"] = value +end)(v) +return 2, timestamp, record +end diff --git a/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/5fc5f42c16c9e1ab8292e3d42f74f3be.lua b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/5fc5f42c16c9e1ab8292e3d42f74f3be.lua new file mode 100644 index 0000000000..c5465182b5 --- /dev/null +++ b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/5fc5f42c16c9e1ab8292e3d42f74f3be.lua @@ -0,0 +1,49 @@ + + function shallow_merge(record, parsedRecord) + -- If no exiting record exists + if (record == nil) then + return parsedRecord + end + + for k, v in pairs(parsedRecord) do + record[k] = v + end + + return record +end + +function merge(record, parsedRecord) + -- If no exiting record exists + if record == nil then + return parsedRecord + end + + -- Potentially overwrite or merge the original records. + for k, v in pairs(parsedRecord) do + -- If there is no conflict + if k == "logging.googleapis.com/logName" then + -- Ignore the parsed payload since the logName is controlled + -- by the OpsAgent. + elseif k == "logging.googleapis.com/labels" then + -- LogEntry.labels are basically a map[string]string and so only require a + -- shallow merge (one level deep merge). + record[k] = shallow_merge(record[k], v) + else + record[k] = v + end + end + + return record +end + +function parser_merge_record(tag, timestamp, record) + originalPayload = record["logging.googleapis.com/__tmp"] + if originalPayload == nil then + return 0, timestamp, record + end + + -- Remove original payload + record["logging.googleapis.com/__tmp"] = nil + record = merge(originalPayload, record) + return 2, timestamp, record +end diff --git a/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/b4a0dead382dce7b4fe011d3f59fdb6d.lua b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/b4a0dead382dce7b4fe011d3f59fdb6d.lua new file mode 100644 index 0000000000..6263563b66 --- /dev/null +++ b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/b4a0dead382dce7b4fe011d3f59fdb6d.lua @@ -0,0 +1,17 @@ + +function parser_nest(tag, timestamp, record) + local nestedRecord = {} + local parseKey = "message" + for k, v in pairs(record) do + if k ~= parseKey then + nestedRecord[k] = v + end + end + + local result = {} + result[parseKey] = record[parseKey] + result["logging.googleapis.com/__tmp"] = nestedRecord + + return 2, timestamp, result +end + diff --git a/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/enabled_receivers_otlp.json b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/enabled_receivers_otlp.json new file mode 100644 index 0000000000..39d4ea695e --- /dev/null +++ b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/enabled_receivers_otlp.json @@ -0,0 +1 @@ +{"resourceMetrics":[{"resource":{"attributes":[{"key":"k","value":{"stringValue":"v"}}]},"scopeMetrics":[{"scope":{},"metrics":[{"name":"agent.googleapis.com/agent/ops_agent/enabled_receivers","gauge":{"dataPoints":[{"attributes":[{"key":"telemetry_type","value":{"stringValue":"metrics"}},{"key":"receiver_type","value":{"stringValue":"hostmetrics"}}],"asInt":"1"},{"attributes":[{"key":"telemetry_type","value":{"stringValue":"logs"}},{"key":"receiver_type","value":{"stringValue":"files"}}],"asInt":"1"},{"attributes":[{"key":"telemetry_type","value":{"stringValue":"logs"}},{"key":"receiver_type","value":{"stringValue":"fluent_forward"}}],"asInt":"1"}]}}]}]}]} \ No newline at end of file diff --git a/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/feature_tracking_otlp.json b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/feature_tracking_otlp.json new file mode 100644 index 0000000000..8b39f75292 --- /dev/null +++ b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/feature_tracking_otlp.json @@ -0,0 +1 @@ +{"resourceMetrics":[{"resource":{"attributes":[{"key":"k","value":{"stringValue":"v"}}]},"scopeMetrics":[{"scope":{},"metrics":[{"name":"agent.googleapis.com/agent/internal/ops/feature_tracking","gauge":{"dataPoints":[{"attributes":[{"key":"module","value":{"stringValue":"logging"}},{"key":"feature","value":{"stringValue":"service:pipelines"}},{"key":"key","value":{"stringValue":"default_pipeline_overridden"}},{"key":"value","value":{"stringValue":"false"}}],"asInt":"1"},{"attributes":[{"key":"module","value":{"stringValue":"metrics"}},{"key":"feature","value":{"stringValue":"service:pipelines"}},{"key":"key","value":{"stringValue":"default_pipeline_overridden"}},{"key":"value","value":{"stringValue":"false"}}],"asInt":"1"},{"attributes":[{"key":"module","value":{"stringValue":"global"}},{"key":"feature","value":{"stringValue":"default:self_log"}},{"key":"key","value":{"stringValue":"default_self_log_file_collection"}},{"key":"value","value":{"stringValue":"true"}}],"asInt":"1"},{"attributes":[{"key":"module","value":{"stringValue":"logging"}},{"key":"feature","value":{"stringValue":"service:otel_logging"}},{"key":"key","value":{"stringValue":"otel_logging_supported_config"}},{"key":"value","value":{"stringValue":"true"}}],"asInt":"1"},{"attributes":[{"key":"module","value":{"stringValue":"logging"}},{"key":"feature","value":{"stringValue":"receivers:fluent_forward"}},{"key":"key","value":{"stringValue":"[0].enabled"}},{"key":"value","value":{"stringValue":"true"}}],"asInt":"1"}]}}]}]}]} \ No newline at end of file diff --git a/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/features.yaml b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/features.yaml new file mode 100644 index 0000000000..4d3e317a15 --- /dev/null +++ b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/features.yaml @@ -0,0 +1,20 @@ +- module: logging + feature: service:pipelines + key: default_pipeline_overridden + value: "false" +- module: metrics + feature: service:pipelines + key: default_pipeline_overridden + value: "false" +- module: global + feature: default:self_log + key: default_self_log_file_collection + value: "true" +- module: logging + feature: service:otel_logging + key: otel_logging_supported_config + value: "true" +- module: logging + feature: receivers:fluent_forward + key: "[0].enabled" + value: "true" diff --git a/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/fluent_bit_main.conf b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/fluent_bit_main.conf new file mode 100644 index 0000000000..9d767d886b --- /dev/null +++ b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/fluent_bit_main.conf @@ -0,0 +1,153 @@ +@SET buffers_dir=/var/lib/google-cloud-ops-agent/fluent-bit/buffers +@SET logs_dir=/var/log/google-cloud-ops-agent + +[SERVICE] + Daemon off + Flush 1 + Log_Level info + dns.resolver legacy + storage.backlog.mem_limit 50M + storage.checksum off + storage.max_chunks_up 128 + storage.metrics on + storage.sync normal + +[INPUT] + Name fluentbit_metrics + Scrape_Interval 60 + Scrape_On_Start True + +[INPUT] + Dummy {"code": "LogPingOpsAgent", "severity": "DEBUG"} + Interval_NSec 0 + Interval_Sec 600 + Name dummy + Tag ops-agent-health + +[INPUT] + Buffer_Chunk_Size 512k + Buffer_Max_Size 2M + DB ${buffers_dir}/ops-agent-fluent-bit + DB.locking true + Key message + Mem_Buf_Limit 10M + Name tail + Path ${logs_dir}/subagents/logging-module.log + Read_from_Head True + Rotate_Wait 30 + Skip_Long_Lines On + Tag ops-agent-fluent-bit + storage.type memory + +[INPUT] + Buffer_Chunk_Size 512k + Buffer_Max_Size 2M + DB ${buffers_dir}/ops-agent-health + DB.locking true + Key message + Mem_Buf_Limit 10M + Name tail + Path ${logs_dir}/health-checks.log + Read_from_Head True + Rotate_Wait 30 + Skip_Long_Lines On + Tag ops-agent-health + storage.type memory + +[FILTER] + Match ops-agent-fluent-bit + Name lua + call parser_nest + script b4a0dead382dce7b4fe011d3f59fdb6d.lua + +[FILTER] + Key_Name message + Match ops-agent-fluent-bit + Name parser + Preserve_Key True + Reserve_Data True + Parser ops-agent-fluent-bit.fluent-bit-self-log-regex-parsing + +[FILTER] + Match ops-agent-fluent-bit + Name lua + call parser_merge_record + script 5fc5f42c16c9e1ab8292e3d42f74f3be.lua + +[FILTER] + Match ops-agent-health + Name lua + call parser_nest + script b4a0dead382dce7b4fe011d3f59fdb6d.lua + +[FILTER] + Key_Name message + Match ops-agent-health + Name parser + Reserve_Data True + Parser ops-agent-health.health-checks-json + +[FILTER] + Match ops-agent-health + Name lua + call parser_merge_record + script 5fc5f42c16c9e1ab8292e3d42f74f3be.lua + +[FILTER] + Match ops-agent-health + Name grep + Regex severity INFO|ERROR|WARNING|DEBUG|info|error|warning|debug + +[FILTER] + Match ops-agent-fluent-bit + Name rewrite_tag + Rule message \[error\]\s\[lib\]\sbackend\sfailed ops-agent-health true + +[FILTER] + Name modify + Match ops-agent-health + Condition Key_value_matches message \[error\]\s\[lib\]\sbackend\sfailed + Set code LogPipelineErr + Set message "[Runtime Check] Result: FAIL, Error code: LogPipelineErr, Failure: Ops Agent logging pipeline failed, Solution: Refer to provided documentation link., Resource: https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/troubleshoot-find-info" + +[FILTER] + Match ops-agent-fluent-bit + Name rewrite_tag + Rule message \[error\]\s\[parser\]\scannot\sparse ops-agent-health true + +[FILTER] + Name modify + Match ops-agent-health + Condition Key_value_matches message \[error\]\s\[parser\]\scannot\sparse + Set code LogParseErr + Set message "[Runtime Check] Result: WARNING, Error code: LogParseErr, Failure: Ops Agent failed to parse logs, Solution: Refer to provided documentation link., Resource: https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/troubleshoot-find-info" + +[FILTER] + Match ops-agent-health + Name lua + call process + script 0f15dbe303dc7122d43443c9a4c31632.lua + +[FILTER] + Match ops-agent-* + Name lua + call process + script 4d6012ff003886818fb9b9285b4af962.lua + +[OUTPUT] + Match_Regex ^(ops-agent-health|ops-agent-fluent-bit)$ + Name stackdriver + Retry_Limit 3 + http_request_key logging.googleapis.com/httpRequest + net.connect_timeout_log_error False + resource gce_instance + stackdriver_agent Google-Cloud-Ops-Agent-Logging/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) + tls On + tls.verify Off + workers 8 + +[OUTPUT] + Match * + Name prometheus_exporter + host 0.0.0.0 + port 20202 diff --git a/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/fluent_bit_parser.conf b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/fluent_bit_parser.conf new file mode 100644 index 0000000000..e6c4f531ea --- /dev/null +++ b/confgenerator/testdata/goldens/logging-otel-receiver_forward/golden/linux-gpu/fluent_bit_parser.conf @@ -0,0 +1,13 @@ +[PARSER] + Format regex + Name ops-agent-fluent-bit.fluent-bit-self-log-regex-parsing + Regex (?\[[ ]*(?