open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.05k stars 2.35k forks source link

Enhance hostmetrics receiver process scraper to bring it closer to parity with telegraf procstat provided metrics #14084

Closed jspaleta closed 1 year ago

jspaleta commented 2 years ago

Is your feature request related to a problem? Please describe. Found while migrating from telegraf based collection to otelcol, several process metrics are missing in the otelcol hostmetrics process scraper.

Describe the solution you'd like Implement additional metrics in the hostmetrics process scraper to bring metrics coverage closer to parity with telegraf procstat. All the missing metrics are derived from gopsutil package.

Additional context While migrating supported SumoLogic dashboard apps from using telegraf based fields to otelcol native metrics names, several metrics appear to be missing from otelcol native receivers. The metrics listed are an identified subset of differences between telegraf procstat and the hostmetrics process scraper.

missing metrics

  1. telegraf name: major_faults (count of major page faults by process) telegraf plugin ref: https://github.com/influxdata/telegraf/blob/3d2b7bd210356c20701ce51eaf60480b314ad1c8/plugins/inputs/procstat/procstat.go#L196 gopsutil ref: https://github.com/shirou/gopsutil/blob/434cc29594a81df897f1c07189309e6887bead42/process/process_linux.go#L332 Suggested name: process.faults.major
  2. telegraf name: cpu_usage (percentage cpu used by process) gopsutil ref: https://github.com/shirou/gopsutil/blob/a63ec01c758209504c1d15e18604699d06d8ec23/process/process.go#L338 Suggested name: process.cpu.utilization
  3. telegraf name: memory_usage (percentage of physical memory used by process) gopsutil ref: https://github.com/shirou/gopsutil/blob/a63ec01c758209504c1d15e18604699d06d8ec23/process/process.go#L317 Suggested name: process.memory.utilization
  4. telegraf name: signals_pending (count of signals pending by process) telgraf plugin ref: https://github.com/influxdata/telegraf/blob/3d2b7bd210356c20701ce51eaf60480b314ad1c8/plugins/inputs/procstat/procstat.go#L255 Suggested name: process.signals.pending
  5. telegraf name: created_at (Time in milliseconds(please check that) since unix epoch) telegraf plugin ref: https://github.com/influxdata/telegraf/blob/3d2b7bd210356c20701ce51eaf60480b314ad1c8/plugins/inputs/procstat/procstat.go#L212 Suggested name: process.creation.time
  6. telegraf name: num_fds (number of file descriptors currently open by the process) telegraf plugin ref: https://github.com/influxdata/telegraf/blob/3d2b7bd210356c20701ce51eaf60480b314ad1c8/plugins/inputs/procstat/procstat.go#L185 gopsutil ref:
    Suggested name: process.num_fds
  7. telegraf name: involuntary_context_switches (Number of involuntary context switches that have occurred for the process) telegraf plugin ref: https://github.com/influxdata/telegraf/blob/3d2b7bd210356c20701ce51eaf60480b314ad1c8/plugins/inputs/procstat/procstat.go#L185 Suggested name: process.context_switches.involuntary
  8. telegraph name: read_count (Number of disk io reads) telegraf pluginm ref: https://github.com/influxdata/telegraf/blob/3d2b7bd210356c20701ce51eaf60480b314ad1c8/plugins/inputs/procstat/procstat.go#L204 gopsutil ref: https://github.com/shirou/gopsutil/blob/a63ec01c758209504c1d15e18604699d06d8ec23/disk/disk_linux.go#L388
    Suggested name: process.read_count
  9. telegraph name: write_count (Number of disk io writes) telegraf pluginm ref: https://github.com/influxdata/telegraf/blob/3d2b7bd210356c20701ce51eaf60480b314ad1c8/plugins/inputs/procstat/procstat.go#L204 gopsutil ref: https://github.com/shirou/gopsutil/blob/a63ec01c758209504c1d15e18604699d06d8ec23/disk/disk_linux.go#L388
    Suggested name: process.write_count
github-actions[bot] commented 2 years ago

Pinging code owners: @dmitryax. See Adding Labels via Comments if you do not have permissions to add labels yourself.

evan-bradley commented 2 years ago

Thanks for the detailed report. I know that metrics 6 and 7 in your list will be added in https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/12972.

andrzej-stencel commented 2 years ago

Thanks @jspaleta for writing this up.

Here's the proposal to add the first metric (page faults) to the semantic conventions spec: https://github.com/open-telemetry/opentelemetry-specification/issues/2809.

github-actions[bot] commented 1 year ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] commented 1 year ago

This issue has been closed as inactive because it has been stale for 120 days with no activity.