Skip to content

Commit 4865868

Browse files
authored
fix(bigtable): fix project id sent in otel (#13286)
Project ID sent to Google Monitoring was different than the project ID sent in the labels, which was causing an error: ``` rpc error: code = InvalidArgument desc = Field resource.labels.project_id had an invalid value of "*": if present, must be the project number or ID in the request name (projects/*). ``` This happened when you run your app on a project but connect to Bigtable from a different project. The project in the monitoring request name would be the project that you are running on, and the project in the labels would be the Bigtable project, causing the mismatch.
1 parent 3b3253a commit 4865868

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bigtable/otel_metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type bigtableClientMonitoredResource struct {
5959

6060
func (bmr *bigtableClientMonitoredResource) exporter() (metric.Exporter, error) {
6161
exporter, err := mexporter.New(
62-
mexporter.WithProjectID(bmr.clientProject),
62+
mexporter.WithProjectID(bmr.project),
6363
mexporter.WithMetricDescriptorTypeFormatter(metricFormatter),
6464
mexporter.WithCreateServiceTimeSeries(),
6565
mexporter.WithMonitoredResourceDescription(bigtableClientMonitoredResourceName, []string{"project_id", "instance", "app_profile", "client_project", "cloud_platform", "host_id", "host_name", "client_name", "uuid", "region"}),

0 commit comments

Comments
 (0)