Skip to content
  •  
  •  
  •  
1 change: 1 addition & 0 deletions apps/active_directory_ds.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (r MetricsReceiverActiveDirectoryDS) Pipelines(_ context.Context) ([]otel.R
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/activemq.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (r MetricsReceiverActivemq) Pipelines(_ context.Context) ([]otel.ReceiverPi
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions apps/aerospike.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (r MetricsReceiverAerospike) Pipelines(_ context.Context) ([]otel.ReceiverP
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/apache.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (r MetricsReceiverApache) Pipelines(_ context.Context) ([]otel.ReceiverPipe
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/cassandra.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (r MetricsReceiverCassandra) Pipelines(_ context.Context) ([]otel.ReceiverP
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions apps/couchbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func (r MetricsReceiverCouchbase) Pipelines(_ context.Context) ([]otel.ReceiverP
otel.SetScopeVersion("1.0"),
)...,
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/couchdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func (r MetricsReceiverCouchdb) Pipelines(_ context.Context) ([]otel.ReceiverPip
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func (r MetricsReceiverElasticsearch) Pipelines(_ context.Context) ([]otel.Recei
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/flink.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (r MetricsReceiverFlink) Pipelines(_ context.Context) ([]otel.ReceiverPipel
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/hadoop.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (r MetricsReceiverHadoop) Pipelines(_ context.Context) ([]otel.ReceiverPipe
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions apps/hbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (r MetricsReceiverHbase) Pipelines(_ context.Context) ([]otel.ReceiverPipel
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions apps/iis.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (r MetricsReceiverIis) Pipelines(_ context.Context) ([]otel.ReceiverPipelin
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("2.0"),
),
otel.MetricsRemoveServiceAttributes(),
// Drop all resource keys; Must be done in a separate transform,
// otherwise the above flatten resource attribute queries will only
// work for the first datapoint
Expand Down
1 change: 1 addition & 0 deletions apps/jetty.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (r MetricsReceiverJetty) Pipelines(_ context.Context) ([]otel.ReceiverPipel
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions apps/jvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func (r MetricsReceiverJVM) Pipelines(_ context.Context) ([]otel.ReceiverPipelin
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions apps/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (r MetricsReceiverKafka) Pipelines(_ context.Context) ([]otel.ReceiverPipel
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions apps/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (r MetricsReceiverMemcached) Pipelines(_ context.Context) ([]otel.ReceiverP
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func (r MetricsReceiverMongoDB) Pipelines(_ context.Context) ([]otel.ReceiverPip
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (m MetricsReceiverMssql) Pipelines(_ context.Context) ([]otel.ReceiverPipel
otel.SetScopeName("agent.googleapis.com/"+m.Type()),
otel.SetScopeVersion("2.0"),
),
otel.MetricsRemoveServiceAttributes(),
otel.NormalizeSums(),
}},
}}, nil
Expand Down
1 change: 1 addition & 0 deletions apps/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func (r MetricsReceiverMySql) Pipelines(_ context.Context) ([]otel.ReceiverPipel
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
},
}, nil
Expand Down
1 change: 1 addition & 0 deletions apps/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (r MetricsReceiverNginx) Pipelines(_ context.Context) ([]otel.ReceiverPipel
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
15 changes: 8 additions & 7 deletions apps/oracledb.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func (r MetricsReceiverOracleDB) Pipelines(_ context.Context) ([]otel.ReceiverPi
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand All @@ -132,11 +133,11 @@ var oracleQueries = []sqlReceiverQuery{
query: `SELECT (SELECT DBID FROM SYS.GV_$$DATABASE) DATABASE_ID, (SELECT GLOBAL_NAME FROM sys.GLOBAL_NAME) GLOBAL_NAME, ts.TABLESPACE_NAME, ts.CONTENTS,
(select sum(df.bytes) from sys.dba_data_files df where df.tablespace_name=ts.tablespace_name)-(select sum(fs.bytes) from sys.dba_free_space fs where fs.tablespace_name=ts.tablespace_name) AS USED_SPACE,
(select sum(fs.bytes) from sys.dba_free_space fs where fs.tablespace_name=ts.tablespace_name) AS FREE_SPACE
FROM sys.dba_tablespaces ts
FROM sys.dba_tablespaces ts
WHERE ts.contents <> 'TEMPORARY'
UNION ALL
SELECT (SELECT DBID FROM SYS.GV_$$DATABASE) DATABASE_ID, (SELECT GLOBAL_NAME FROM sys.GLOBAL_NAME) GLOBAL_NAME, ts.NAME TABLESPACE_NAME, 'TEMPORARY' as CONTENTS,
SUM(ss.USED_BLOCKS * t.BLOCK_SIZE) USED_SPACE,
SUM(ss.USED_BLOCKS * t.BLOCK_SIZE) USED_SPACE,
SUM(t.BYTES) - SUM(ss.USED_BLOCKS * t.BLOCK_SIZE) FREE_SPACE
FROM SYS.V_$$sort_segment ss
JOIN sys.v_$$tablespace ts
Expand Down Expand Up @@ -232,7 +233,7 @@ var oracleQueries = []sqlReceiverQuery{
},
{
query: `SELECT DATABASE_ID, GLOBAL_NAME, INST_ID INSTANCE_ID, MAX(PROCESSES_UTIL) PROCESSES_UTIL, MAX(PROCESSES_LIMIT_VAL) PROCESSES_LIMIT_VAL, MAX(SESSIONS_UTIL) SESSIONS_UTIL, MAX(SESSIONS_LIMIT_VAL) SESSIONS_LIMIT_VAL
FROM (SELECT (SELECT DBID FROM SYS.GV_$$DATABASE) DATABASE_ID, (SELECT GLOBAL_NAME FROM sys.GLOBAL_NAME) GLOBAL_NAME, INST_ID, PROCESSES_UTIL, PROCESSES_LIMIT_VAL, SESSIONS_UTIL, SESSIONS_LIMIT_VAL
FROM (SELECT (SELECT DBID FROM SYS.GV_$$DATABASE) DATABASE_ID, (SELECT GLOBAL_NAME FROM sys.GLOBAL_NAME) GLOBAL_NAME, INST_ID, PROCESSES_UTIL, PROCESSES_LIMIT_VAL, SESSIONS_UTIL, SESSIONS_LIMIT_VAL
FROM (SELECT * FROM SYS.GV_$$resource_limit
WHERE RESOURCE_NAME IN ('processes', 'sessions'))
PIVOT(
Expand Down Expand Up @@ -424,8 +425,8 @@ var oracleQueries = []sqlReceiverQuery{
},
},
{
query: `SELECT DATABASE_ID, GLOBAL_NAME, INST_ID INSTANCE_ID, MAX(RESPONSE_TIME) RESPONSE_TIME, MAX(BUFFER_HIT_RATIO) BUFFER_HIT_RATIO, MAX(ROW_HIT_RATIO) ROW_HIT_RATIO
FROM (SELECT (SELECT DBID FROM SYS.GV_$$DATABASE) DATABASE_ID, (SELECT GLOBAL_NAME FROM sys.GLOBAL_NAME) GLOBAL_NAME, INST_ID, END_TIME, RESPONSE_TIME, BUFFER_HIT_RATIO, ROW_HIT_RATIO
query: `SELECT DATABASE_ID, GLOBAL_NAME, INST_ID INSTANCE_ID, MAX(RESPONSE_TIME) RESPONSE_TIME, MAX(BUFFER_HIT_RATIO) BUFFER_HIT_RATIO, MAX(ROW_HIT_RATIO) ROW_HIT_RATIO
FROM (SELECT (SELECT DBID FROM SYS.GV_$$DATABASE) DATABASE_ID, (SELECT GLOBAL_NAME FROM sys.GLOBAL_NAME) GLOBAL_NAME, INST_ID, END_TIME, RESPONSE_TIME, BUFFER_HIT_RATIO, ROW_HIT_RATIO
FROM (SELECT * FROM SYS.GV_$$sysmetric
WHERE METRIC_NAME IN ('SQL Service Response Time', 'Buffer Cache Hit Ratio', 'Row Cache Hit Ratio')
AND GROUP_ID = 2)
Expand Down Expand Up @@ -480,8 +481,8 @@ var oracleQueries = []sqlReceiverQuery{
},
},
{
query: `SELECT DATABASE_ID, GLOBAL_NAME, INST_ID INSTANCE_ID, MAX(CURSORS_CUMULATIVE) CURSORS_CUMULATIVE, MAX(CURSORS_CURRENT) CURSORS_CURRENT, MAX(SORTS_MEM) SORTS_MEM, MAX(SORTS_DISK) SORTS_DISK, MAX(SORTS_ROWS) SORTS_ROWS, MAX(READ_TOTAL) READ_TOTAL, MAX(WRITE_TOTAL) WRITE_TOTAL, MAX(READ_TOTAL_BY) READ_TOTAL_BY, MAX(WRITE_TOTAL_BY) WRITE_TOTAL_BY, MAX(LOGONS_CURRENT) LOGONS_CURRENT, MAX(CLIENT_RECV_BY) CLIENT_RECV_BY, MAX(DBLINK_RECV_BY) DBLINK_RECV_BY, MAX(CLIENT_SENT_BY) CLIENT_SENT_BY, MAX(DBLINK_SENT_BY) DBLINK_SENT_BY, MAX(LOGONS_CUMULATIVE) LOGONS_CUMULATIVE, MAX(USER_CALLS) USER_CALLS, MAX(USER_COMMITS) USER_COMMITS, MAX(USER_ROLLBACKS) USER_ROLLBACKS
FROM (SELECT (SELECT DBID FROM SYS.GV_$$DATABASE) DATABASE_ID, (SELECT GLOBAL_NAME FROM sys.GLOBAL_NAME) GLOBAL_NAME, INST_ID, CURSORS_CUMULATIVE, CURSORS_CURRENT, SORTS_MEM, SORTS_DISK, SORTS_ROWS, READ_TOTAL, WRITE_TOTAL, READ_TOTAL_BY, WRITE_TOTAL_BY, LOGONS_CURRENT, CLIENT_RECV_BY, DBLINK_RECV_BY, CLIENT_SENT_BY, DBLINK_SENT_BY, LOGONS_CUMULATIVE, USER_CALLS, USER_COMMITS, USER_ROLLBACKS
query: `SELECT DATABASE_ID, GLOBAL_NAME, INST_ID INSTANCE_ID, MAX(CURSORS_CUMULATIVE) CURSORS_CUMULATIVE, MAX(CURSORS_CURRENT) CURSORS_CURRENT, MAX(SORTS_MEM) SORTS_MEM, MAX(SORTS_DISK) SORTS_DISK, MAX(SORTS_ROWS) SORTS_ROWS, MAX(READ_TOTAL) READ_TOTAL, MAX(WRITE_TOTAL) WRITE_TOTAL, MAX(READ_TOTAL_BY) READ_TOTAL_BY, MAX(WRITE_TOTAL_BY) WRITE_TOTAL_BY, MAX(LOGONS_CURRENT) LOGONS_CURRENT, MAX(CLIENT_RECV_BY) CLIENT_RECV_BY, MAX(DBLINK_RECV_BY) DBLINK_RECV_BY, MAX(CLIENT_SENT_BY) CLIENT_SENT_BY, MAX(DBLINK_SENT_BY) DBLINK_SENT_BY, MAX(LOGONS_CUMULATIVE) LOGONS_CUMULATIVE, MAX(USER_CALLS) USER_CALLS, MAX(USER_COMMITS) USER_COMMITS, MAX(USER_ROLLBACKS) USER_ROLLBACKS
FROM (SELECT (SELECT DBID FROM SYS.GV_$$DATABASE) DATABASE_ID, (SELECT GLOBAL_NAME FROM sys.GLOBAL_NAME) GLOBAL_NAME, INST_ID, CURSORS_CUMULATIVE, CURSORS_CURRENT, SORTS_MEM, SORTS_DISK, SORTS_ROWS, READ_TOTAL, WRITE_TOTAL, READ_TOTAL_BY, WRITE_TOTAL_BY, LOGONS_CURRENT, CLIENT_RECV_BY, DBLINK_RECV_BY, CLIENT_SENT_BY, DBLINK_SENT_BY, LOGONS_CUMULATIVE, USER_CALLS, USER_COMMITS, USER_ROLLBACKS
FROM (SELECT * FROM SYS.GV_$$sysstat
WHERE NAME IN ('opened cursors cumulative', 'opened cursors current', 'sorts (memory)', 'sorts (disk)', 'sorts (rows)', 'physical read total IO requests', 'physical write total IO requests', 'physical read total bytes', 'physical write total bytes', 'logons current', 'bytes received via SQL*Net from client', 'bytes received via SQL*Net from dblink', 'bytes sent via SQL*Net to client', 'bytes sent via SQL*Net to dblink', 'logons cumulative', 'user calls', 'user commits', 'user rollbacks')
)
Expand Down
1 change: 1 addition & 0 deletions apps/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func (r MetricsReceiverPostgresql) Pipelines(_ context.Context) ([]otel.Receiver
),
otel.AddPrefix("workload.googleapis.com"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ func (r MetricsReceiverRabbitmq) Pipelines(_ context.Context) ([]otel.ReceiverPi
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (r MetricsReceiverRedis) Pipelines(_ context.Context) ([]otel.ReceiverPipel
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/saphana.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func (s MetricsReceiverSapHana) Pipelines(_ context.Context) ([]otel.ReceiverPip
otel.SetScopeName("agent.googleapis.com/"+s.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/solr.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (r MetricsReceiverSolr) Pipelines(_ context.Context) ([]otel.ReceiverPipeli
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions apps/tomcat.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (r MetricsReceiverTomcat) Pipelines(_ context.Context) ([]otel.ReceiverPipe
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions apps/varnish.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (r MetricsReceiverVarnish) Pipelines(_ context.Context) ([]otel.ReceiverPip
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func (r MetricsReceiverVault) Pipelines(_ context.Context) ([]otel.ReceiverPipel
otel.MetricsTransform(
otel.AddPrefix("workload.googleapis.com"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
1 change: 1 addition & 0 deletions apps/wildfly.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (r MetricsReceiverWildfly) Pipelines(_ context.Context) ([]otel.ReceiverPip
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
},
)
}
Expand Down
1 change: 1 addition & 0 deletions apps/zookeeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func (r MetricsReceiverZookeeper) Pipelines(_ context.Context) ([]otel.ReceiverP
otel.SetScopeName("agent.googleapis.com/"+r.Type()),
otel.SetScopeVersion("1.0"),
),
otel.MetricsRemoveServiceAttributes(),
}},
}}, nil
}
Expand Down
9 changes: 4 additions & 5 deletions confgenerator/confgenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/GoogleCloudPlatform/ops-agent/internal/platform"
)

func googleCloudExporter(userAgent string, instrumentationLabels bool) otel.Component {
func googleCloudExporter(userAgent string, instrumentationLabels bool, serviceResourceLabels bool) otel.Component {
return otel.Component{
Type: "googlecloud",
Config: map[string]interface{}{
Expand All @@ -50,8 +50,7 @@ func googleCloudExporter(userAgent string, instrumentationLabels bool) otel.Comp
// Omit instrumentation labels, which break agent metrics.
"instrumentation_library_labels": instrumentationLabels,
// Omit service labels, which break agent metrics.
// TODO: Enable with instrumentationLabels when values are sane.
"service_resource_labels": false,
"service_resource_labels": serviceResourceLabels,
"resource_filters": []map[string]interface{}{},
},
},
Expand Down Expand Up @@ -127,8 +126,8 @@ func (uc *UnifiedConfig) GenerateOtelConfig(ctx context.Context, outDir string)
Pipelines: pipelines,
Extensions: extensions,
Exporters: map[otel.ExporterType]otel.Component{
otel.System: googleCloudExporter(userAgent, false),
otel.OTel: googleCloudExporter(userAgent, true),
otel.System: googleCloudExporter(userAgent, false, false),
otel.OTel: googleCloudExporter(userAgent, true, true),
otel.GMP: googleManagedPrometheusExporter(userAgent),
},
}.Generate(ctx)
Expand Down
22 changes: 22 additions & 0 deletions confgenerator/otel/processors.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,28 @@ func TransformationMetrics(queries ...TransformQuery) Component {
}
}

// MetricsRemoveServiceAttributes will remove any service attributes that the
// googlecloudexporter attempts to promote from resource to metric attributes.
// The attributes it removes are specified at:
// https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/
func MetricsRemoveServiceAttributes() Component {
return Component{
Type: "transform",
Config: map[string]any{
"metric_statements": map[string]any{
"context": "resource",
"error_mode": "ignore",
"statements": []string{
`delete_key(attributes, "service.name")`,
`delete_key(attributes, "service.instance.id")`,
`delete_key(attributes, "service.namespace")`,
`delete_key(attributes, "service.version")`,
},
},
},
}
}

// TransformQueryContext is a type wrapper for the context of a query expression within the transoform processor
type TransformQueryContext string

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exporters:
instrumentation_library_labels: true
prefix: ""
resource_filters: []
service_resource_labels: false
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exporters:
instrumentation_library_labels: true
prefix: ""
resource_filters: []
service_resource_labels: false
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exporters:
instrumentation_library_labels: true
prefix: ""
resource_filters: []
service_resource_labels: false
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exporters:
instrumentation_library_labels: true
prefix: ""
resource_filters: []
service_resource_labels: false
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exporters:
instrumentation_library_labels: true
prefix: ""
resource_filters: []
service_resource_labels: false
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)
processors:
Expand Down
Loading
Loading