Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
brian-dashboard-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
brian
brian-dashboard-manager
Commits
5c0e7864
Commit
5c0e7864
authored
2 years ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
add templating changes for service-based dashboards
parent
3794a4a2
No related branches found
Branches containing commit
Tags
0.20
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
brian_dashboard_manager/templating/services.py
+35
-0
35 additions, 0 deletions
brian_dashboard_manager/templating/services.py
brian_dashboard_manager/templating/templates/shared/panel_target.json.j2
+7
-0
7 additions, 0 deletions
..._manager/templating/templates/shared/panel_target.json.j2
with
42 additions
and
0 deletions
brian_dashboard_manager/templating/services.py
0 → 100644
+
35
−
0
View file @
5c0e7864
from
typing
import
Dict
,
List
from
brian_dashboard_manager.templating.helpers
import
get_dashboard_data
def
get_panel_data
(
services
):
result
:
Dict
[
str
,
List
[
Dict
]]
=
{}
for
service
in
services
:
customers
=
service
.
get
(
'
customers
'
)
name
=
service
.
get
(
'
name
'
)
sid
=
service
.
get
(
'
sid
'
)
scid
=
service
.
get
(
'
scid
'
)
measurement
=
'
scid_rates
'
title
=
f
'
{
name
}
(
{
sid
}
)
'
for
customer
in
customers
:
result
.
setdefault
(
customer
,
[]).
append
({
'
measurement
'
:
measurement
,
'
title
'
:
title
,
'
scid
'
:
scid
,
'
has_v6
'
:
False
})
return
result
def
create_service_panels
(
services
,
datasource
):
panel_data
=
get_panel_data
(
services
)
for
dash
in
get_dashboard_data
(
data
=
panel_data
,
datasource
=
datasource
,
tag
=
'
SERVICE
'
):
yield
dash
This diff is collapsed.
Click to expand it.
brian_dashboard_manager/templating/templates/shared/panel_target.json.j2
+
7
−
0
View file @
5c0e7864
...
...
@@ -79,6 +79,13 @@
"operator": "=",
"value": "{{ subscription }}"
}
{% elif scid %}
{
"condition": null,
"key": "scid",
"operator": "=",
"value": "{{ scid }}"
}
{% else %}
{
"condition": null,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment