From c00428aaca3e94c1309b334944d742bda289a745 Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Fri, 16 Jan 2026 00:15:15 +0000 Subject: [PATCH 01/49] expanded the ConvertToOtlpExporter --- confgenerator/confgenerator.go | 31 ++++++++++++++++-------------- confgenerator/logging_receivers.go | 12 ++++++------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/confgenerator/confgenerator.go b/confgenerator/confgenerator.go index d5d0db869c..3e697739dc 100644 --- a/confgenerator/confgenerator.go +++ b/confgenerator/confgenerator.go @@ -75,22 +75,25 @@ func ConvertToOtlpExporter(pipeline otel.ReceiverPipeline, ctx context.Context, if !expOtlpExporter { return pipeline } - _, err := pipeline.ExporterTypes["metrics"] - if !err { - return pipeline - } - pipeline.ExporterTypes["metrics"] = otel.OTLP - pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.GCPProjectID(resource.ProjectName())) - if isSystem { - pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.MetricsRemoveInstrumentationLibraryLabelsAttributes()) - pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.MetricsRemoveServiceAttributes()) + if _, ok := pipeline.ExporterTypes["metrics"]; ok { + pipeline.ExporterTypes["metrics"] = otel.OTLP + pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.GCPProjectID(resource.ProjectName())) + if isSystem { + pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.MetricsRemoveInstrumentationLibraryLabelsAttributes()) + pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.MetricsRemoveServiceAttributes()) + } + // The OTLP exporter doesn't batch by default like the googlecloud.* exporters. We need this to avoid the API point limits. + pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.Batch()) + if isPrometheus { + pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.MetricUnknownCounter()) + pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.MetricStartTime()) + } } - // The OTLP exporter doesn't batch by default like the googlecloud.* exporters. We need this to avoid the API point limits. - pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.Batch()) - if isPrometheus { - pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.MetricUnknownCounter()) - pipeline.Processors["metrics"] = append(pipeline.Processors["metrics"], otel.MetricStartTime()) + if _, ok := pipeline.ExporterTypes["logs"]; ok { + pipeline.ExporterTypes["logs"] = otel.OTLP + pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.GCPProjectID(resource.ProjectName())) + pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.Batch()) } return pipeline } diff --git a/confgenerator/logging_receivers.go b/confgenerator/logging_receivers.go index 6bece3f0b3..a2f43b97b0 100644 --- a/confgenerator/logging_receivers.go +++ b/confgenerator/logging_receivers.go @@ -232,7 +232,7 @@ func (r LoggingReceiverFilesMixin) Pipelines(ctx context.Context) ([]otel.Receiv }) } receiver_config["operators"] = operators - return []otel.ReceiverPipeline{{ + return []otel.ReceiverPipeline{ConvertToOtlpExporter(otel.ReceiverPipeline{ Receiver: otel.Component{ Type: "filelog", Config: receiver_config, @@ -243,7 +243,7 @@ func (r LoggingReceiverFilesMixin) Pipelines(ctx context.Context) ([]otel.Receiv ExporterTypes: map[string]otel.ExporterType{ "logs": otel.OTel, }, - }}, nil + }, ctx, false, false)}, nil } func (r LoggingReceiverFilesMixin) MergeInternalLoggingProcessor(p InternalLoggingProcessor) (InternalLoggingReceiver, InternalLoggingProcessor) { @@ -356,7 +356,7 @@ func (r LoggingReceiverSyslog) Pipelines(ctx context.Context) ([]otel.ReceiverPi "protocol": "rfc5424", } - return []otel.ReceiverPipeline{{ + return []otel.ReceiverPipeline{ConvertToOtlpExporter(otel.ReceiverPipeline{ Receiver: otel.Component{ Type: "syslog", Config: config, @@ -368,7 +368,7 @@ func (r LoggingReceiverSyslog) Pipelines(ctx context.Context) ([]otel.ReceiverPi ExporterTypes: map[string]otel.ExporterType{ "logs": otel.OTel, }, - }}, nil + }, ctx, false, false)}, nil } func init() { @@ -1001,7 +1001,7 @@ func (r LoggingReceiverSystemd) Pipelines(ctx context.Context) ([]otel.ReceiverP return nil, err } - return []otel.ReceiverPipeline{{ + return []otel.ReceiverPipeline{ConvertToOtlpExporter(otel.ReceiverPipeline{ Receiver: otel.Component{ Type: "journald", Config: receiver_config, @@ -1013,7 +1013,7 @@ func (r LoggingReceiverSystemd) Pipelines(ctx context.Context) ([]otel.ReceiverP ExporterTypes: map[string]otel.ExporterType{ "logs": otel.OTel, }, - }}, nil + }, ctx, false, false)}, nil } func init() { From 90e9358e55ee250cde93069072700e09d0da8459 Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Fri, 16 Jan 2026 18:27:22 +0000 Subject: [PATCH 02/49] Verified the following: 1. otlp_exporter + otlp_logging, the generated otel.yaml only has one logging pipeline with otlp receiver and otlp exporter. 2. otlp_exporter + otel_logging, the generated otel.yaml has all the logging pipeline using otlp exporter. 3. otlp_exporter + otlp_logging + otel_logging, the generated otel.yaml has all the logging pipelines using otlp exporter. 4. otlp_logging + otel_logging, the generated otel.yaml has all the logging pipelines using the google cloud exporter. --- apps/otlp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/otlp.go b/apps/otlp.go index 6ceb70e637..834036ab7f 100644 --- a/apps/otlp.go +++ b/apps/otlp.go @@ -137,7 +137,7 @@ func (r ReceiverOTLP) Pipelines(ctx context.Context) ([]otel.ReceiverPipeline, e receiverPipelineType, metricsRDM, metricsProcessors := r.metricsProcessors(ctx) - return []otel.ReceiverPipeline{{ + return []otel.ReceiverPipeline{confgenerator.ConvertToOtlpExporter(otel.ReceiverPipeline{ ExporterTypes: map[string]otel.ExporterType{ "metrics": receiverPipelineType, "traces": otel.OTel, @@ -163,7 +163,7 @@ func (r ReceiverOTLP) Pipelines(ctx context.Context) ([]otel.ReceiverPipeline, e "traces": otel.SetIfMissing, "logs": otel.SetIfMissing, }, - }}, nil + }, ctx, false)}, nil } func init() { From cafb5d860246e6183b527a42f9df4f1856eb706e Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Fri, 16 Jan 2026 21:27:17 +0000 Subject: [PATCH 03/49] instrumentation_source and instrumentation_version --- confgenerator/otel/ottl/ottl.go | 4 ++++ confgenerator/otel/processors.go | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/confgenerator/otel/ottl/ottl.go b/confgenerator/otel/ottl/ottl.go index e16e6d3452..8fa9ae8e12 100644 --- a/confgenerator/otel/ottl/ottl.go +++ b/confgenerator/otel/ottl/ottl.go @@ -234,6 +234,10 @@ func IsNotNil(a Value) Value { return valuef(`%s != nil`, a) } +func IsNotEmptyString(a Value) Value { + return valuef(`%s != ""`, a) +} + // ExtractCountMetric creates a new metric based on the count value of a Histogram metric func ExtractCountMetric(monotonic bool, metricName string) Statements { monotonicStr := "false" diff --git a/confgenerator/otel/processors.go b/confgenerator/otel/processors.go index deb1009d06..34dd1ed7c0 100644 --- a/confgenerator/otel/processors.go +++ b/confgenerator/otel/processors.go @@ -676,6 +676,12 @@ func GCPProjectID(projectID string) Component { ) } +func DisableOtlpRoundTrip() Component { + return ResourceTransform( + map[string]string{"gcp.internal.omit_otlp": "true"}, false, + ) +} + // MetricUnknownCounter is necessary to handle prometheus unknown type metrics // go/ops-agent-otlp-migration func MetricUnknownCounter() Component { @@ -689,6 +695,13 @@ func MetricUnknownCounter() Component { }) } +func InstrumentationScope() Component { + return Transform("log", "log", ottl.NewStatements( + ottl.LValue{"attributes", "instrumentation_source"}.SetIf(ottl.RValue("instrumentation_scope.name"), ottl.IsNotEmptyString(ottl.RValue("instrumentation_scope.name"))), + ottl.LValue{"attributes", "instrumentation_version"}.SetIf(ottl.RValue("instrumentation_scope.version"), ottl.IsNotEmptyString(ottl.RValue("instrumentation_scope.version"))), + )) +} + func Batch() Component { return Component{ Type: "batch", From c41b129ee250dda17117e3e909c8ee1d5da4a2e1 Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Mon, 19 Jan 2026 16:15:30 +0000 Subject: [PATCH 04/49] flatten gcp.source_location logRecord attributes --- confgenerator/otel/processors.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/confgenerator/otel/processors.go b/confgenerator/otel/processors.go index 34dd1ed7c0..24ae625f88 100644 --- a/confgenerator/otel/processors.go +++ b/confgenerator/otel/processors.go @@ -702,6 +702,15 @@ func InstrumentationScope() Component { )) } +func FlattenSourceLocation() Component { + return Transform("log", "log", ottl.NewStatements( + ottl.LValue{"attributes", "code.file.path"}.SetIf(ottl.RValue(`attributes["gcp.source_location"]["file"]`), ottl.IsNotNil(ottl.RValue(`attributes["gcp.source_location"]["file"]`))), + ottl.LValue{"attributes", "code.function.name"}.SetIf(ottl.RValue(`attributes["gcp.source_location"]["func"]`), ottl.IsNotNil(ottl.RValue(`attributes["gcp.source_location"]["func"]`))), + ottl.LValue{"attributes", "code.line.number"}.SetIf(ottl.RValue(`attributes["gcp.source_location"]["line"]`), ottl.IsNotNil(ottl.RValue(`attributes["gcp.source_location"]["line"]`))), + ottl.LValue{"attributes", "gcp.source_location"}.Delete(), + )) +} + func Batch() Component { return Component{ Type: "batch", From f99c79811790190891a7fd938ac5d40cba39cee4 Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Wed, 21 Jan 2026 22:16:53 +0000 Subject: [PATCH 05/49] created a temp otlp exporter config for connecting to UTR logging staging endpoint --- confgenerator/confgenerator.go | 27 +++++++++++++++++++++++---- confgenerator/otel/modular.go | 3 +++ confgenerator/otel/processors.go | 9 +++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/confgenerator/confgenerator.go b/confgenerator/confgenerator.go index 3e697739dc..ece0b487a4 100644 --- a/confgenerator/confgenerator.go +++ b/confgenerator/confgenerator.go @@ -109,6 +109,24 @@ func otlpExporter(userAgent string) otel.Component { "headers": map[string]string{ "User-Agent": userAgent, }, + "encoding": "json", + }, + } +} + +// This will merge with the otlp exporter above once the prod UTR logging endpoint is ready. +func otlpExporterUTRLoggingStaging(userAgent string) otel.Component { + return otel.Component{ + Type: "otlphttp", + Config: map[string]interface{}{ + "endpoint": "https://test-us-central2-telemetry.sandbox.googleapis.com", + "auth": map[string]interface{}{ + "authenticator": "googleclientauth", + }, + "headers": map[string]string{ + "User-Agent": userAgent, + }, + "encoding": "json", }, } } @@ -168,10 +186,11 @@ func (uc *UnifiedConfig) GenerateOtelConfig(ctx context.Context, outDir string) Pipelines: pipelines, Extensions: extensions, Exporters: map[otel.ExporterType]otel.Component{ - otel.System: googleCloudExporter(userAgent, false, false), - otel.OTel: googleCloudExporter(userAgent, true, true), - otel.GMP: googleManagedPrometheusExporter(userAgent), - otel.OTLP: otlpExporter(userAgent), + otel.System: googleCloudExporter(userAgent, false, false), + otel.OTel: googleCloudExporter(userAgent, true, true), + otel.GMP: googleManagedPrometheusExporter(userAgent), + otel.OTLP: otlpExporter(userAgent), + otel.OTLPStagingUTR: otlpExporterUTRLoggingStaging(userAgent), }, }.Generate(ctx) if err != nil { diff --git a/confgenerator/otel/modular.go b/confgenerator/otel/modular.go index c0cd79f851..32124081cb 100644 --- a/confgenerator/otel/modular.go +++ b/confgenerator/otel/modular.go @@ -38,6 +38,7 @@ const ( System GMP OTLP + OTLPStagingUTR ) const ( Override ResourceDetectionMode = iota @@ -53,6 +54,8 @@ func (t ExporterType) Name() string { return "otel" } else if t == OTLP { return "otlp" + } else if t == OTLPStagingUTR { + return "otlp-utr-logging" } else { panic("unknown ExporterType") } diff --git a/confgenerator/otel/processors.go b/confgenerator/otel/processors.go index 24ae625f88..f9b6c356c8 100644 --- a/confgenerator/otel/processors.go +++ b/confgenerator/otel/processors.go @@ -711,6 +711,15 @@ func FlattenSourceLocation() Component { )) } +// This processor copies the service.* attributes from the resource to the log attributes, if they exist. +func CopyServiceResourceLabels() Component { + return Transform("log", "log", ottl.NewStatements( + ottl.LValue{"attributes", "service.name"}.SetIf(ottl.RValue(`resource.attributes["service.name"]`), ottl.IsNotNil(ottl.RValue(`resource.attributes["service.name"]`))), + ottl.LValue{"attributes", "service.namespace"}.SetIf(ottl.RValue(`resource.attributes["service.namespace"]`), ottl.IsNotNil(ottl.RValue(`resource.attributes["service.namespace"]`))), + ottl.LValue{"attributes", "service.instance.id"}.SetIf(ottl.RValue(`resource.attributes["service.instance.id"]`), ottl.IsNotNil(ottl.RValue(`resource.attributes["service.instance.id"]`))), + )) +} + func Batch() Component { return Component{ Type: "batch", From 1bdd9b851b7d9e58629a7b697a14c08021eb263c Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Wed, 21 Jan 2026 22:22:35 +0000 Subject: [PATCH 06/49] removed changes to otlpexpoter for UTR metrics to avoid goldens difference --- confgenerator/confgenerator.go | 1 - 1 file changed, 1 deletion(-) diff --git a/confgenerator/confgenerator.go b/confgenerator/confgenerator.go index ece0b487a4..54da1ae534 100644 --- a/confgenerator/confgenerator.go +++ b/confgenerator/confgenerator.go @@ -109,7 +109,6 @@ func otlpExporter(userAgent string) otel.Component { "headers": map[string]string{ "User-Agent": userAgent, }, - "encoding": "json", }, } } From e9e08f301f00faa7ac65d769c97e70ae9e0dad8c Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Thu, 22 Jan 2026 19:29:47 +0000 Subject: [PATCH 07/49] resolved conflicts --- confgenerator/confgenerator.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/confgenerator/confgenerator.go b/confgenerator/confgenerator.go index 54da1ae534..7d7ee1cef5 100644 --- a/confgenerator/confgenerator.go +++ b/confgenerator/confgenerator.go @@ -91,10 +91,14 @@ func ConvertToOtlpExporter(pipeline otel.ReceiverPipeline, ctx context.Context, } if _, ok := pipeline.ExporterTypes["logs"]; ok { - pipeline.ExporterTypes["logs"] = otel.OTLP + pipeline.ExporterTypes["logs"] = otel.OTLPStagingUTR pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.GCPProjectID(resource.ProjectName())) pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.Batch()) + pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.DisableOtlpRoundTrip()) + pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.InstrumentationScope()) + pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.CopyServiceResourceLabels()) } + return pipeline } From 29f85756db87cc69990fcd8e734d78989e56fa07 Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Thu, 22 Jan 2026 19:31:39 +0000 Subject: [PATCH 08/49] fixed conflicts --- apps/otlp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/otlp.go b/apps/otlp.go index 834036ab7f..e2887fc6a0 100644 --- a/apps/otlp.go +++ b/apps/otlp.go @@ -163,7 +163,7 @@ func (r ReceiverOTLP) Pipelines(ctx context.Context) ([]otel.ReceiverPipeline, e "traces": otel.SetIfMissing, "logs": otel.SetIfMissing, }, - }, ctx, false)}, nil + }, ctx, false, false)}, nil } func init() { From f166eafd86ac81432261ee7cf58766ca8ff50454 Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Thu, 22 Jan 2026 19:15:21 +0000 Subject: [PATCH 09/49] extend integration testsuite to support experiment combo testing --- integration_test/agents/agents.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration_test/agents/agents.go b/integration_test/agents/agents.go index 1a7f12bc1e..555044b9cc 100644 --- a/integration_test/agents/agents.go +++ b/integration_test/agents/agents.go @@ -1236,6 +1236,7 @@ const ( OtelLoggingFeatureFlag = "otel_logging" OtlpHttpExporterFeatureFlag = "otlp_exporter" DefaultFeatureFlag = "default" + UTRLoggingFlagTriplet = "otel_logging,otlp_exporter,otlp_logging" ) // setExperimentalFeatures sets the EXPERIMENTAL_FEATURES environment variable. @@ -1264,7 +1265,7 @@ func setExperimentalOtelLoggingInConfig(config string) string { // SetupOpsAgentWithFeatureFlag configures the VM and the config depending on the selected feature flag. func SetupOpsAgentWithFeatureFlag(ctx context.Context, logger *log.Logger, vm *gce.VM, config string, feature string) error { switch feature { - case OtelLoggingFeatureFlag: + case OtelLoggingFeatureFlag, UTRLoggingFlagTriplet: // Set feature flag in config. if config == "" { config = defaultOtelLoggingConfig() From a8ca86084134b0b8acc7a4d004b6a5f659f0a0a4 Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Fri, 23 Jan 2026 22:28:28 +0000 Subject: [PATCH 10/49] added temp processors to work around bugs in UTR --- confgenerator/confgenerator.go | 2 ++ confgenerator/otel/processors.go | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/confgenerator/confgenerator.go b/confgenerator/confgenerator.go index 7d7ee1cef5..e5f4cb0c1f 100644 --- a/confgenerator/confgenerator.go +++ b/confgenerator/confgenerator.go @@ -97,6 +97,8 @@ func ConvertToOtlpExporter(pipeline otel.ReceiverPipeline, ctx context.Context, pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.DisableOtlpRoundTrip()) pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.InstrumentationScope()) pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.CopyServiceResourceLabels()) + pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.ConvertSeverityTextToLowercase()) + pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.AddResourceType()) } return pipeline diff --git a/confgenerator/otel/processors.go b/confgenerator/otel/processors.go index f9b6c356c8..6e996a1f24 100644 --- a/confgenerator/otel/processors.go +++ b/confgenerator/otel/processors.go @@ -676,6 +676,13 @@ func GCPProjectID(projectID string) Component { ) } +// temp processor, will delete when UTR logging recognizes cloud.platform resource attribute +func AddResourceType() Component { + return ResourceTransform( + map[string]string{"gcp.resource_type": "gce_instance"}, false, + ) +} + func DisableOtlpRoundTrip() Component { return ResourceTransform( map[string]string{"gcp.internal.omit_otlp": "true"}, false, @@ -720,6 +727,14 @@ func CopyServiceResourceLabels() Component { )) } +// A temp processor, will delete when UTR logging supports case-insensitive severity text parsing. +func ConvertSeverityTextToLowercase() Component { + return Transform("log", "log", []ottl.Statement{ + `set(severity_text, ToLowerCase(severity_text)) where severity_text != nil`, + }) + +} + func Batch() Component { return Component{ Type: "batch", From 15a12393cd76af5b54cb3cf99241a9d959d1ccb5 Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Mon, 26 Jan 2026 22:05:58 +0000 Subject: [PATCH 11/49] updated confgenerator test goldens --- .../golden/linux-gpu/otel.yaml | 16 +++++++++++----- .../golden/linux/otel.yaml | 16 +++++++++++----- .../golden/windows-2012/otel.yaml | 16 +++++++++++----- .../golden/windows/otel.yaml | 16 +++++++++++----- 4 files changed, 44 insertions(+), 20 deletions(-) diff --git a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux-gpu/otel.yaml b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux-gpu/otel.yaml index 6c890e564f..4a5ce4b42b 100644 --- a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux-gpu/otel.yaml +++ b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux-gpu/otel.yaml @@ -15,10 +15,6 @@ exporters: service_resource_labels: true skip_create_descriptor: true user_agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) - googlemanagedprometheus: - metric: - add_metric_suffixes: false - user_agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) otlphttp/otlp: auth: authenticator: googleclientauth @@ -37,6 +33,9 @@ processors: batch/hostmetrics_6: send_batch_max_size: 200 send_batch_size: 200 + batch/otlp_4: + send_batch_max_size: 200 + send_batch_size: 200 cumulativetodelta/loggingmetrics_4: include: match_type: strict @@ -618,6 +617,11 @@ processors: - action: insert key: gcp.project_id value: test-project + resource/otlp_3: + attributes: + - action: insert + key: gcp.project_id + value: test-project resourcedetection/_global_0: detectors: - gcp @@ -834,11 +838,13 @@ service: - prometheus/agent_prometheus metrics/otlp_otlp: exporters: - - googlemanagedprometheus + - otlphttp/otlp processors: - resourcedetection/otlp_0 - transform/otlp_1 - groupbyattrs/otlp_2 + - resource/otlp_3 + - batch/otlp_4 receivers: - otlp/otlp traces/traces_otlp_otlp: diff --git a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux/otel.yaml b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux/otel.yaml index 9e3c11a338..f9156189a9 100644 --- a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux/otel.yaml +++ b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux/otel.yaml @@ -15,10 +15,6 @@ exporters: service_resource_labels: true skip_create_descriptor: true user_agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) - googlemanagedprometheus: - metric: - add_metric_suffixes: false - user_agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) otlphttp/otlp: auth: authenticator: googleclientauth @@ -34,6 +30,9 @@ processors: batch/hostmetrics_6: send_batch_max_size: 200 send_batch_size: 200 + batch/otlp_4: + send_batch_max_size: 200 + send_batch_size: 200 cumulativetodelta/loggingmetrics_4: include: match_type: strict @@ -581,6 +580,11 @@ processors: - action: insert key: gcp.project_id value: test-project + resource/otlp_3: + attributes: + - action: insert + key: gcp.project_id + value: test-project resourcedetection/_global_0: detectors: - gcp @@ -767,11 +771,13 @@ service: - prometheus/agent_prometheus metrics/otlp_otlp: exporters: - - googlemanagedprometheus + - otlphttp/otlp processors: - resourcedetection/otlp_0 - transform/otlp_1 - groupbyattrs/otlp_2 + - resource/otlp_3 + - batch/otlp_4 receivers: - otlp/otlp traces/traces_otlp_otlp: diff --git a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows-2012/otel.yaml b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows-2012/otel.yaml index e908281da8..e6d470ac44 100644 --- a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows-2012/otel.yaml +++ b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows-2012/otel.yaml @@ -15,10 +15,6 @@ exporters: service_resource_labels: true skip_create_descriptor: true user_agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=windows;ShortName=win_platform;ShortVersion=win_platform_version) - googlemanagedprometheus: - metric: - add_metric_suffixes: false - user_agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=windows;ShortName=win_platform;ShortVersion=win_platform_version) otlphttp/otlp: auth: authenticator: googleclientauth @@ -40,6 +36,9 @@ processors: batch/mssql_5: send_batch_max_size: 200 send_batch_size: 200 + batch/otlp_4: + send_batch_max_size: 200 + send_batch_size: 200 casttosum/iis_1: metrics: - agent.googleapis.com/iis/network/transferred_bytes_count @@ -663,6 +662,11 @@ processors: - action: insert key: gcp.project_id value: test-project + resource/otlp_3: + attributes: + - action: insert + key: gcp.project_id + value: test-project resourcedetection/_global_0: detectors: - gcp @@ -956,11 +960,13 @@ service: - prometheus/agent_prometheus metrics/otlp_otlp: exporters: - - googlemanagedprometheus + - otlphttp/otlp processors: - resourcedetection/otlp_0 - transform/otlp_1 - groupbyattrs/otlp_2 + - resource/otlp_3 + - batch/otlp_4 receivers: - otlp/otlp traces/traces_otlp_otlp: diff --git a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows/otel.yaml b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows/otel.yaml index e908281da8..e6d470ac44 100644 --- a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows/otel.yaml +++ b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows/otel.yaml @@ -15,10 +15,6 @@ exporters: service_resource_labels: true skip_create_descriptor: true user_agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=windows;ShortName=win_platform;ShortVersion=win_platform_version) - googlemanagedprometheus: - metric: - add_metric_suffixes: false - user_agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=windows;ShortName=win_platform;ShortVersion=win_platform_version) otlphttp/otlp: auth: authenticator: googleclientauth @@ -40,6 +36,9 @@ processors: batch/mssql_5: send_batch_max_size: 200 send_batch_size: 200 + batch/otlp_4: + send_batch_max_size: 200 + send_batch_size: 200 casttosum/iis_1: metrics: - agent.googleapis.com/iis/network/transferred_bytes_count @@ -663,6 +662,11 @@ processors: - action: insert key: gcp.project_id value: test-project + resource/otlp_3: + attributes: + - action: insert + key: gcp.project_id + value: test-project resourcedetection/_global_0: detectors: - gcp @@ -956,11 +960,13 @@ service: - prometheus/agent_prometheus metrics/otlp_otlp: exporters: - - googlemanagedprometheus + - otlphttp/otlp processors: - resourcedetection/otlp_0 - transform/otlp_1 - groupbyattrs/otlp_2 + - resource/otlp_3 + - batch/otlp_4 receivers: - otlp/otlp traces/traces_otlp_otlp: From 1e457b0bf2bb173b0993815e53d6a52c43a58d7f Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Wed, 11 Feb 2026 18:50:24 +0000 Subject: [PATCH 12/49] removed temp code --- confgenerator/confgenerator.go | 18 +----------------- confgenerator/otel/modular.go | 3 --- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/confgenerator/confgenerator.go b/confgenerator/confgenerator.go index aa12c6b27c..62d538e81c 100644 --- a/confgenerator/confgenerator.go +++ b/confgenerator/confgenerator.go @@ -107,7 +107,7 @@ func ConvertToOtlpExporter(pipeline otel.ReceiverPipeline, ctx context.Context, } if _, ok := pipeline.ExporterTypes["logs"]; ok { - pipeline.ExporterTypes["logs"] = otel.OTLPStagingUTR + pipeline.ExporterTypes["logs"] = otel.OTLP pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.GCPProjectID(resource.ProjectName())) pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.DisableOtlpRoundTrip()) pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.InstrumentationScope()) @@ -129,22 +129,6 @@ func otlpExporter(userAgent string) otel.Component { "headers": map[string]string{ "User-Agent": userAgent, }, - }, - } -} - -// This will merge with the otlp exporter above once the prod UTR logging endpoint is ready. -func otlpExporterUTRLoggingStaging(userAgent string) otel.Component { - return otel.Component{ - Type: "otlphttp", - Config: map[string]interface{}{ - "endpoint": "https://test-us-central2-telemetry.sandbox.googleapis.com", - "auth": map[string]interface{}{ - "authenticator": "googleclientauth", - }, - "headers": map[string]string{ - "User-Agent": userAgent, - }, "encoding": "json", }, } diff --git a/confgenerator/otel/modular.go b/confgenerator/otel/modular.go index 77296b6991..d2a738383a 100644 --- a/confgenerator/otel/modular.go +++ b/confgenerator/otel/modular.go @@ -38,7 +38,6 @@ const ( System GMP OTLP - OTLPStagingUTR Logging ) const ( @@ -57,8 +56,6 @@ func (t ExporterType) Name() string { return "logging" } else if t == OTLP { return "otlp" - } else if t == OTLPStagingUTR { - return "otlp-utr-logging" } else { panic("unknown ExporterType") } From bf0894a0488b833c7e2dfed474cace82463736d9 Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Wed, 11 Feb 2026 20:21:21 +0000 Subject: [PATCH 13/49] updated integration tests to run against UTR logging --- integration_test/ops_agent_test/main_test.go | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/integration_test/ops_agent_test/main_test.go b/integration_test/ops_agent_test/main_test.go index 3347e7a5fd..1eab74d50c 100644 --- a/integration_test/ops_agent_test/main_test.go +++ b/integration_test/ops_agent_test/main_test.go @@ -719,7 +719,7 @@ Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <[REDACTED_EM func TestCustomLogFile(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() ctx, logger, vm := setupMainLogAndVM(t, imageSpec) logPath := logPathForImage(vm.ImageSpec) @@ -893,7 +893,7 @@ func TestKillChildJobsWhenPluginServerProcessTerminates(t *testing.T) { func TestCustomLogFormat(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() ctx, logger, vm := setupMainLogAndVM(t, imageSpec) @@ -1324,7 +1324,7 @@ func TestProcessorOrder(t *testing.T) { func TestSyslogTCP(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() if gce.IsWindows(imageSpec) { t.SkipNow() @@ -1389,7 +1389,7 @@ func TestSyslogTCP(t *testing.T) { func TestSyslogUDP(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() if gce.IsWindows(imageSpec) { t.SkipNow() @@ -1433,7 +1433,7 @@ func TestSyslogUDP(t *testing.T) { func TestExcludeLogs(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() ctx, logger, vm := setupMainLogAndVM(t, imageSpec) file1 := fmt.Sprintf("%s_1", logPathForImage(vm.ImageSpec)) @@ -1522,7 +1522,7 @@ func TestExcludeLogs(t *testing.T) { func TestExcludeLogsParseJsonOrder(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() ctx, logger, vm := setupMainLogAndVM(t, imageSpec) file1 := fmt.Sprintf("%s_1", logPathForImage(vm.ImageSpec)) @@ -1601,7 +1601,7 @@ func TestExcludeLogsParseJsonOrder(t *testing.T) { func TestExcludeLogsModifyFieldsOrder(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() ctx, logger, vm := setupMainLogAndVM(t, imageSpec) file1 := fmt.Sprintf("%s_1", logPathForImage(vm.ImageSpec)) @@ -1695,7 +1695,7 @@ func TestExcludeLogsModifyFieldsOrder(t *testing.T) { func TestModifyFields(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() ctx, logger, vm := setupMainLogAndVM(t, imageSpec) file1 := fmt.Sprintf("%s_1", logPathForImage(vm.ImageSpec)) @@ -1881,7 +1881,7 @@ func TestResourceNameLabel(t *testing.T) { func TestLogFilePathLabel(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() ctx, logger, vm := setupMainLogAndVM(t, imageSpec) file1 := fmt.Sprintf("%s_1", logPathForImage(vm.ImageSpec)) @@ -2145,7 +2145,7 @@ func TestFluentForwardLog(t *testing.T) { func TestWindowsEventLog(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() if !gce.IsWindows(imageSpec) { t.SkipNow() @@ -2190,7 +2190,7 @@ func TestWindowsEventLog(t *testing.T) { func TestWindowsEventLogV1UnsupportedChannel(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() if !gce.IsWindows(imageSpec) { t.SkipNow() @@ -2225,7 +2225,7 @@ func TestWindowsEventLogV1UnsupportedChannel(t *testing.T) { func TestWindowsEventLogV2(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() if !gce.IsWindows(imageSpec) { t.SkipNow() @@ -2473,7 +2473,7 @@ func hasKeyWithValueType[V any](m map[string]any, k string) bool { func TestWindowsEventLogWithNonDefaultTimeZone(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() if !gce.IsWindows(imageSpec) { t.SkipNow() @@ -2508,7 +2508,7 @@ func TestWindowsEventLogWithNonDefaultTimeZone(t *testing.T) { func TestSystemdLog(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() if gce.IsWindows(imageSpec) { t.SkipNow() @@ -2697,7 +2697,7 @@ func testDefaultMetrics(ctx context.Context, t *testing.T, logger *log.Logger, v func TestDefaultMetricsNoProxy(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.OtlpHttpExporterFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet, agents.OtlpHttpExporterFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() ctx, logger, vm := setupMainLogAndVM(t, imageSpec) if err := agents.SetupOpsAgentWithFeatureFlag(ctx, logger, vm, "", feature); err != nil { @@ -2715,7 +2715,7 @@ func TestDefaultMetricsNoProxy(t *testing.T) { // go/sdi-integ-test#proxy-testing func TestDefaultMetricsWithProxy(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.OtlpHttpExporterFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet, agents.OtlpHttpExporterFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() if !gce.IsWindows(imageSpec) { t.Skip("Proxy test is currently only supported on windows.") @@ -5955,7 +5955,7 @@ func TestLogCompression(t *testing.T) { func TestFileOffset(t *testing.T) { t.Parallel() - RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag}, func(t *testing.T, imageSpec string, feature string) { + RunForEachImageAndFeatureFlag(t, []string{agents.OtelLoggingFeatureFlag, agents.UTRLoggingFlagTriplet}, func(t *testing.T, imageSpec string, feature string) { t.Parallel() ctx, logger, vm := setupMainLogAndVM(t, imageSpec) From df6a461856ea3b19a9e4d01f0752de878e1d470c Mon Sep 17 00:00:00 2001 From: XuechunHou Date: Fri, 20 Feb 2026 15:22:42 +0000 Subject: [PATCH 14/49] updated confgenerator test --- confgenerator/confgenerator.go | 2 - .../golden/linux-gpu/otel.yaml | 1 + .../golden/linux/otel.yaml | 1 + .../golden/windows-2012/otel.yaml | 1 + .../golden/windows/otel.yaml | 1 + .../golden/linux-gpu/otel.yaml | 1 + .../golden/linux/otel.yaml | 1 + .../golden/windows-2012/otel.yaml | 1 + .../golden/windows/otel.yaml | 1 + .../output_otel.yaml | 41 +-------- .../output_otel.yaml | 9 +- .../output_otel.yaml | 51 ++--------- .../output_otel.yaml | 4 +- .../output_otel.yaml | 82 ++--------------- .../output_otel.yaml | 8 +- .../output_otel.yaml | 8 +- .../output_otel.yaml | 1 + .../output_otel.yaml | 40 ++++----- .../output_otel.yaml | 40 ++++----- .../output_otel.yaml | 90 +++---------------- .../output_otel.yaml | 61 ++----------- .../output_otel.yaml | 24 ++--- 22 files changed, 105 insertions(+), 364 deletions(-) diff --git a/confgenerator/confgenerator.go b/confgenerator/confgenerator.go index 5ba21e2989..1f08aa6780 100644 --- a/confgenerator/confgenerator.go +++ b/confgenerator/confgenerator.go @@ -112,8 +112,6 @@ func ConvertToOtlpExporter(pipeline otel.ReceiverPipeline, ctx context.Context, pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.DisableOtlpRoundTrip()) pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.InstrumentationScope()) pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.CopyServiceResourceLabels()) - pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.ConvertSeverityTextToLowercase()) - pipeline.Processors["logs"] = append(pipeline.Processors["logs"], otel.AddResourceType()) } return pipeline } diff --git a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux-gpu/otel.yaml b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux-gpu/otel.yaml index 58a2b8102d..8c473a6d25 100644 --- a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux-gpu/otel.yaml +++ b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux-gpu/otel.yaml @@ -19,6 +19,7 @@ exporters: auth: authenticator: googleclientauth balancer_name: pick_first + encoding: json endpoint: telemetry.googleapis.com:443 headers: User-Agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) diff --git a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux/otel.yaml b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux/otel.yaml index 8088407bf0..4080e60199 100644 --- a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux/otel.yaml +++ b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/linux/otel.yaml @@ -19,6 +19,7 @@ exporters: auth: authenticator: googleclientauth balancer_name: pick_first + encoding: json endpoint: telemetry.googleapis.com:443 headers: User-Agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) diff --git a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows-2012/otel.yaml b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows-2012/otel.yaml index a576701773..f6b45c8b43 100644 --- a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows-2012/otel.yaml +++ b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows-2012/otel.yaml @@ -19,6 +19,7 @@ exporters: auth: authenticator: googleclientauth balancer_name: pick_first + encoding: json endpoint: telemetry.googleapis.com:443 headers: User-Agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=windows;ShortName=win_platform;ShortVersion=win_platform_version) diff --git a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows/otel.yaml b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows/otel.yaml index a576701773..f6b45c8b43 100644 --- a/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows/otel.yaml +++ b/confgenerator/testdata/goldens/combined-receiver_otlp_otlphttp/golden/windows/otel.yaml @@ -19,6 +19,7 @@ exporters: auth: authenticator: googleclientauth balancer_name: pick_first + encoding: json endpoint: telemetry.googleapis.com:443 headers: User-Agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=windows;ShortName=win_platform;ShortVersion=win_platform_version) diff --git a/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/linux-gpu/otel.yaml b/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/linux-gpu/otel.yaml index 53c9d4062d..dc08d65617 100644 --- a/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/linux-gpu/otel.yaml +++ b/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/linux-gpu/otel.yaml @@ -11,6 +11,7 @@ exporters: auth: authenticator: googleclientauth balancer_name: pick_first + encoding: json endpoint: telemetry.googleapis.com:443 headers: User-Agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) diff --git a/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/linux/otel.yaml b/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/linux/otel.yaml index d7030e9ec8..88747c0808 100644 --- a/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/linux/otel.yaml +++ b/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/linux/otel.yaml @@ -11,6 +11,7 @@ exporters: auth: authenticator: googleclientauth balancer_name: pick_first + encoding: json endpoint: telemetry.googleapis.com:443 headers: User-Agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=linux;ShortName=linux_platform;ShortVersion=linux_platform_version) diff --git a/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/windows-2012/otel.yaml b/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/windows-2012/otel.yaml index 51c90437ed..1af58134e0 100644 --- a/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/windows-2012/otel.yaml +++ b/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/windows-2012/otel.yaml @@ -11,6 +11,7 @@ exporters: auth: authenticator: googleclientauth balancer_name: pick_first + encoding: json endpoint: telemetry.googleapis.com:443 headers: User-Agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=windows;ShortName=win_platform;ShortVersion=win_platform_version) diff --git a/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/windows/otel.yaml b/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/windows/otel.yaml index 51c90437ed..1af58134e0 100644 --- a/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/windows/otel.yaml +++ b/confgenerator/testdata/goldens/metrics-exporter_prometheus_otlp/golden/windows/otel.yaml @@ -11,6 +11,7 @@ exporters: auth: authenticator: googleclientauth balancer_name: pick_first + encoding: json endpoint: telemetry.googleapis.com:443 headers: User-Agent: Google-Cloud-Ops-Agent-Metrics/latest (BuildDistro=build_distro;Platform=windows;ShortName=win_platform;ShortVersion=win_platform_version) diff --git a/transformation_test/testdata/logging_processor-apache-access/output_otel.yaml b/transformation_test/testdata/logging_processor-apache-access/output_otel.yaml index b1cbf926c6..10b6ebad94 100644 --- a/transformation_test/testdata/logging_processor-apache-access/output_otel.yaml +++ b/transformation_test/testdata/logging_processor-apache-access/output_otel.yaml @@ -1,12 +1,5 @@ - entries: - - httpRequest: - protocol: HTTP/1.1 - remoteIp: 127.0.0.1 - requestMethod: GET - requestUrl: /apache_pb.gif - responseSize: "2326" - status: 200 - jsonPayload: {} + - jsonPayload: {} labels: compute.googleapis.com/resource_name: hostname logging.googleapis.com/instrumentation_source: agent.googleapis.com/apache_access @@ -17,16 +10,7 @@ zone: test-zone type: gce_instance timestamp: 2000-10-10T20:55:36Z - - httpRequest: - protocol: HTTP/1.1 - referer: http://www.example.com/start.html - remoteIp: 192.168.1.100 - requestMethod: GET - requestUrl: /apache_pb.gif - responseSize: "2326" - status: 200 - userAgent: Mozilla/4.08 [en] (Win98; I ;Nav) - jsonPayload: + - jsonPayload: user: frank labels: compute.googleapis.com/resource_name: hostname @@ -38,16 +22,7 @@ zone: test-zone type: gce_instance timestamp: 2000-10-10T20:55:36Z - - httpRequest: - protocol: HTTP/1.1 - referer: https://example.com/register - remoteIp: 10.0.0.1 - requestMethod: POST - requestUrl: /api/users - responseSize: "445" - status: 201 - userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 - jsonPayload: {} + - jsonPayload: {} labels: compute.googleapis.com/resource_name: hostname logging.googleapis.com/instrumentation_source: agent.googleapis.com/apache_access @@ -58,15 +33,7 @@ zone: test-zone type: gce_instance timestamp: 2021-08-26T16:50:15Z - - httpRequest: - protocol: HTTP/1.1 - remoteIp: 203.0.113.4 - requestMethod: GET - requestUrl: /admin/dashboard - responseSize: "1234" - status: 403 - userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 - jsonPayload: + - jsonPayload: user: admin labels: compute.googleapis.com/resource_name: hostname diff --git a/transformation_test/testdata/logging_processor-couchdb/output_otel.yaml b/transformation_test/testdata/logging_processor-couchdb/output_otel.yaml index 000f7c82c9..20ba8af105 100644 --- a/transformation_test/testdata/logging_processor-couchdb/output_otel.yaml +++ b/transformation_test/testdata/logging_processor-couchdb/output_otel.yaml @@ -1,12 +1,5 @@ - entries: - - httpRequest: - protocol: HTTP/1.1 - remoteIp: 127.0.0.1 - requestMethod: PUT - responseSize: "16" - serverIp: localhost:5984 - status: 201 - jsonPayload: + - jsonPayload: host: nohost level: notice message: otelu PUT /oteld 201 ok 16 diff --git a/transformation_test/testdata/logging_processor-jetty-access/output_otel.yaml b/transformation_test/testdata/logging_processor-jetty-access/output_otel.yaml index d79a4f929c..557582de13 100644 --- a/transformation_test/testdata/logging_processor-jetty-access/output_otel.yaml +++ b/transformation_test/testdata/logging_processor-jetty-access/output_otel.yaml @@ -1,12 +1,5 @@ - entries: - - httpRequest: - protocol: HTTP/1.1 - remoteIp: 127.0.0.1 - requestMethod: GET - requestUrl: /index.html - responseSize: "2326" - status: 200 - jsonPayload: {} + - jsonPayload: {} labels: compute.googleapis.com/resource_name: hostname logging.googleapis.com/instrumentation_source: agent.googleapis.com/jetty_access @@ -17,15 +10,7 @@ zone: test-zone type: gce_instance timestamp: 2000-10-10T20:55:36Z - - httpRequest: - protocol: HTTP/1.1 - remoteIp: "::1" - requestMethod: GET - requestUrl: / - responseSize: "10701" - status: 200 - userAgent: curl/7.64.0 - jsonPayload: {} + - jsonPayload: {} labels: compute.googleapis.com/resource_name: hostname logging.googleapis.com/instrumentation_source: agent.googleapis.com/jetty_access @@ -36,16 +21,7 @@ zone: test-zone type: gce_instance timestamp: 2021-08-26T16:49:43Z - - httpRequest: - protocol: HTTP/1.1 - referer: http://www.example.com/start.html - remoteIp: 192.168.1.100 - requestMethod: GET - requestUrl: /forbidden.html?something=something - responseSize: "2326" - status: 403 - userAgent: Mozilla/4.08 [en] (Win98; I ;Nav) - jsonPayload: + - jsonPayload: user: frank labels: compute.googleapis.com/resource_name: hostname @@ -57,16 +33,7 @@ zone: test-zone type: gce_instance timestamp: 2000-10-10T20:55:36Z - - httpRequest: - protocol: HTTP/1.1 - referer: https://example.com/register - remoteIp: 10.0.0.1 - requestMethod: POST - requestUrl: /api/users - responseSize: "445" - status: 201 - userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 - jsonPayload: {} + - jsonPayload: {} labels: compute.googleapis.com/resource_name: hostname logging.googleapis.com/instrumentation_source: agent.googleapis.com/jetty_access @@ -77,15 +44,7 @@ zone: test-zone type: gce_instance timestamp: 2021-08-26T16:50:15Z - - httpRequest: - protocol: HTTP/1.1 - remoteIp: 203.0.113.4 - requestMethod: GET - requestUrl: /admin/dashboard - responseSize: "1234" - status: 403 - userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 - jsonPayload: + - jsonPayload: user: admin labels: compute.googleapis.com/resource_name: hostname diff --git a/transformation_test/testdata/logging_processor-local_timezone/output_otel.yaml b/transformation_test/testdata/logging_processor-local_timezone/output_otel.yaml index 08bdbfedf8..94d709fed1 100644 --- a/transformation_test/testdata/logging_processor-local_timezone/output_otel.yaml +++ b/transformation_test/testdata/logging_processor-local_timezone/output_otel.yaml @@ -26,7 +26,7 @@ timestamp: now partialSuccess: true - collector_errors: - - caller: ottl@v0.145.0/parser.go:410 + - caller: ottl@v0.138.0/parser.go:410 error: "parsing time \"unparsable time\" as \"%Y-%m-%dT%H:%M\": cannot parse \"unparsable time\" as \"%Y\"" level: warn msg: failed to execute statement @@ -37,5 +37,5 @@ resource: service.instance.id: test-service-instance-id service.name: otelopscol - service.version: v0.145.0 + service.version: v0.138.0 statement: set(log.cache["__time_valid"], true) where ((log.body != nil and log.body["time"] != nil) and Time(log.body["time"], "%Y-%m-%dT%H:%M") != nil) diff --git a/transformation_test/testdata/logging_processor-nginx-access/output_otel.yaml b/transformation_test/testdata/logging_processor-nginx-access/output_otel.yaml index 06bc469a6f..4b7a766bb1 100644 --- a/transformation_test/testdata/logging_processor-nginx-access/output_otel.yaml +++ b/transformation_test/testdata/logging_processor-nginx-access/output_otel.yaml @@ -1,12 +1,5 @@ - entries: - - httpRequest: - protocol: HTTP/1.1 - remoteIp: 127.0.0.1 - requestMethod: GET - requestUrl: /index.html - responseSize: "2326" - status: 200 - jsonPayload: {} + - jsonPayload: {} labels: compute.googleapis.com/resource_name: hostname logging.googleapis.com/instrumentation_source: agent.googleapis.com/nginx_access @@ -17,15 +10,7 @@ zone: test-zone type: gce_instance timestamp: 2000-10-10T20:55:36Z - - httpRequest: - protocol: HTTP/1.1 - remoteIp: "::1" - requestMethod: GET - requestUrl: / - responseSize: "10701" - status: 200 - userAgent: curl/7.64.0 - jsonPayload: {} + - jsonPayload: {} labels: compute.googleapis.com/resource_name: hostname logging.googleapis.com/instrumentation_source: agent.googleapis.com/nginx_access @@ -36,16 +21,7 @@ zone: test-zone type: gce_instance timestamp: 2021-08-26T16:49:43Z - - httpRequest: - protocol: HTTP/1.1 - referer: http://www.example.com/start.html - remoteIp: 192.168.1.100 - requestMethod: GET - requestUrl: /apache_pb.gif - responseSize: "2326" - status: 200 - userAgent: Mozilla/4.08 [en] (Win98; I ;Nav) - jsonPayload: + - jsonPayload: user: frank labels: compute.googleapis.com/resource_name: hostname @@ -57,16 +33,7 @@ zone: test-zone type: gce_instance timestamp: 2000-10-10T20:55:36Z - - httpRequest: - protocol: HTTP/1.1 - referer: https://example.com/register - remoteIp: 10.0.0.1 - requestMethod: POST - requestUrl: /api/users - responseSize: "445" - status: 201 - userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 - jsonPayload: {} + - jsonPayload: {} labels: compute.googleapis.com/resource_name: hostname logging.googleapis.com/instrumentation_source: agent.googleapis.com/nginx_access @@ -77,15 +44,7 @@ zone: test-zone type: gce_instance timestamp: 2021-08-26T16:50:15Z - - httpRequest: - protocol: HTTP/1.1 - remoteIp: 203.0.113.4 - requestMethod: GET - requestUrl: /admin/dashboard - responseSize: "1234" - status: 403 - userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 - jsonPayload: + - jsonPayload: user: admin labels: compute.googleapis.com/resource_name: hostname @@ -97,16 +56,7 @@ zone: test-zone type: gce_instance timestamp: 2021-08-26T16:51:22Z - - httpRequest: - protocol: HTTP/1.1 - referer: https://example.com/ - remoteIp: 192.168.0.50 - requestMethod: GET - requestUrl: /images/logo.png - responseSize: "512" - status: 404 - userAgent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 - jsonPayload: {} + - jsonPayload: {} labels: compute.googleapis.com/resource_name: hostname logging.googleapis.com/instrumentation_source: agent.googleapis.com/nginx_access @@ -117,16 +67,7 @@ zone: test-zone type: gce_instance timestamp: 2021-08-26T16:52:10Z - - httpRequest: - protocol: HTTP/1.1 - referer: https://api.example.com/docs - remoteIp: 172.16.0.1 - requestMethod: PUT - requestUrl: /api/data/123 - responseSize: "789" - status: 500 - userAgent: python-requests/2.25.1 - jsonPayload: {} + - jsonPayload: {} labels: compute.googleapis.com/resource_name: hostname logging.googleapis.com/instrumentation_source: agent.googleapis.com/nginx_access @@ -137,14 +78,7 @@ zone: test-zone type: gce_instance timestamp: 2021-08-26T16:53:05Z - - httpRequest: - protocol: HTTP/1.1 - remoteIp: 10.1.1.1 - requestMethod: DELETE - requestUrl: /api/items/456 - status: 204 - userAgent: PostmanRuntime/7.28.0 - jsonPayload: + - jsonPayload: user: user123 labels: compute.googleapis.com/resource_name: hostname diff --git a/transformation_test/testdata/logging_processor-oracledb_alert/output_otel.yaml b/transformation_test/testdata/logging_processor-oracledb_alert/output_otel.yaml index f98269d5c6..d9a55b3b9d 100644 --- a/transformation_test/testdata/logging_processor-oracledb_alert/output_otel.yaml +++ b/transformation_test/testdata/logging_processor-oracledb_alert/output_otel.yaml @@ -35,7 +35,7 @@ timestamp: now partialSuccess: true - collector_errors: - - caller: ottl@v0.145.0/parser.go:410 + - caller: ottl@v0.138.0/parser.go:410 error: "parsing time \"2021-12-21T10:19:47.339827-05:00\" as \"%Y-%m-%dT%H:%M:%S.%L%z\": cannot parse \"-05:00\" as \"%z\"" level: warn msg: failed to execute statement @@ -46,9 +46,9 @@ resource: service.instance.id: test-service-instance-id service.name: otelopscol - service.version: v0.145.0 + service.version: v0.138.0 statement: set(log.cache["__time_valid"], true) where ((log.body != nil and log.body["timestamp"] != nil) and Time(log.body["timestamp"], "%Y-%m-%dT%H:%M:%S.%L%z") != nil) - - caller: ottl@v0.145.0/parser.go:410 + - caller: ottl@v0.138.0/parser.go:410 error: "parsing time \"2022-03-15T14:32:18.456789+00:00\" as \"%Y-%m-%dT%H:%M:%S.%L%z\": cannot parse \"+00:00\" as \"%z\"" level: warn msg: failed to execute statement @@ -59,5 +59,5 @@ resource: service.instance.id: test-service-instance-id service.name: otelopscol - service.version: v0.145.0 + service.version: v0.138.0 statement: set(log.cache["__time_valid"], true) where ((log.body != nil and log.body["timestamp"] != nil) and Time(log.body["timestamp"], "%Y-%m-%dT%H:%M:%S.%L%z") != nil) diff --git a/transformation_test/testdata/logging_processor-parse_json-timestamp-format-1/output_otel.yaml b/transformation_test/testdata/logging_processor-parse_json-timestamp-format-1/output_otel.yaml index d3acaf5601..93d9d4aa9e 100644 --- a/transformation_test/testdata/logging_processor-parse_json-timestamp-format-1/output_otel.yaml +++ b/transformation_test/testdata/logging_processor-parse_json-timestamp-format-1/output_otel.yaml @@ -39,7 +39,7 @@ timestamp: now partialSuccess: true - collector_errors: - - caller: ottl@v0.145.0/parser.go:410 + - caller: ottl@v0.138.0/parser.go:410 error: "parsing time \"2024-06-15T14:30:00.987654321Z\": extra text: \"Z\"" level: warn msg: failed to execute statement @@ -50,9 +50,9 @@ resource: service.instance.id: test-service-instance-id service.name: otelopscol - service.version: v0.145.0 + service.version: v0.138.0 statement: set(log.cache["__time_valid"], true) where ((log.body != nil and log.body["time"] != nil) and Time(log.body["time"], "%Y-%m-%dT%H:%M:%S.%L") != nil) - - caller: ottl@v0.145.0/parser.go:410 + - caller: ottl@v0.138.0/parser.go:410 error: "parsing time \"2022-12-31T23:59:59.000000000-0800\": extra text: \"-0800\"" level: warn msg: failed to execute statement @@ -63,5 +63,5 @@ resource: service.instance.id: test-service-instance-id service.name: otelopscol - service.version: v0.145.0 + service.version: v0.138.0 statement: set(log.cache["__time_valid"], true) where ((log.body != nil and log.body["time"] != nil) and Time(log.body["time"], "%Y-%m-%dT%H:%M:%S.%L") != nil) diff --git a/transformation_test/testdata/logging_processor-parse_regex_invalid_regex/output_otel.yaml b/transformation_test/testdata/logging_processor-parse_regex_invalid_regex/output_otel.yaml index d4a91dd87d..c48d2d456a 100644 --- a/transformation_test/testdata/logging_processor-parse_regex_invalid_regex/output_otel.yaml +++ b/transformation_test/testdata/logging_processor-parse_regex_invalid_regex/output_otel.yaml @@ -2,3 +2,4 @@ - collector_errors: - stderr: | Error: invalid configuration: processors::transform/logs_transformation__test_my-log-name_0: unable to parse OTTL statement "set(log.cache[\"__parsed_regex\"], ExtractPatternsRubyRegex(log.body[\"message\"], \"^(?