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
b7c36b15
Commit
b7c36b15
authored
Mar 7, 2023
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Fix: do not spam errors for relatively common conditions
parent
6855bb2d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!543
Fix type of timestamp (float instead of int)
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker-compose/tango-prometheus-exporter/code/tango-prometheus-client.py
+3
-3
3 additions, 3 deletions
...tango-prometheus-exporter/code/tango-prometheus-client.py
with
3 additions
and
3 deletions
docker-compose/tango-prometheus-exporter/code/tango-prometheus-client.py
+
3
−
3
View file @
b7c36b15
...
@@ -176,7 +176,7 @@ class CustomCollector(object):
...
@@ -176,7 +176,7 @@ class CustomCollector(object):
attr_infos
=
{
attr_info
.
name
:
attr_info
for
attr_info
in
dev
.
attribute_list_query
()}
attr_infos
=
{
attr_info
.
name
:
attr_info
for
attr_info
in
dev
.
attribute_list_query
()}
if
dev
.
state
()
not
in
[
DevState
.
STANDBY
,
DevState
.
ON
,
DevState
.
ALARM
,
DevState
.
DISABLE
]:
if
dev
.
state
()
not
in
[
DevState
.
STANDBY
,
DevState
.
ON
,
DevState
.
ALARM
,
DevState
.
DISABLE
]:
logger
.
error
(
f
"
Error processing device
{
device_name
}
: it is in state
{
dev
.
state
()
}
"
)
logger
.
warning
(
f
"
Error processing device
{
device_name
}
: it is in state
{
dev
.
state
()
}
"
)
# at least log state & status
# at least log state & status
attrs_to_scrape
=
[
"
State
"
,
"
Status
"
]
attrs_to_scrape
=
[
"
State
"
,
"
Status
"
]
...
@@ -195,7 +195,7 @@ class CustomCollector(object):
...
@@ -195,7 +195,7 @@ class CustomCollector(object):
metrics
.
extend
(
self
.
metrics
(
dev
,
attr_infos
[
attr_name
],
attr_value
))
metrics
.
extend
(
self
.
metrics
(
dev
,
attr_infos
[
attr_name
],
attr_value
))
except
DevFailed
as
e
:
except
DevFailed
as
e
:
reason
=
e
.
args
[
0
].
desc
.
replace
(
"
\n
"
,
"
"
)
reason
=
e
.
args
[
0
].
desc
.
replace
(
"
\n
"
,
"
"
)
logger
.
error
(
f
"
Error processing device
{
device_name
}
attribute
{
attr_name
}
:
{
reason
}
"
)
logger
.
warning
(
f
"
Error processing device
{
device_name
}
attribute
{
attr_name
}
:
{
reason
}
"
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
exception
(
f
"
Error processing device
{
device_name
}
attribute
{
attr_name
}
"
)
logger
.
exception
(
f
"
Error processing device
{
device_name
}
attribute
{
attr_name
}
"
)
...
@@ -220,7 +220,7 @@ class CustomCollector(object):
...
@@ -220,7 +220,7 @@ class CustomCollector(object):
attribute_metrics
.
add_metric
(
*
metric
)
attribute_metrics
.
add_metric
(
*
metric
)
except
DevFailed
as
e
:
except
DevFailed
as
e
:
reason
=
e
.
args
[
0
].
desc
.
replace
(
"
\n
"
,
"
"
)
reason
=
e
.
args
[
0
].
desc
.
replace
(
"
\n
"
,
"
"
)
logger
.
error
(
f
"
Error processing device
{
device_name
}
:
{
reason
}
"
)
logger
.
warning
(
f
"
Error processing device
{
device_name
}
:
{
reason
}
"
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
exception
(
f
"
Error processing device
{
device_name
}
"
)
logger
.
exception
(
f
"
Error processing device
{
device_name
}
"
)
finally
:
finally
:
...
...
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