From 1347df7576524b7b9ad6eda56d899b2b9d5f29be Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Tue, 26 Sep 2023 13:43:17 +0000 Subject: [PATCH] change from access to get --- .../resourcedetector/gcp_resource_detector/_mapping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-resourcedetector-gcp/src/opentelemetry/resourcedetector/gcp_resource_detector/_mapping.py b/opentelemetry-resourcedetector-gcp/src/opentelemetry/resourcedetector/gcp_resource_detector/_mapping.py index ad175f8e..1e054b92 100644 --- a/opentelemetry-resourcedetector-gcp/src/opentelemetry/resourcedetector/gcp_resource_detector/_mapping.py +++ b/opentelemetry-resourcedetector-gcp/src/opentelemetry/resourcedetector/gcp_resource_detector/_mapping.py @@ -206,7 +206,7 @@ def _create_monitored_resource( and ResourceAttributes.SERVICE_NAME in map_config.otel_keys ): # The service name started with unknown_service, and was ignored above. - mr_value = resource_attrs[ResourceAttributes.SERVICE_NAME] + mr_value = resource_attrs.get(ResourceAttributes.SERVICE_NAME) if mr_value is None: mr_value = map_config.fallback