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

add file descriptor metrics #11876

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

xiangtianyu
Copy link
Contributor

related to #9340 Add file descriptor metrics to agent (support openj9)

@xiangtianyu xiangtianyu requested a review from a team July 22, 2024 11:36
if (openFileDescriptorCount != null) {
observables.add(
meter
.gaugeBuilder("os.file.descriptor.open")
Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/hostmetricsreceiver/internal/scraper/processscraper/documentation.md#processopen_file_descriptors
defines open file descriptor count as an up down counter. os.file.descriptor.open does not align with existing metric names, perhaps jvm.process.open_file_descriptors.

observables.add(
meter
.gaugeBuilder("os.file.descriptor.open")
.setDescription("number of open file descriptors")
Copy link
Contributor

Choose a reason for hiding this comment

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

all other descriptions start with a capital letter and end with dot. Host metric receiver uses the following description Number of file descriptors in use by the process.

meter
.gaugeBuilder("os.file.descriptor.open")
.setDescription("number of open file descriptors")
.setUnit("{file}")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd use file_descriptor though hostmerics receiver uses {count} @trask any suggestions?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

* This class is internal and is hence not for public use. Its APIs are unstable and can change at
* any time.
*/
public class FileDescriptorMethods {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (maxFileDescriptorCount != null) {
observables.add(
meter
.gaugeBuilder("os.file.descriptor.max")
Copy link
Contributor

Choose a reason for hiding this comment

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

Host metrics receiver does not have this. It is similar to jvm.memory.limit and jvm.buffer.memory.limit that we already have. I'd use limit instead of max in the metric name. The descriptions of the existing limit metrics are Measure of max obtainable memory. and Measure of total memory capacity of buffers. The description of this metric should follow similar style.

Copy link
Member

Choose a reason for hiding this comment

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

+1 on .limit

@xiangtianyu are these process metrics, or os-wide metrics? can you open an issue in https://github.com/open-telemetry/semantic-conventions to propose any new metrics, and add a comment in the code pointing to that issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

4 participants