Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(otel): Exporter creating Monitored Resource with task_id for Clou…
…d Run Fixes googleapis#14925 When inside a Cloud Run environment, the [`MonitoredResource`](https://cloud.google.com/monitoring/api/ref_v3/rpc/google.monitoring.v3#google.monitoring.v3.TimeSeries) in a [`CreateTimeSeriesRequest`](https://cloud.google.com/monitoring/api/ref_v3/rpc/google.monitoring.v3#google.monitoring.v3.CreateTimeSeriesRequest) to the Cloud Monitoring API does not include the necessary fields for the [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) resource type, and is rejected. Should follow the [well-tested Golang implementation](https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/8da0f42dab085c916987891419461d583a2aa96e/internal/resourcemapping/resourcemapping.go#L153) where the `faas.instance` OTel Resource Attribute is mapped to `MonitoredResource` `task_id`. As the `service.namespace` OTel Resource Attribute is not set by the Resource Detector from within Cloud Run, it should be mapped as an empty string (as in [golang implementation](https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/8da0f42dab085c916987891419461d583a2aa96e/internal/resourcemapping/resourcemapping.go#L250)), rather than being left absent.
- Loading branch information