This repository has been archived by the owner on Jun 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
feat!: return metrics objects from register instead of updating with an options object #310
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…options object Removes the component update methods in favour of registering metrics once with methods that return objects which can wrap metric gathering implementations. This lets us return a wrapped prometheus gauge and avoid concatenating strings, etc when extracting metrics. Arbitrary metrics for generating line graphs are present as before, extra `registerHistogram` etc methods can be added at a later date when required.
achingbrain
added a commit
to libp2p/js-libp2p-tcp
that referenced
this pull request
Nov 5, 2022
Uses new metrics interface from libp2p/js-libp2p-interfaces#310 to report useful connection metrics. Similar to #217 but it adds the listening host/port to the metrics name to allow multiple TCP listeners to report metrics separately.
github-actions bot
pushed a commit
that referenced
this pull request
Nov 5, 2022
## [@libp2p/interface-metrics-v4.0.0](https://github.com/libp2p/js-libp2p-interfaces/compare/@libp2p/interface-metrics-v3.0.0...@libp2p/interface-metrics-v4.0.0) (2022-11-05) ### ⚠ BREAKING CHANGES * the global/per-peer moving average tracking has been removed from the interface as it's expensive and requires lots of timers - this functionality can be replicated by implementations if it's desirable. It's better to have simple counters instead and let an external system like Prometheus or Graphana calculate the values over time ### Features * return metrics objects from register instead of updating with an options object ([#310](#310)) ([3b106ce](3b106ce))
🎉 This PR is included in version @libp2p/interface-metrics-v4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
achingbrain
added a commit
to libp2p/js-libp2p-tcp
that referenced
this pull request
Nov 5, 2022
Uses new metrics interface from libp2p/js-libp2p-interfaces#310 to report useful connection metrics. Similar to #217 but it adds the listening host/port to the metrics name to allow multiple TCP listeners to report metrics separately. BREAKING CHANGE: requires metrics interface v4
github-actions bot
pushed a commit
that referenced
this pull request
Nov 5, 2022
## [@libp2p/interface-mocks-v8.0.0](https://github.com/libp2p/js-libp2p-interfaces/compare/@libp2p/interface-mocks-v7.1.0...@libp2p/interface-mocks-v8.0.0) (2022-11-05) ### ⚠ BREAKING CHANGES * the global/per-peer moving average tracking has been removed from the interface as it's expensive and requires lots of timers - this functionality can be replicated by implementations if it's desirable. It's better to have simple counters instead and let an external system like Prometheus or Graphana calculate the values over time ### Features * return metrics objects from register instead of updating with an options object ([#310](#310)) ([3b106ce](3b106ce)) ### Bug Fixes * update project config ([#311](#311)) ([27dd0ce](27dd0ce)) ### Dependencies * update sibling dependencies ([6f41152](6f41152))
🎉 This PR is included in version @libp2p/interface-mocks-v8.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removes the component update methods in favour of registering metrics once with methods that return objects which can wrap metric gathering implementations.
This lets us (for example) return a wrapped prometheus gauge and avoid concatenating strings, etc when extracting metrics.
Register methods for metrics (prometheus gauges) and counters are present, extra
registerHistogram
etc methods can be added at a later date when required.Single metrics
Before:
After:
Metric groups
Before:
After:
Extracting metrics
This has got much simpler, this example is from an upcoming PR to js-ipfs:
BREAKING CHANGE: the global/per-peer moving average tracking has been removed from the interface as it's expensive and requires lots of timers - this functionality can be replicated by implementations if it's desirable. It's better to have simple counters instead and let an external system like Prometheus or Graphana calculate the values over time