Pager¶
A Pager in DataOS is a Resource that enables data developers to specify criteria for identifying an incident within the incident stream and delivering it to a user-specified destination. It operates by evaluating pre-defined conditions against incoming incident data from the incident stream. Upon identifying a match, it triggers an alert and delivers it to the specified destination.
The Pager along with Monitor Resource comprise the backbone of the DataOS Observability and enable proactive alerting mechanism in response to specified threshold metrics and events.
-
How to create and manage a Pager?
Learn how to create and manage a Pager in DataOS.
-
How to configure the manifest file of Pager?
Discover how to configure the manifest file of Pager by adjusting its attributes.
-
How does a Pager work?
Understand the inner workings of a Pager within DataOS.
-
Pager recipes
Explore examples showcasing the usage of Pager in various scenarios.
How to create and manage a Pager?¶
Create a Pager manifest¶
To create a Pager, the first step is to create a Pager manifest file. A sample Pager manifest is given below:
Example Pager manifest
# Resource meta section (1)
name: pager-workflow-runtime-fail-alert
version: v1alpha
type: pager
description: sends alerts to email and teams when a workflow fail to run.
# Pager-specific section (2)
pager:
# Conditions (3)
conditions:
- valueJqFilter: .properties.name
operator: equals
value: workflowrunfailed
- valueJqFilter: .properties.severity
operator: equals
value: high
# Output (4)
output:
email:
emailTargets:
- thor@example.com
- ironman@example.com
msTeams:
webHookUrl: https://example.com/webhook
webHook:
url: https://example.com/webhook
verb: post
headers:
'content-type': 'application/json'
bodyTemplate: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":warning: Incident detected by, {{.Monitor.Name}}!"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Incident Type* - {{.Properties.Severity}} was observed at *Publish Time* - {{.CreateTime}}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "{{.Monitor.Description}}"
}
}
]
}
-
Resource meta section within a manifest file comprises metadata attributes universally applicable to all Resource-types. To learn more about how to configure attributes within this section, refer to the link: Attributes of Resource meta section.
-
Pager-specific section within a manifest file comprises attributes specific to the Pager Resource. This section is further subdivided into: Conditions, and Output section. To learn more about how to configure attributes of Pager-specific section, refer to the link: Attributes of Pager manifest.
-
Conditions are defined using the information received on the incident payload against which the condition is matched. To learn more about the attributes of conditions, refer to the following link
-
Output is the destination where the notification is delivered once the alert is triggered by the Pager Service. Learn more about the attributes of output, here.
The Pager manifest file is structurally comprised of the following sections:
Resource meta section¶
In DataOS, a Pager is categorized as a Resource-type. The Resource meta section within a manifest file comprises metadata attributes universally applicable to all DataOS Resources. This information is stored in the Poros database. The provided codeblock elucidates the requisite attributes for this section:
For more information about the various attributes in Resource meta section, refer to the Attributes of Resource meta section.
Pager-specific section¶
The Pager-specific section of a Pager manifest comprises attributes-specific to the Pager Resource. This comprise of two separate sections.
Conditions¶
Conditions are defined using the information received on the incident payload against which the condition is matched. A single condition is a YAML mapping that is uniquely identified by a combination of three different attributes, valueJqFilter
, operator
and value
.
A single condition can be configured within a Pager manifest by the following syntax:
Multiple conditions can be configured by specifying them as a list of mappings. Each mapping includes three separate attributes. All specified conditions are evaluated using the AND logic.
The table below describes the various attributes used for defining conditions:
Attribute | Data Type | Default Value | Possible Value | Requirement |
---|---|---|---|---|
conditions |
mapping | none | none | mandatory |
valueJqFilter |
string | none | valid jq filter | mandatory |
operator |
string | none | equals | mandatory |
value |
string | none | valid value | mandatory |
For more information about the below attributes, refer to the link: Attributes of Pager manifest.
Output¶
An output is the destination where the notification is delivered once the alert is triggered from the Pager Service. Currently the following destinations are supported:
- Microsoft Teams
- Web Hook
For webhooks that don't require additional authorization parameters
For webhooks that require additional authorization parameters
The syntax for providing additional authorization details is provided below:
The table below describes the various attributes used for defining conditions:
Attribute | Data Type | Default Value | Possible Value | Requirement |
---|---|---|---|---|
output |
mapping | none | none | mandatory |
webhook |
string | none | valid webhook attributes | mandatory |
url |
string | none | valid webhook url | mandatory |
verb |
string | none | POST | mandatory |
headers |
string | none | valid api headers | mandatory |
authorization |
string | none | valid api headers | mandatory |
For more information about the below attributes, refer to the link below: Attributes of Pager
Applying a Pager manifest¶
Once you have created a Pager manifest, you can instantiate a Pager Resource-instance within the DataOS using the apply
command on the DataOS command line interface. The command is as follows:
Replace the ${yaml-file-path}
and ${workspace-name}
with respective absolute or relative file path of the Pager manifest and the Workspace name in which the Resource is to be instantiated.
Verify Pager Creation¶
To confirm that your Pager has been successfully created, you can verify it using two methods:
- Check Pagers in a Workspace: Use the following command to list the Pagers created by you in a specific Workspace:
- Retrieve All Pagers in a Workspace: To retrieve the list of all Pagers created in the Workspace, add the
-a
flag to the command:
You can also access the details of any created Pager through the DataOS GUI in the Resource tab of the Operations App.
Managing a Pager¶
Debugging a Pager¶
When a Pager encounters errors, data developers can employ various tactics to diagnose and resolve issues effectively. Here are the recommended debugging techniques:
-
Get Pager details
-
Retrieve detailed information about the Pager to gain deeper insights into its configuration and execution status. This can be accomplished using the following command:
-
Review the output to identify any discrepancies or misconfigurations in the Pager that could be contributing to the error.
-
-
Check Pager Service Logs
- Navigate to the Operations App, and switch to its Core Kernel Tab, within the Pods section you will find the Pager API Service pod. By clicking on it you check out the Pod Details, Pod YAML, Pod Logs, and Pod Usage.
Pager Service pod logs - Analyze the logs for any error messages or exceptions that might provide insights into the cause of the issue.
Deleting a Pager¶
To remove a specific Pager Resource-instance from the DataOS environment, you can use the delete
command. There are three methods to delete a Pager:
Method 1: Delete by Name
- Copy the name of the Lakehouse from the output table of the
get
command. - Use the name as a string in the delete command.
Method 2: Delete by YAML File
-
Specify the path of the YAML file containing Lakehouse configuration.
-
Use the
delete
command with the-f
flag.
Method 3: Delete by Workspace, Resource-type, and Name
- Specify the Workspace, Resource-type, and Pager name in the
delete
command.
After executing the delete command, you will receive a confirmation message indicating successful deletion of the Pager.
How to configure a Pager manifest file?¶
The Pager manifest file serves as the blueprint for defining the structure and behavior of Pager Resources within DataOS. By configuring various attributes within the the Pager manifest file, data developers can customize the functionality of their Pagers to meet specific requirements. Below is an overview of the key attributes used to configure a the Pager-specific section: Attributes of a Pager manifest.
For details about the Resource meta section, refer to the Attributes of Resource meta section
How does a Pager work?¶
A Pager within DataOS operates by continuously monitoring the incident stream for occurrences that match predefined criteria, known as conditions. Here's a breakdown of how a Pager functions:
-
Condition Evaluation: The Pager evaluates incoming incident data against the conditions specified in its manifest file. These conditions typically include attributes like severity, type, name of the incident, etc.
-
Matching Criteria: When an incident matches all specified conditions, the Pager identifies it as a trigger for an alert. This matching process ensures that only relevant incidents initiate alert notifications.
-
Alert Triggering: Upon identifying a matching incident, the Pager triggers an alert, notifying designated recipients or systems about the occurrence. The alert can be sent to various destinations such as email, Microsoft Teams, or custom webhooks.
-
Destination Delivery: Depending on the configuration, the alert is delivered to the specified destination. For example, if the Pager is configured to send alerts via email, it will generate an email containing details of the incident and send it to the designated email addresses.