Skip to content

Conversation

tylerauerbeck
Copy link
Contributor

backend: use updated echo prometheus library

echo has an updated prometheus library that they recommend moving toward. While the existing library isn't outright labeled as outdated, most documentation points at migrating to the new library.

How to use

Startup Nebraska/backend as expected. Hit the /metrics endpoint and verify that the expected metrics are in place.

Testing done

make ci to ensure no existing code is impacted. A quick glance at metrics appears to show the same metrics output

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
Copy link
Collaborator

@ervcz ervcz left a comment

Choose a reason for hiding this comment

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

Thank you @tylerauerbeck for this contribution!

Double checked myself as well, the metrics endpoint seems to be functioning the same way as before :)

Copy link
Contributor

@tormath1 tormath1 left a comment

Choose a reason for hiding this comment

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

CI is failling:

panic: duplicate metrics collector registration attempted [recovered]
	panic: duplicate metrics collector registration attempted

Quickly checking the diff between the two libs, the "old" one is using defaultSubsystem = "echo" to register the Prometheus middleware while the "new one" uses the serviceName.

(see: https://github.com/labstack/echo-contrib/blob/109512b02b338ee9bb648ed9c4d17e2b525cbc52/prometheus/prometheus.go#L197)

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.

3 participants