Skip to content

Commit

Permalink
fix(detectors): reduce diag level on detectors failing to detect (#2382)
Browse files Browse the repository at this point in the history
* Squashed commit of the following:

commit 1289068
Author: John Li <[email protected]>
Date:   Tue Aug 6 13:54:15 2024 +0800

    fix: update detector log level

    Signed-off-by: John Li <[email protected]>

Signed-off-by: John Li <[email protected]>

* fix: reduce diag level on detectors

Signed-off-by: John Li <[email protected]>

---------

Signed-off-by: John Li <[email protected]>
  • Loading branch information
johnli-developer authored Aug 27, 2024
1 parent d30c85c commit d7a5bd4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
}
}
Expand Down Expand Up @@ -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 '';
}
Expand All @@ -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 '';
}
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down Expand Up @@ -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
);
Expand Down

0 comments on commit d7a5bd4

Please sign in to comment.