MccsTile health
Tango attributes and their configuration
Every monitoring point on MccsTile (temperatures, voltages, currents, PLL
lock status, and so on) is exposed as a Tango attribute. Alongside its value,
every Tango attribute carries a quality factor
(tango.AttrQuality), which is one of:
ATTR_VALID- the value is within its configured normal range.ATTR_WARNING- the value has crossed a configured warning threshold.ATTR_ALARM- the value has crossed a configured alarm threshold.ATTR_INVALID- the value is not currently valid (for example, not yet read from hardware).
For numeric attributes, the thresholds that drive this quality factor are
configured on the attribute itself, via the min_alarm, max_alarm,
min_warning and max_warning parameters. These are the same
parameters returned by
DeviceProxy.get_attribute_config_ex,
and they can be inspected or changed at runtime using the standard PyTango
attribute configuration API. Tango itself is responsible for comparing
each new value against these thresholds and computing the resulting quality
factor whenever the attribute is updated - MccsTile does not compute
this quality factor itself. The thresholds are stored as configuration in
the Tango database, not hardcoded in MccsTile, so they can be inspected or
retuned per-deployment without a code change.
Some non-numeric attributes (for example boolean status flags) do not have
alarm/warning thresholds in the Tango sense. For these, MccsTile
computes the quality factor in software, for example treating a boolean
flag as ATTR_ALARM when it is in an unexpected state.
Every configured threshold and computed quality factor feeds into the
device’s overall healthState, via HealthRecorder, described below.
HealthRecorder
MccsTile does not derive healthState by re-evaluating raw monitoring
point values against a separate set of rules. Instead, it delegates this to
HealthRecorder, documented here,
a class in ska_low_mccs_common that derives a device’s healthState
and healthReport purely from the Tango quality factors of a
configured set of that device’s own attributes.
MccsTile uses TileHealthRecorder
(ska_low_mccs_spshw.tile.tile_health_recorder.TileHealthRecorder), a
subclass that extends HealthRecorder to additionally derive per-group
health for each of its monitoring groups (temperature, voltage, current,
ADC, timing, I/O and DSP), exposed as the intermediate *Health attributes
(for example temperatureHealth, voltageHealth) mentioned under
healthState below. Which attributes belong to which group is itself
derived from attribute_monitoring_point_map, described next.
Everything on this page only applies when the UseAttributesForHealth
device property is True (the default, per ADR-115). When it is False,
MccsTile instead falls back to the legacy TileHealthModel, which
re-evaluates raw values against its own rules rather than using
HealthRecorder. UseAttributesForHealth=False is deprecated and
due to be removed soon, along with TileHealthModel.
Monitored attributes and their TPM monitoring points
MccsTile reads raw hardware values from the TPM via the tpm-api’s
get_health_status() call, which returns a nested dictionary of
monitoring points (stored on the device as tile_health_structure). To
know which raw monitoring point feeds which Tango attribute, MccsTile
keeps a dictionary, attribute_monitoring_point_map:
the key is the Tango attribute name (for example
fpga1Temperature);the value is the dictionary traversal path (a list of keys) used to look up that monitoring point in the tpm-api monitoring point lookup table (for example
["temperatures", "FPGA0"]).
Each time new values are polled from hardware, MccsTile walks this path
into tile_health_structure to fetch the current value for every mapped
attribute, and pushes it as that attribute’s new value.
The full map, as of this writing, is:
Tango attribute |
TPM monitoring point path |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
healthState
MccsTile derives its healthState from the quality factors of its
monitored attributes, via HealthRecorder (see above), rather than by
re-evaluating raw values against a separate set of rules. Its health always
reflects the highest severity quality factor currently reported by any
monitored attribute:
If any monitored attribute is in
tango.AttrQuality.ATTR_ALARM, the device isFAILED.If none are in
ATTR_ALARMbut any are intango.AttrQuality.ATTR_WARNING, the device isDEGRADED.If all monitored attributes are
ATTR_VALID, the device isOK.If none of the above apply (for example, attributes are
ATTR_INVALIDand none are alarming or warning), the device isUNKNOWN.
This severity ordering means a single alarming attribute is enough to fail the device, regardless of how many other attributes are healthy, and a single warning is enough to degrade it in the absence of any alarm.
The same worst-of-quality evaluation is also applied per monitoring group
(temperature, voltage, current, ADC, timing, I/O and DSP), each exposed as
its own intermediate *Health attribute (for example
temperatureHealth, voltageHealth). The overall healthState is
the worst-of-quality result across all monitored attributes on the device.
healthReport
healthReport is a string attribute used to elaborate on the reason for
the current healthState. Rather than being computed on demand,
HealthRecorder subscribes to Tango change events on the monitored
attributes and keeps healthReport up to date as those events arrive:
Whenever a monitored attribute pushes a change event, its latest value and quality factor are recorded.
The device re-evaluates the worst-of-quality attribute(s) and, if the resulting
healthStateor report text has changed, updateshealthReportaccordingly.The report text identifies which attribute(s) are responsible for the current quality level, and their values, so that the cause of a
DEGRADEDorFAILEDhealthStatecan be identified without having to inspect every monitored attribute individually.
Because healthReport is driven by change events rather than polling, it
also needs to react to configuration changes that are not accompanied by a
new value - for example, tightening an alarm threshold on an attribute
whose value has not changed since it last updated. HealthRecorder
handles this by also subscribing to attribute configuration change events,
and re-evaluating quality against the latest cached value whenever
thresholds are reconfigured.