summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRafael Weingärtner <rafael@apache.org>2020-05-29 12:42:28 -0300
committerRafael Weingärtner <rafael@apache.org>2020-07-21 23:44:15 -0300
commit51119ddc1c7a98674ac9216cbfb890b1a2dab6a2 (patch)
tree48693d497fecac7f236d3eef21b2654bcf55450d /doc
parent57017afbcb2bab1791fe50ee6143f89368ba909e (diff)
downloadceilometer-51119ddc1c7a98674ac9216cbfb890b1a2dab6a2.tar.gz
Allow operations on Ceilometer dynamic pollster to reference the sample itself
This issue is to allow operators to create expressions that can reference the sample itself. Currently, the expression is allowed only for fields in the sample, and not the sample itself. We discovered this requirement when developing pollsters for Cinder; the attribute `volume_image_metadata` is not returned in the API response when it does not exist, therefore, we need a method to check if it exist before trying to retrieve it. Change-Id: I5d3eb04534afaeb556ddab4ef603a205745883b8
Diffstat (limited to 'doc')
-rw-r--r--doc/source/admin/telemetry-dynamic-pollster.rst9
1 files changed, 7 insertions, 2 deletions
diff --git a/doc/source/admin/telemetry-dynamic-pollster.rst b/doc/source/admin/telemetry-dynamic-pollster.rst
index c56725bc..6ed1faa2 100644
--- a/doc/source/admin/telemetry-dynamic-pollster.rst
+++ b/doc/source/admin/telemetry-dynamic-pollster.rst
@@ -40,8 +40,13 @@ attributes to define a dynamic pollster:
* ``value_attribute``: mandatory attribute; defines the attribute in the
JSON response from the URL of the component being polled. We also accept
nested values dictionaries. To use a nested value one can simply use
- ``attribute1.attribute2.<asMuchAsNeeded>.lastattribute``. In our magnum
- example, we can use ``status`` as the value attribute;
+ ``attribute1.attribute2.<asMuchAsNeeded>.lastattribute``. It is also
+ possible to reference the sample itself using ``.``; the self reference
+ of the sample is interesting in cases when the attribute might not exist.
+ Therefore, together with the operations one can first check if it exist
+ before retrieving it (e.g.
+ `` . | value['some_field'] if 'some_field' in value else ''``).
+ In our magnum example, we can use ``status`` as the value attribute;
* ``endpoint_type``: mandatory field; defines the endpoint type that is
used to discover the base URL of the component to be monitored; for