Skip to content

Commit

Permalink
fix: reduce diag level on detectors
Browse files Browse the repository at this point in the history
Signed-off-by: John Li <john.li@fmr.com>
  • Loading branch information
johnli-developer committed Aug 23, 2024
1 parent 401aba1 commit 59fcdda
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 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 @@ -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);

Check warning on line 157 in detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts

View check run for this annotation

Codecov / codecov/patch

detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetectorSync.ts#L157

Added line #L157 was not covered by tests
}
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(

Check warning on line 65 in detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts

View check run for this annotation

Codecov / codecov/patch

detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts#L65

Added line #L65 was not covered by tests
'Container Detector did not identify running inside a supported container, no container attributes will be added to resource: ',
e
);
Expand Down

0 comments on commit 59fcdda

Please sign in to comment.