File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
detectors/node/opentelemetry-resource-detector-gcp/src/detectors Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -90,12 +90,10 @@ class GcpDetector implements DetectorSync {
9090 attributes : ResourceAttributes ,
9191 clusterName : string
9292 ) : void {
93- const env = getEnv ( ) ;
94-
9593 attributes [ SEMRESATTRS_K8S_CLUSTER_NAME ] = clusterName ;
96- attributes [ SEMRESATTRS_K8S_NAMESPACE_NAME ] = env . NAMESPACE ;
97- attributes [ SEMRESATTRS_K8S_POD_NAME ] = env . HOSTNAME ;
98- attributes [ SEMRESATTRS_CONTAINER_NAME ] = env . CONTAINER_NAME ;
94+ attributes [ SEMRESATTRS_K8S_NAMESPACE_NAME ] = process . env . NAMESPACE ?? '' ;
95+ attributes [ SEMRESATTRS_K8S_POD_NAME ] = process . env . HOSTNAME ?? '' ;
96+ attributes [ SEMRESATTRS_CONTAINER_NAME ] = process . env . CONTAINER_NAME ?? '' ;
9997 }
10098
10199 /** Gets project id from GCP project metadata. */
You can’t perform that action at this time.
0 commit comments