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

Host metrics instrumentation #231

Merged
merged 18 commits into from
Aug 21, 2020
Merged

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Aug 18, 2020

This instrumentation module implements metrics that the OTel Collector would also generate via its "hostmetrics" receiver. This covers only a minimum amount of information that is generally useful for monitoring, and leaves open questions about how to handle OS-specific metrics (esp. memory) and whether to encode per-CPU and per-NIC measurements for CPU and Network. See the new TODOs.

While working on this I filed several related specification questions:

open-telemetry/opentelemetry-specification#818
open-telemetry/opentelemetry-specification#819

This raises a very serious potential to share code with the OTel Collector's hostmetrics receiver, as that code is more thorough and handles OS-specific fields (with mock tests). On the other hand, factoring out that code module would be easier if we could migrate to using the real OTel-Go Metric SDK to generate these measurements. This is not out of the question, but too much work for this little PR, so I'll suggest that we start small with just a few metrics and evaluate this possibility later.

@jmacd jmacd added the area: instrumentation Related to an instrumentation package label Aug 18, 2020
instrumentation/host/host_test.go Outdated Show resolved Hide resolved
instrumentation/host/doc.go Outdated Show resolved Hide resolved
instrumentation/host/doc.go Outdated Show resolved Hide resolved
instrumentation/host/doc.go Outdated Show resolved Hide resolved
instrumentation/host/go.mod Show resolved Hide resolved
instrumentation/host/host.go Show resolved Hide resolved
instrumentation/host/host.go Outdated Show resolved Hide resolved
instrumentation/host/host.go Outdated Show resolved Hide resolved
instrumentation/host/host.go Outdated Show resolved Hide resolved
instrumentation/host/host_test.go Show resolved Hide resolved
Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

Awesome! I'm excited to use this 😄

Thanks for changing the runtime.Start as well 🎉

instrumentation/host/go.mod Show resolved Hide resolved
@jmacd
Copy link
Contributor Author

jmacd commented Aug 20, 2020

It turns out that gopsutil depends on this wmi package for windows process state.

@MrAlias MrAlias linked an issue Aug 20, 2020 that may be closed by this pull request
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

👍

@MrAlias MrAlias merged commit 4215822 into open-telemetry:master Aug 21, 2020
plantfansam referenced this pull request in plantfansam/opentelemetry-go-contrib Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: instrumentation Related to an instrumentation package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Host metrics instrumentation development needed
3 participants