From 793f3bfb57a07c519cbc47a62815cf4f6fb539c5 Mon Sep 17 00:00:00 2001 From: John Li Date: Tue, 20 Aug 2024 10:36:25 +0800 Subject: [PATCH 1/2] Squashed commit of the following: commit 12890682884d14c8e7e6771373b3e1c854a26240 Author: John Li Date: Tue Aug 6 13:54:15 2024 +0800 fix: update detector log level Signed-off-by: John Li Signed-off-by: John Li --- .../src/detectors/AwsEksDetectorSync.ts | 2 +- .../src/detectors/ContainerDetector.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts b/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts index 9ac2b4345c..66367367af 100644 --- a/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts +++ b/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts @@ -95,7 +95,7 @@ export class AwsEksDetectorSync implements DetectorSync { [SEMRESATTRS_CONTAINER_ID]: containerId || '', }; } catch (e) { - diag.warn('Process is not running on K8S', e); + diag.debug('Process is not running on K8S', e); return {}; } } diff --git a/detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts b/detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts index 8d92feda6c..da5cb478b7 100644 --- a/detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts +++ b/detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts @@ -128,7 +128,7 @@ export class ContainerDetector implements DetectorSync { } catch (e) { if (e instanceof Error) { const errorMessage = e.message; - diag.info( + diag.debug( 'Container Detector failed to read the Container ID: ', errorMessage ); From 2e3249678ccc0a0c617c799a46fd31e66804bf4b Mon Sep 17 00:00:00 2001 From: John Li Date: Tue, 20 Aug 2024 10:39:28 +0800 Subject: [PATCH 2/2] fix: reduce diag level on detectors Signed-off-by: John Li --- .../src/detectors/AwsEcsDetectorSync.ts | 2 +- .../src/detectors/AwsEksDetectorSync.ts | 6 +++--- .../src/detectors/ContainerDetector.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetectorSync.ts b/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetectorSync.ts index a89d46cb19..d45aa30c92 100644 --- a/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetectorSync.ts +++ b/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEcsDetectorSync.ts @@ -137,7 +137,7 @@ export class AwsEcsDetectorSync implements DetectorSync { } } } catch (e) { - diag.warn('AwsEcsDetector failed to read container ID', e); + diag.debug('AwsEcsDetector failed to read container ID', e); } if (hostName || containerId) { diff --git a/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts b/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts index 66367367af..d9f326d041 100644 --- a/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts +++ b/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts @@ -138,7 +138,7 @@ export class AwsEksDetectorSync implements DetectorSync { try { return JSON.parse(response).data['cluster.name']; } catch (e) { - diag.warn('Cannot get cluster name on EKS', e); + diag.debug('Cannot get cluster name on EKS', e); } return ''; } @@ -154,7 +154,7 @@ export class AwsEksDetectorSync implements DetectorSync { ); return 'Bearer ' + content; } catch (e) { - diag.warn('Unable to read Kubernetes client token.', e); + diag.debug('Unable to read Kubernetes client token.', e); } return ''; } @@ -189,7 +189,7 @@ export class AwsEksDetectorSync implements DetectorSync { } } } catch (e: any) { - diag.warn(`AwsEksDetector failed to read container ID: ${e.message}`); + diag.debug(`AwsEksDetector failed to read container ID: ${e.message}`); } return undefined; } diff --git a/detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts b/detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts index da5cb478b7..3f0c346124 100644 --- a/detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts +++ b/detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts @@ -62,7 +62,7 @@ export class ContainerDetector implements DetectorSync { [SEMRESATTRS_CONTAINER_ID]: containerId, }; } catch (e) { - diag.info( + diag.debug( 'Container Detector did not identify running inside a supported container, no container attributes will be added to resource: ', e );