Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
af11f405
Commit
af11f405
authored
2 years ago
by
Stefano Di Frischia
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-777
: retrieve device list from tangodb
parent
ce0081a4
No related branches found
No related tags found
1 merge request
!387
Resolve L2SS-777 "Add observations to prometheus exporter"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker-compose/tango-prometheus-exporter/code/tango-prometheus-client.py
+15
-1
15 additions, 1 deletion
...tango-prometheus-exporter/code/tango-prometheus-client.py
with
15 additions
and
1 deletion
docker-compose/tango-prometheus-exporter/code/tango-prometheus-client.py
+
15
−
1
View file @
af11f405
...
@@ -176,6 +176,20 @@ class CustomCollector(object):
...
@@ -176,6 +176,20 @@ class CustomCollector(object):
return
metrics
return
metrics
def
device_list
(
self
)
->
list
:
"""
Retrieve the device list from TangoDB
"""
device_list
=
[]
db
=
Database
()
server_list
=
db
.
get_server_list
()
# e.g. SDP/STAT, RECV/STAT
for
i
in
range
(
0
,
len
(
server_list
)):
# https://pytango.readthedocs.io/en/stable/database.html#tango.Database.get_device_class_list
class_list
=
db
.
get_device_class_list
(
server_list
[
i
])
for
j
in
range
(
0
,
len
(
class_list
),
2
):
if
"
dserver
"
in
class_list
[
j
]:
continue
device_list
.
append
(
class_list
[
j
].
lower
())
return
device_list
def
collect
(
self
):
def
collect
(
self
):
"""
Yield all scraped metrics from all devices, as configured.
"""
"""
Yield all scraped metrics from all devices, as configured.
"""
...
...
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