Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 4809621

Browse files
committed
Rewrite sample code explanation
1 parent 67b2830 commit 4809621

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

alerts-detectors-notifications/slo/create-slo.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,22 @@ Follow these steps to create an SLO.
4646
* - :guilabel:`Filters`
4747
- Enter any additional dimension names and values you want to apply this SLO to. Alternatively, use the ``NOT`` filter, represented by an exclamation point ( ! ), to exclude any dimension values from this SLO configuration.
4848

49-
To use a custom metric as the system health indicator for your SLI configuration, follow these steps:
49+
To use a metric of your choice as the system health indicator for your SLI configuration, follow these steps:
5050

5151
#. For the :guilabel:`Metric type` field, select :guilabel:`Custom metric` from the dropdown menu. The SignalFlow editor appears.
52-
#. In the SignalFlow editor, you can see the following placeholder text:
52+
#. In the SignalFlow editor, you can see the following code sample:
5353

5454
.. code-block:: python
5555
5656
G = data('good.metric', filter=filter('sf_error', 'false'))
5757
T = data('total.metric')
5858
59-
* Line 1 defines the metric you want to use for the success request count as a variable named ``G``. Replace ``'good.metric'`` with the name of the metric you want to track. Replace the example filters with appropriate filters for the dimension that distinguishes success requests from total requests.
60-
* Line 2 defines the metric you want to use for the total request count as a variable named ``T``. Replace ``'total.metric'`` with the name of the metric you want to track.
59+
* Line 1 defines ``G`` as a data stream of ``good.metric`` metric time series (MTS). The SignalFlow ``filter()`` function queries for a collection of MTS with value ``false`` for the ``sf_error`` dimension. The filter distinguishes successful requests from total requests, making ``G`` good events variable.
60+
* Line 2 defines ``T`` as a data stream ``total.metric`` MTS. ``T`` is the total events variable.
6161

62-
You can also rename the variables.
62+
Replace the code sample with your own SignalFlow program. You can define good events and total events variables using any metric and supported SignalFlow function. For more information, see :new-page:`Analyze data using SignalFlow <https://dev.splunk.com/observability/docs/signalflow>` in the Splunk Observability Cloud Developer Guide.
6363

64-
#. If you rename the variables, select new variable names for the :guilabel:`Good events (numerator)` and :guilabel:`Total events (denominator)` dropdown menus.
64+
#. Select appropriate variable names for the :guilabel:`Good events (numerator)` and :guilabel:`Total events (denominator)` dropdown menus.
6565

6666
.. note:: Custom metric SLO works by calculating the percentage of successful requests over a given compliance period. This calculation works better for counter and histogram metrics than for gauge metrics. Gauge metrics are not suitable for custom metric SLO, so you might get confusing data when selecting gauge metrics in your configuration.
6767

0 commit comments

Comments
 (0)