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

chore(host-metrics): solve some TODO comments #124

Merged
merged 6 commits into from
Apr 10, 2024

Conversation

david-luna
Copy link
Member

This PR address a couple of TODO comments for metrics. I proposed a couple of changes that are meant to be discussed here before the alpha comes out.

@david-luna david-luna requested a review from trentm April 9, 2024 13:39
@@ -206,27 +214,41 @@ class SystemCpuUtilizationAggregation extends Aggregation {
/** @type {HostMetrics} */
let hostMetricsInstance;
function enableHostMetrics() {
// TODO: make this configurable, user might collect host metrics with a separate utility
// NOTE: we set the scope name to the package name `@opentelemetry/host-metrics` like
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewer: maybe this is a hot take but IMO if we let the user to name the scope of host metrics as he/she wants we wont have a clear way to know if the metrics came from @opentelemetry/host-metrics or another utility/package

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you see any value in passing in a value here, or having it configurable? I don't, but I may be missing soemthing. If not, then this whole function could be:

function enableHostMetrics() {
  hostMetricsInstance = new HostMetrics();
  hostMetricsInstance.start();
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing it since it has a default value

new View({
instrumentName: 'system.cpu.time',
aggregation: Aggregation.Drop(),
}),
// use the aggregation we craeted above
// drop `process.*` (not in Kibana)
new View({
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewer: dropping process.* metrics for now since there is no UI showing them. We probably want an aggregation for process.cpu.utilization but I think it would be easier and shorter once open-telemetry/opentelemetry-js#4616 is done

@david-luna david-luna merged commit 85a975b into main Apr 10, 2024
11 checks passed
@david-luna david-luna deleted the dluna/host-metrics-todos branch April 10, 2024 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants