An objective is a means for measuring your services such as performance, availability, and security. You can define an objective for your guardian that is validated on demand or automatically.
If you want to reference a Classic SLO, you need to create a Classic SLO first and then the SRG allows you to select it.
You can add a new objective for measuring capacity objectives.
On the Site Reliability Guardian overview page, select Add new objective.
On the right side, enter a new Objective name.
Enter the Description.
You can optionally add links to provide validation insights for each objective. These links allow you to provide additional information about the objectives, which can be used when analyzing the results. For more information, see Validation insights.
Enter a DQL query to get the data for validating the objective.
Select Run query.
You can optionally set a unit conversion in Unit.
You can choose between No thresholds, Static thresholds, or Auto-adaptive thresholds.
If you choose Static thresholds:
Choose for Set static threshold, either A higher value is good for my result or A lower value is good for my result option.
Set failure by defining the value for Fails if result.
Set warning by defining the value for Warns if result.
If you choose Auto-adaptive thresholds, you have the option of selecting either A higher value is good for my result or A lower value is good for my result option.
It is possible to add an objective that is informational-only and doesn't contribute to the pass / fail decisions of the Site Reliability Guardian. They are useful for new services where you're trying to get an idea for the real-world data values of your metrics.
To set an objective as information-only
Use these objective examples as an inspiration for creating your own guardians.
8 errors, we want to receive a warning.10 errors or more, the objective should fail.Indicator
For this, we'll create a query that fetches the log events from your environment with the loglevel set to ERROR.
fetch logs| summarize countIf(loglevel == "ERROR")
Less or equal than (A lower value is good for my result)
10899 percent, we want to get a warning.98 percent, the objective should fail.Indicator
For this, we'll use a query that:
Fetches some specific log entries and parses them for events indicating requests.
Defines what's the successful response in these entries.
Measures the success criteria.
fetch logs| filter endsWith(log.source,"pgi.log")| parse content, "LD IPADDR:ip ':' LONG:payload SPACE LD 'HTTP_STATUS' SPACE INT:http_status LD (EOL|EOS)"| fieldsAdd success = toLong(http_status < 400)| summarize successRate = sum(success)/count() * 100
Greater or equals than (A higher value is good for my result)
9899Indicator
For this, we'll use a query that:
Fetches some specific log entries and parses them for events indicating requests.
Defines the failed request in these entries.
Measures the failure criteria.
fetch logs| filter endsWith(log.source,"pgi.log")| parse content, "LD 'HTTP_STATUS' SPACE INT:http_status LD (EOL|EOS)"| fieldsAdd failure = toLong(http_status >= 400)| summarize failureRate = sum(failure)/count() * 100
Less or equal than (A lower value is good for my result)
10.5Variables are defined at a guardian level and are available in all of its objectives to parameterize DQL queries. For example, they allow parameterization of the filter value in a DQL query, which is set at the validation time of a guardian.
There are several ways to add a variable.
Always remember to prepend a variable name with $ in your queries, followed by alphanumerical characters.
For example, if you create a variable named MyTotal, you need to refer to it as $MyTotal in your query.
To add a variable
Select the ellipse next to the title.

Select Variables.
In the Variables dialog, select Add variable.
In the Add a variable dialog, enter the Name and the Value.
Select Add. You created your variable.
To add a variable when you choose the Grail using DQL option while configuring your objective
$, followed by alphanumerical characters.There are two ways to set the value of a variable after adding it:
If no variable value is explicitly specified for one validation, then the one set during the guardian creation is used.
You can specify Segments for an objective to structure and conveniently filter data.
When creating or editing a DQL-based objective, use Segments right below the DQL Query editor to add, remove, or manage segments.