GoogleCloudPlatform / opentelemetry-operations-python

OpenTelemetry Python exporters for Google Cloud Monitoring and Trace
https://google-cloud-opentelemetry.readthedocs.io/en/stable/
Apache License 2.0
64 stars 45 forks source link

Why Cloud Functions appear as 'generic_task' in `monitored_resource` in metrics. #314

Closed damjad closed 6 months ago

damjad commented 7 months ago

Hello,

I am pretty new to OpenTelemetry.

I have used the packages in this repo for exporting metrics directly to Stack Driver (GCP Monitoring Service).

However, I see that when I use a GCF v2, it appears to be a 'generic_task' in metrics. I tried several things and nothing worked.

In the end, I dug into the code and found out that the logic was not there to handle GCF. The file is this one https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/blob/main/opentelemetry-resourcedetector-gcp/src/opentelemetry/resourcedetector/gcp_resource_detector/_mapping.py#L145.

My question here is that is it intentionally not implemented or is it going to be available in the future?

dashpole commented 6 months ago

It is intentionally mapped to generic task. The monitored resource for cloud function is not writeable for custom metrics. Feel free to ask questions in our slack channel, #otel-gcp as well: https://app.slack.com/client/T08PSQ7BQ/C043XTR0JHF