-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metrics rendering to the new topology view. #8858
Conversation
Working on getting this setup to test against real Prometheus in Firefox and getting 404s from the metrics proxy (but at least I've got it loading the module now!) - how would you pass config to tell it where to find a Prometheus instance in a setup like https://github.com/mkeeler/consul-docker-test/tree/master/mesh-gateways-l7? |
@mikemorris sorry doc are on my TODO list here! The correct config for this for a "real" prometheus should be: ui_config {
enabled = true
metrics_provider = "prometheus"
metrics_proxy {
base_url = "http(s)://<your prometheus instance>:<port>"
}
} In Matt's docker setup, I believe prometheus is exported on localhost:9090 so it would be: |
Last commit threaded protocol through based on the still-in-review #8868 and it's api-double counterpart: hashicorp/consul-api-double#39 |
<div class="tooltip"> | ||
<div class="sparkline-time">Timestamp</div> | ||
</div> | ||
{{!-- TODO: fix loading state --}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is done. will remove
7079854
to
2ab9f9e
Compare
Got this running against a live Prometheus instance and gonna drop a few notes here:
|
5011147
to
743a927
Compare
743a927
to
1ba0985
Compare
…s reasonable mock responses
- Loading state for graph - Added fake latency cookie value to test loading - If metrics provider has no series/stats for the service show something that doesn't look broken - Graph hover works right to the edge now - Stats boxes now wrap so they are either shown or not as will fit not cut off - Graph resizes when browser window size changes - Some tweaks to number formats and stat metrics to make them more compact/useful
1. Remove fakeLatency setTimeout (will be replaced with CONSUL_LATENCY in mocks) 2. Make sure any event handlers are removed
1ba0985
to
2b0a23e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨ 🎨 LGTM
This is mostly working but certainly has bugs and a few TODOs:
TODO
Known Issues
pointer-events: none;
on the arrow divs (assuming we don't need mouse interaction on them.Dev notes.
There are some new cookie values you can set to control the topology data:
CONSUL_UPSTEAM_COUNT
CONSUL_DOWNSTREAM_COUNT
CONSUL_METRICS_POLL_INTERVAL
(in milliseconds) this is useful to stop updating while you are trying to debug the stats/graph layout etc.CONSUL_METRICS_LATENCY_MAX
(in milliseconds) will add an artificial random delay up to this value to metrics loading to see the loading experience more like with a real backend. Can set it really long to style loading elements.