API Stability |
Long-Term
|
The generateAggregateAlertFromTemplate() GraphQL query field can generate an unsaved aggregate alert from a yaml template.
For more information on aggregate alerts, see the Aggregate alerts documentation page.
Syntax
Below is the syntax for the generateAggregateAlertFromTemplate() query field:
generateAggregateAlertFromTemplate(
input: GenerateAggregateAlertFromTemplateInput!
): UnsavedAggregateAlert!
Below is an example of how this query field might be used:
query {
generateAggregateAlertFromTemplate(
input: {viewName: "company-http",
yamlTemplate: "favorite-yaml-template"}
) {
name,
description,
throttleField,
actions {
id, name, isAllowedToRun
}
}
}
Given Datatypes
For
GenerateAggregateAlertFromTemplateInput
,
there are a couple of parameters. Below is a list of them along
with a description of each:
Table: GenerateAggregateAlertFromTemplateInput
Parameter | Type | Required | Default | Stability | Description |
---|---|---|---|---|---|
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column. | |||||
Table last updated: Sep 18, 2024 | |||||
viewName | RepoOrViewName | yes | Long-Term | The name of the view of the aggregate alert. RepoOrViewName is a scalar. | |
yamlTemplate | YAML | yes | Long-Term | YAML specification of the aggregate alert. |
Returned Datatypes
The returned datatype UnsavedAggregateAlert
has several parameters. Below is a list of them along with a
description of each:
Table: UnsavedAggregateAlert
Parameter | Type | Required | Default | Stability | Description |
---|---|---|---|---|---|
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column. | |||||
Table last updated: Oct 4, 2024 | |||||
actions | [Action ] | yes | Long-Term | List of actions to fire on query result. See Action . | |
description | string | Long-Term | Description of the aggregate alert. | ||
enabled | boolean | yes | Long-Term | Flag indicating whether the aggregate alert is enabled. | |
labels | [string] | yes | Long-Term | Labels attached to the aggregate alert. | |
name | string | yes | Long-Term | Name of the aggregate alert. | |
queryString | string | yes | Long-Term | The LogScale query to execute. | |
queryTimestampType | QueryTimestampType | yes | Long-Term | Timestamp type to use for a query. See QueryTimestampType . | |
searchIntervalSeconds | long | yes | Long-Term | The search interval in seconds. | |
throttleField | string | Long-Term | A field on which to throttle. Used only with throttleTimeSeconds . | ||
throttleTimeSeconds | long | yes | Long-Term | The throttle time in seconds. | |
triggerMode | TriggerMode | yes | Long-Term | The mode used for triggering the alert. See TriggerMode . |