Monitor
Monitor is Lumar's ongoing site health tracking feature. It works alongside Protect (builds and tests) to give you continuous visibility into how your site's metrics change over time.
How Monitor works
In the Monitor context, projects are the primary entity. You can list all monitor projects on an account using the monitorProjects field on Account, and retrieve a single project using getProject. Each project contains builds, tests, and monitoring configuration.
In Lumar's GraphQL schema, Project and TestSuite both implement the BaseProject interface and are effectively the same entity. The Monitor UI works with projects (monitorProjects, getProject), but some mutations still use testSuiteId as a parameter name. When a mutation requires a testSuiteId, pass your project ID -- they are interchangeable.
Monitor tracks the results of health score tests and Protect test results across builds. When a test fails or a health score degrades, Monitor surfaces those changes so you can take action -- either manually or through automated notifications via webhooks and email alerts.
Querying test results
Retrieve the latest build's test results for a project. Each test result shows whether the test passed, the measured value, and the configured threshold.
- Query
- Variables
- Response
- cURL
query GetTestResults($testSuiteId: ObjectID!) {
node(id: $testSuiteId) {
... on TestSuite {
id
name
builds(first: 1, orderBy: [{ field: createdAt, direction: DESC }]) {
nodes {
id
status
createdAt
testResults(first: 10) {
nodes {
id
passed
reportTemplate {
code
name
}
absoluteThreshold
reportTotalRows
severity
}
totalCount
}
}
}
}
}
}
{
"testSuiteId": "TjAxMVRlc3RTdWl0ZTEyMw"
}
{
"data": {
"node": {
"id": "TjAxMVRlc3RTdWl0ZTEyMw",
"name": "Production SEO Suite",
"builds": {
"nodes": [
{
"id": "TjAxMkJ1aWxkNDU2",
"status": "Finished",
"createdAt": "2025-01-15T10:00:00.000Z",
"testResults": {
"nodes": [
{
"id": "TjAxM1Rlc3RSZXN1bHQ3ODk",
"passed": true,
"reportTemplate": {
"code": "broken_pages",
"name": "Broken Pages"
},
"absoluteThreshold": 5.0,
"reportTotalRows": 2.0,
"severity": "Fail"
}
],
"totalCount": 1
}
}
]
}
}
}
}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"query GetTestResults($testSuiteId: ObjectID!) { node(id: $testSuiteId) { ... on TestSuite { id name builds(first: 1, orderBy: [{ field: createdAt, direction: DESC }]) { nodes { id status createdAt testResults(first: 10) { nodes { id passed reportTemplate { code name } absoluteThreshold reportTotalRows severity } totalCount } } } } } }","variables":{"testSuiteId":"TjAxMVRlc3RTdWl0ZTEyMw"}}' https://api.lumar.io/graphql
Managing notification status
Use updateMonitorNotificationsStatus to acknowledge or dismiss notifications for specific test results. This is useful when building custom notification workflows.
- Mutation
- Variables
- Response
- cURL
mutation UpdateMonitorNotificationsStatus($input: UpdateMonitorNotificationsStatusInput!) {
updateMonitorNotificationsStatus(input: $input) {
updatedTestResultsCount
}
}
{
"input": {
"accountId": "TjAwN0FjY291bnQ3MTU",
"testResultIds": ["TjAxM1Rlc3RSZXN1bHQ3ODk"]
}
}
{
"data": {
"updateMonitorNotificationsStatus": {
"updatedTestResultsCount": 1
}
}
}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"mutation UpdateMonitorNotificationsStatus($input: UpdateMonitorNotificationsStatusInput!) { updateMonitorNotificationsStatus(input: $input) { updatedTestResultsCount } }","variables":{"input":{"accountId":"TjAwN0FjY291bnQ3MTU","testResultIds":["TjAxM1Rlc3RSZXN1bHQ3ODk"]}}}' https://api.lumar.io/graphql
Setting up monitoring workflows
A typical monitoring workflow involves:
- Create a project with tests that define your acceptance criteria (see Protect documentation).
- Set up a build schedule to run tests on a recurring cadence (e.g., weekly).
- Configure webhooks to receive real-time alerts when tests fail (see Webhooks).
- Query test results programmatically to feed data into your own dashboards or alerting systems.
Webhook integration
Monitor integrates with webhooks to push alerts when builds complete. You can configure:
- API callbacks -- POST requests to your own endpoint with test result payloads.
- Slack webhooks -- messages sent to a Slack channel.
- MS Teams webhooks -- messages sent via Microsoft Teams connectors.
See the Webhooks guide for details on setting up webhook notifications, and the webhook payload documentation for the payload schema.