Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(detectors): reduce diag level on detectors failing to detect #2382

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
[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 @@
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 @@
);
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 @@
}
}
} 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 @@
[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 Expand Up @@ -128,7 +128,7 @@
} 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