From d45e20e95325a04ccc9414eaccbc21195f08d456 Mon Sep 17 00:00:00 2001 From: Rafael Westphal Date: Thu, 4 Jun 2026 00:23:03 +0000 Subject: [PATCH 1/3] refactor: remove legacy GCM and GMP exporters This change removes the legacy Google Cloud Monitoring (GCM) and Google Managed Prometheus (GMP) exporters from the Ops Agent. Traces are now exported via OTLP by default, matching metrics and logs. Removed dead code including exporter definitions, helper converters, and unused configuration options. Updated golden files to reflect the OTLP-only output. --- confgenerator/config.go | 1 + 1 file changed, 1 insertion(+) diff --git a/confgenerator/config.go b/confgenerator/config.go index b350f3fe27..d72c2d2a5a 100644 --- a/confgenerator/config.go +++ b/confgenerator/config.go @@ -667,6 +667,7 @@ func (m MetricsReceiverSharedTLS) TLSConfig(defaultInsecure bool) map[string]int return tls } + type MetricsReceiverSharedCluster struct { CollectClusterMetrics *bool `yaml:"collect_cluster_metrics" validate:"omitempty"` } From dab783a496b4130f782b868d40ee1c995430f447 Mon Sep 17 00:00:00 2001 From: Rafael Westphal Date: Thu, 4 Jun 2026 14:24:44 +0000 Subject: [PATCH 2/3] refactor(healthchecks): clean up legacy errors and use Telemetry API in network check Remove unused LogApiPermissionErr, MonApiPermissionErr, LogApiDisabledErr, MonApiDisabledErr. Remove LogApiConnErr and MonApiConnErr. Update network check to ping telemetry.googleapis.com and use TelApiConnErr. Update integration test expectations. --- confgenerator/config.go | 1 - 1 file changed, 1 deletion(-) diff --git a/confgenerator/config.go b/confgenerator/config.go index d72c2d2a5a..b350f3fe27 100644 --- a/confgenerator/config.go +++ b/confgenerator/config.go @@ -667,7 +667,6 @@ func (m MetricsReceiverSharedTLS) TLSConfig(defaultInsecure bool) map[string]int return tls } - type MetricsReceiverSharedCluster struct { CollectClusterMetrics *bool `yaml:"collect_cluster_metrics" validate:"omitempty"` } From e46043cdaf77ef94011af8b5ce1665ba3f405472 Mon Sep 17 00:00:00 2001 From: Rafael Westphal Date: Fri, 5 Jun 2026 19:58:26 +0000 Subject: [PATCH 3/3] refactor(confgenerator): simplify OTLP exporter config generation --- confgenerator/confgenerator.go | 79 +++++++++++++++------------------- 1 file changed, 34 insertions(+), 45 deletions(-) diff --git a/confgenerator/confgenerator.go b/confgenerator/confgenerator.go index 628e963d4c..2d6243b327 100644 --- a/confgenerator/confgenerator.go +++ b/confgenerator/confgenerator.go @@ -28,63 +28,52 @@ import ( "github.com/GoogleCloudPlatform/ops-agent/internal/platform" ) +func baseOtlpExporterConfig(userAgent string) map[string]interface{} { + return map[string]interface{}{ + "endpoint": "telemetry.googleapis.com:443", + "balancer_name": "pick_first", + "auth": map[string]interface{}{ + "authenticator": "googleclientauth", + }, + "user_agent": userAgent, + } +} + func otlpExporterForTraces(userAgent string) otel.Component { return otel.Component{ - Type: "otlp_grpc", - Config: map[string]interface{}{ - "endpoint": "telemetry.googleapis.com:443", - "balancer_name": "pick_first", - "auth": map[string]interface{}{ - "authenticator": "googleclientauth", - }, - "user_agent": userAgent, - }, + Type: "otlp_grpc", + Config: baseOtlpExporterConfig(userAgent), } } func otlpExporterForMetrics(userAgent string) otel.Component { return otel.Component{ - Type: "otlp_grpc", - Config: map[string]interface{}{ - "endpoint": "telemetry.googleapis.com:443", - // b/485538253: Use pick_first balancer until we can understand why round_robin is failing. - "balancer_name": "pick_first", - "auth": map[string]interface{}{ - "authenticator": "googleclientauth", - }, - "user_agent": userAgent, - }, + Type: "otlp_grpc", + Config: baseOtlpExporterConfig(userAgent), } } func otlpExporterForLogs(userAgent string) otel.Component { - return otel.Component{ - Type: "otlp_grpc", - Config: map[string]interface{}{ - "endpoint": "telemetry.googleapis.com:443", - // b/485538253: Use pick_first balancer until we can understand why round_robin is failing. - "balancer_name": "pick_first", - "auth": map[string]interface{}{ - "authenticator": "googleclientauth", - }, - "user_agent": userAgent, - "sending_queue": map[string]interface{}{ - "enabled": true, - "queue_size": 20000000, - "num_consumers": 10, - "sizer": "bytes", - // Blocks the "sending_queue" on overflow to reduce log loss. - "block_on_overflow": true, - // Set batch in "sending_queue" is recommended instead of using the batch processor. - "batch": map[string]interface{}{ - "flush_timeout": "200ms", - "min_size": 1000000, - "max_size": 5000000, - "sizer": "bytes", - }, - "storage": fileStorageExtensionType, - }, + config := baseOtlpExporterConfig(userAgent) + config["sending_queue"] = map[string]interface{}{ + "enabled": true, + "queue_size": 20000000, + "num_consumers": 10, + "sizer": "bytes", + // Blocks the "sending_queue" on overflow to reduce log loss. + "block_on_overflow": true, + // Set batch in "sending_queue" is recommended instead of using the batch processor. + "batch": map[string]interface{}{ + "flush_timeout": "200ms", + "min_size": 1000000, + "max_size": 5000000, + "sizer": "bytes", }, + "storage": fileStorageExtensionType, + } + return otel.Component{ + Type: "otlp_grpc", + Config: config, } }