Skip to content

Alphabetize default metrics - #817

Open
jonsuguiyama wants to merge 1 commit into
prometheus:mainfrom
jonsuguiyama:alphabetize-default-metrics
Open

Alphabetize default metrics#817
jonsuguiyama wants to merge 1 commit into
prometheus:mainfrom
jonsuguiyama:alphabetize-default-metrics

Conversation

@jonsuguiyama

Copy link
Copy Markdown

Closes #810.

  • Reorder the metrics object in lib/defaultMetrics.js alphabetically by each module's Prometheus metric name.
  • In heapSizeAndUsed.js, move the shared collect() from the total gauge to the external gauge, since nodejs_external_memory_bytes now registers first alphabetically.
  • Add a test verifying default metric modules register in alphabetical order.
  • Update the existing heapSizeAndUsed test to read the external gauge first, since it now owns the shared collect.

Register default metric modules in alphabetical order of their metric
name in defaultMetrics.js. Move the shared collect() in
heapSizeAndUsed from the total gauge to the external gauge, since
nodejs_external_memory_bytes now sorts first. Add a test asserting
module registration order is alphabetical.

@jdmarshall jdmarshall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm on my way out the door at the moment but looks promising. Thank you.

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.

Alphabetize default metrics

2 participants