ui: Pass down nspace and dc from Service model down to prometheus request (#9175)
* Pass down nspace and dc from Service model down to prometheus request * Reviewing notes fix-ups * Fix on dc/nspace to send from upstream/downstream card
This commit is contained in:
parent
758384893d
commit
c6672da331
|
@ -7,7 +7,7 @@
|
|||
{{@item.Name}}
|
||||
</p>
|
||||
<div class="details">
|
||||
{{#if (and (and nspace (env 'CONSUL_NSPACES_ENABLED')) @type)}}
|
||||
{{#if (and (and @nspace (env 'CONSUL_NSPACES_ENABLED')) @type)}}
|
||||
<dl class="nspace">
|
||||
<dt>
|
||||
<Tooltip>
|
||||
|
@ -47,6 +47,8 @@
|
|||
{{#if (and @hasMetricsProvider (not-eq @service.Kind 'ingress-gateway'))}}
|
||||
{{#if (eq @type 'upstream')}}
|
||||
<TopologyMetrics::Stats
|
||||
@nspace={{@item.Namespace}}
|
||||
@dc={{@item.Datacenter}}
|
||||
@endpoint='upstream-summary-for-service'
|
||||
@service={{@service.Service}}
|
||||
@item={{@item.Name}}
|
||||
|
@ -54,6 +56,8 @@
|
|||
/>
|
||||
{{else}}
|
||||
<TopologyMetrics::Stats
|
||||
@nspace={{@item.Namespace}}
|
||||
@dc={{@item.Datacenter}}
|
||||
@endpoint='downstream-summary-for-service'
|
||||
@service={{@service.Service}}
|
||||
@item={{@item.Name}}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{{#if (gt @topology.Downstreams.length 0)}}
|
||||
<div id="downstream-container">
|
||||
<div>
|
||||
<p>{{@topology.Datacenter}}</p>
|
||||
<p>{{@dc}}</p>
|
||||
<span>
|
||||
<Tooltip>
|
||||
Only showing downstreams within the current datacenter for {{@service.Service.Service}}.
|
||||
|
@ -17,9 +17,10 @@
|
|||
</div>
|
||||
{{#each @topology.Downstreams as |item|}}
|
||||
<TopologyMetrics::Card
|
||||
@item={{item}}
|
||||
@nspace={{@nspace}}
|
||||
@dc={{@dc}}
|
||||
@service={{@service.Service}}
|
||||
@dc={{@topology.Datacenter}}
|
||||
@item={{item}}
|
||||
@hasMetricsProvider={{this.hasMetricsProvider}}
|
||||
@noMetricsReason={{this.noMetricsReason}}
|
||||
/>
|
||||
|
@ -32,16 +33,18 @@
|
|||
</div>
|
||||
{{#if this.hasMetricsProvider }}
|
||||
<TopologyMetrics::Series
|
||||
@nspace={{@nspace}}
|
||||
@dc={{@dc}}
|
||||
@service={{@service.Service.Service}}
|
||||
@dc={{@topology.Datacenter}}
|
||||
@protocol={{@topology.Protocol}}
|
||||
@noMetricsReason={{this.noMetricsReason}}
|
||||
/>
|
||||
{{#if (not-eq @service.Service.Kind 'ingress-gateway')}}
|
||||
<TopologyMetrics::Stats
|
||||
@nspace={{@nspace}}
|
||||
@dc={{@dc}}
|
||||
@endpoint='summary-for-service'
|
||||
@service={{@service.Service.Service}}
|
||||
@dc={{@topology.Datacenter}}
|
||||
@protocol={{@topology.Protocol}}
|
||||
@noMetricsReason={{this.noMetricsReason}}
|
||||
/>
|
||||
|
@ -73,9 +76,10 @@
|
|||
<p>{{dc}}</p>
|
||||
{{#each upstreams as |item|}}
|
||||
<TopologyMetrics::Card
|
||||
@nspace={{@nspace}}
|
||||
@dc={{@dc}}
|
||||
@item={{item}}
|
||||
@service={{@service.Service}}
|
||||
@dc={{@topology.Datacenter}}
|
||||
@type='upstream'
|
||||
@hasMetricsProvider={{this.hasMetricsProvider}}
|
||||
@noMetricsReason={{this.noMetricsReason}}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{#unless @noMetricsReason}}
|
||||
<DataSource
|
||||
@src={{uri nspace dc 'metrics' 'summary-for-service' @service @protocol}}
|
||||
@src={{uri @nspace @dc 'metrics' 'summary-for-service' @service @protocol}}
|
||||
@onchange={{action 'change'}}
|
||||
@onerror={{action (mut error) value="error"}}
|
||||
/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{#unless @noMetricsReason}}
|
||||
<DataSource
|
||||
@src={{uri nspace dc 'metrics' @endpoint @service @protocol}}
|
||||
@src={{uri @nspace @dc 'metrics' @endpoint @service @protocol}}
|
||||
@onchange={{action 'statsUpdate'}}
|
||||
@onerror={{action (mut error) value="error"}}
|
||||
/>
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
{{/if}}
|
||||
{{#if topology}}
|
||||
<TopologyMetrics
|
||||
@nspace={{nspace}}
|
||||
@dc={{dc}}
|
||||
@service={{items.firstObject}}
|
||||
@topology={{topology}}
|
||||
@metricsHref={{render-template urls.service (hash
|
||||
|
|
Loading…
Reference in New Issue