@@ -91,6 +91,17 @@ exporters:
9191 # Export metrics to Google Managed service for Prometheus
9292 googlemanagedprometheus :
9393 project : ${GOOGLE_CLOUD_PROJECT}
94+ otlphttp :
95+ encoding : proto
96+ endpoint : https://telemetry.googleapis.com
97+ # Use the googleclientauth extension to authenticate with Google credentials
98+ auth :
99+ authenticator : googleclientauth
100+
101+ extensions :
102+ googleclientauth :
103+ project : ${GOOGLE_CLOUD_PROJECT}
104+ quota_project : ${GOOGLE_CLOUD_PROJECT}
94105
95106processors :
96107 # Batch telemetry together to more efficiently send to GCP
@@ -109,8 +120,14 @@ processors:
109120 # If running on GCP (e.g. on GKE), detect resource attributes from the environment.
110121 resourcedetection :
111122 detectors : ["env", "gcp"]
123+ resource/gcp_project_id :
124+ attributes :
125+ - key : gcp.project_id
126+ value : ${GOOGLE_CLOUD_PROJECT}
127+ action : insert
112128
113129service :
130+ extensions : [googleclientauth]
114131 telemetry :
115132 metrics :
116133 readers :
@@ -122,8 +139,8 @@ service:
122139 pipelines :
123140 traces :
124141 receivers : ["otlp"]
125- processors : ["batch", "resourcedetection"]
126- exporters : ["googlecloud "]
142+ processors : ["batch", "resourcedetection", "resource/gcp_project_id" ]
143+ exporters : ["otlphttp "]
127144 metrics :
128145 receivers : ["otlp"]
129146 processors : ["batch", "resourcedetection", "resource"]
0 commit comments