@@ -89,6 +89,17 @@ exporters:
8989 # Export metrics to Google Managed service for Prometheus
9090 googlemanagedprometheus :
9191 project : ${GOOGLE_CLOUD_PROJECT}
92+ otlphttp :
93+ encoding : proto
94+ endpoint : https://telemetry.googleapis.com
95+ # Use the googleclientauth extension to authenticate with Google credentials
96+ auth :
97+ authenticator : googleclientauth
98+
99+ extensions :
100+ googleclientauth :
101+ project : ${GOOGLE_CLOUD_PROJECT}
102+ quota_project : ${GOOGLE_CLOUD_PROJECT}
92103
93104processors :
94105 # Batch telemetry together to more efficiently send to GCP
@@ -107,8 +118,14 @@ processors:
107118 # If running on GCP (e.g. on GKE), detect resource attributes from the environment.
108119 resourcedetection :
109120 detectors : ["env", "gcp"]
121+ resource/gcp_project_id :
122+ attributes :
123+ - key : gcp.project_id
124+ value : ${GOOGLE_CLOUD_PROJECT}
125+ action : insert
110126
111127service :
128+ extensions : [googleclientauth]
112129 telemetry :
113130 metrics :
114131 readers :
@@ -120,8 +137,8 @@ service:
120137 pipelines :
121138 traces :
122139 receivers : ["otlp"]
123- processors : ["batch", "resourcedetection"]
124- exporters : ["googlecloud "]
140+ processors : ["batch", "resourcedetection", "resource/gcp_project_id" ]
141+ exporters : ["otlphttp "]
125142 metrics :
126143 receivers : ["otlp"]
127144 processors : ["batch", "resourcedetection", "resource"]
0 commit comments