Skip to content

processcollector: Overhaul processcollector for consistency and testability #1591

Closed
@bwplotka

Description

@bwplotka

While investigating and fixing #1584 I noticed some tech-debt build up over time:

image

  • func (c *processCollector) Describe(ch chan<- *Desc) { is always the same despite on different platforms we don't expect certain metrics. Perhaps to move per platform?
  • We have noop files for wasip1 and js, but for darwin (mac) we simply use "other" file and error out in silent way (if Errors is equal to false). Let's make it consistent and either error all of them silently (and verbosely if Errors == true), or have all of them noop. This is reflected by inconsistency in prod files build tags and test file build tags.
  • Each working platform such ensure that maximum amount of metrics matches list of defined metrics in Description. This is to ensure we don't hit collected metric process_network_receive_bytes_total counter with unregistered descriptor #1584 again. Some ideas:
    • Move internals behind interface, separate for windows and linux.
    • Use reflection in tests to make sure all desc defined are described in Description method?
    • Add comment if nothing else to not forget about syncing desc's with Description.
    • Returning empty Description (: PedanticRegistry ignores that case. This is ofc is bad as registry allows to validate against duplicates.
    • ?

Acceptance Criteria

  • Fix the above.

Also, added issue for implementing those for darwin: #1590

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions