-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from tiithansen/ingress-page
Multiple ingress improvements
- Loading branch information
Showing
14 changed files
with
423 additions
and
69 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { PanelBuilders, SceneQueryRunner } from "@grafana/scenes" | ||
|
||
export function getNginxLatencyPanel(ingress: string, namespace: string) { | ||
return PanelBuilders.timeseries() | ||
.setTitle('Latency P95 [5m]') | ||
.setData( | ||
new SceneQueryRunner({ | ||
datasource: { | ||
uid: '$datasource', | ||
type: 'prometheus', | ||
}, | ||
queries: [ | ||
{ | ||
refId: 'latency', | ||
expr: ` | ||
histogram_quantile( | ||
0.95, | ||
sum( | ||
rate( | ||
nginx_ingress_controller_request_duration_seconds_bucket{ | ||
cluster="$cluster", | ||
ingress="${ingress}", | ||
exported_namespace="${namespace}", | ||
}[5m] | ||
) | ||
) by (host, path, le) | ||
) | ||
`, | ||
legendFormat: '{{host}} - {{path}}', | ||
}, | ||
], | ||
}) | ||
) | ||
.build() | ||
} | ||
|
||
export function getNginxRequestRatePanel(ingress: string, namespace: string) { | ||
return PanelBuilders.timeseries() | ||
.setTitle('Request Rate [5m]') | ||
.setData( | ||
new SceneQueryRunner({ | ||
datasource: { | ||
uid: '$datasource', | ||
type: 'prometheus', | ||
}, | ||
queries: [ | ||
{ | ||
refId: 'rate', | ||
expr: ` | ||
sum( | ||
rate( | ||
nginx_ingress_controller_requests{ | ||
cluster="$cluster", | ||
ingress="${ingress}", | ||
exported_namespace="${namespace}", | ||
}[5m] | ||
) | ||
) by (host, path, status) | ||
`, | ||
legendFormat: '[{{status}}] {{host}} - {{path}}', | ||
}, | ||
], | ||
}) | ||
) | ||
.build() | ||
} |
Oops, something went wrong.