For the complete documentation index, see llms.txt. Markdown versions are available by appending .md to documentation URLs.

How do I get alerted when a new exception type appears after a release?

Last Updated: December 03, 20268 min read

In SigNoz Cloud or self-hosted SigNoz, use a ClickHouse query in an exceptions-based alert to compare recent exceptions with those recorded during a baseline period. The alert fires when a service throws an exception type absent from that baseline. The notification identifies the service and exception type, so you can check for new exceptions after a release.

The setup below uses custom SQL to compare exceptions from the last five minutes with those from the seven days before that window.

Prepare the baseline

Before you create the alert, confirm that your application sends exceptions to SigNoz Cloud as span events. An error span or an error log alone does not add an exception to the table used by this query. See what counts as an exception for the required span event.

Choose a baseline that covers your release cycle and scheduled jobs. For example, a 30-day baseline can include an exception from a monthly batch job that seven days would miss. A shorter baseline can alert on a rare exception the service has thrown before.

Wait until SigNoz Cloud has ingested data for the full baseline period before you rely on the alert. For a seven-day baseline, that means seven days after you start sending traces. Gaps from collection outages or sampling can make existing exception types look new.

Check that your retention settings keep the required history. SigNoz Cloud keeps traces for 15 days by default, so a 30-day baseline needs a longer retention period.

The query below uses INTERVAL 7 DAY for the baseline. To use a different period, replace that value with INTERVAL 14 DAY, INTERVAL 30 DAY, or another interval.

Create the alert

Add the ClickHouse query

In SigNoz Cloud, open the query editor with these steps:

  1. Open Alerts > New Alert.
  2. Select Exceptions-based Alert.
  3. Choose ClickHouse Query.

Paste the following query into the editor. The query counts exceptions per minute for each service and exception type pair. It excludes pairs already seen in the baseline. The traces schema reference describes the exception table used in the query.

SELECT
	serviceName,
	exceptionType,
	toStartOfInterval(timestamp, toIntervalMinute(1)) AS interval,
	count() AS value
FROM signoz_traces.distributed_signoz_error_index_v2
WHERE timestamp >= {{.start_datetime}}
	AND timestamp < {{.end_datetime}}
	AND exceptionType != ''
	AND (serviceName, exceptionType) GLOBAL NOT IN (
		SELECT DISTINCT serviceName, exceptionType
		FROM signoz_traces.distributed_signoz_error_index_v2
		WHERE timestamp >= {{.start_datetime}} - INTERVAL 7 DAY
			AND timestamp < {{.start_datetime}}
	)
GROUP BY serviceName, exceptionType, interval
ORDER BY interval, serviceName, exceptionType

The baseline ends where the evaluation window begins, so it excludes exceptions from that window. The query checks each service separately, so an exception type already seen in one service can still count as new in another.

If you adjust the query, keep these parts as written:

  • Leave {{.start_datetime}} and {{.end_datetime}} unquoted. SigNoz Cloud replaces them with the evaluation window's start and end times.
  • Keep the value and interval columns. SigNoz Cloud uses them to evaluate the alert.
  • Compare serviceName and exceptionType. Exception messages often contain IDs or other changing values, so comparing messages can create extra alerts.

A longer baseline makes the subquery read more data on every check. For large datasets, filter both parts of the query to the same services. Measure the query time before you schedule the one-minute checks below.

Set when the alert fires

The query's serviceName and exceptionType columns become labels on each alert. Group by both labels to identify each new pair, then set the condition and evaluation window:

SettingValue
ConditionAbove 0
Match typeAt least once
Evaluation windowLast 5 minutes, rolling
How often to checkEvery 1 minute
Group alerts byserviceName, exceptionType
Alert when data stops comingOff
Minimum data requiredOff

The query returns no rows when every recent pair is already in the baseline. An empty result is normal for this alert.

To require several occurrences before the alert fires, change Match type to In total and raise the threshold. For example, Above 4 fires when a new pair reaches five events within the five-minute window.

Choose a notification channel

Select your Slack or webhook notification channel. Use the alert labels in the message to identify the service and exception type:

New exception type $exceptionType in $serviceName. Check the latest release and exception details.

Save the alert after you set the notification channel and message.

Test the alert with the OpenTelemetry demo

We tested the alert on SigNoz Cloud and self-hosted SigNoz, both running v0.153.0. The steps and screenshots below show the Cloud test from December 4, 2026. The test used the cart service from OpenTelemetry demo v3.1.0, also called Astronomy Shop. The demo's collector sent cart traces to SigNoz Cloud, and the alert delivered both firing and resolved webhook notifications.

The Cloud test used a five-minute baseline and the service name cart-new-exception-cloud-20261204. The distinct service name kept the test separate from earlier runs. The setup above uses a seven-day baseline, which requires a longer period of collected history.

Connect the demo's cart service to SigNoz Cloud with the OpenTelemetry demo guide before you start. For a repeat test, use a service and exception type pair that is absent from the baseline. Repeating the same failure does not fire the alert while that pair remains in the baseline.

Follow these steps to check ingestion, trigger a new exception type, and verify the notification:

  1. For this test, change INTERVAL 7 DAY to INTERVAL 5 MINUTE in the query. Filter both the outer query and the subquery to your test service. Our test used serviceName = 'cart-new-exception-cloud-20261204' in both places.

    SigNoz Cloud ClickHouse query editor showing a five-minute baseline and the cart-new-exception-cloud-20261204 service filter.
    The Cloud test query uses a five-minute baseline and filters both parts to the test service.
  2. With cartFailure off, send repeated EmptyCart requests to build the baseline. Confirm that SigNoz Cloud has healthy spans throughout the baseline period and no exceptions for the test service. Our run made 47 successful requests over more than 15 minutes before the first failure.

  3. Save the alert with the five-minute test query and the settings above. Keep the five-minute evaluation window and one-minute checks. Before you trigger a failure, check that the alert history shows no triggered alerts.

    SigNoz Cloud alert history shows None Triggered and No Resolutions before the failure test.
    The alert history has no triggered alerts before the test.
  4. Set cartFailure to 100% in the demo's feature flag configuration. Send another EmptyCart request. The cart failure implementation makes this request fail. In Exceptions, check for Grpc.Core.RpcException under your test service. The cart service records the failure as an exception span event with that value in exception.type.

    SigNoz Cloud Exceptions page shows Grpc.Core.RpcException for cart-new-exception-cloud-20261204.
    The test service records a new Grpc.Core.RpcException.
  5. Check the alert history for a Firing event. The pair triggers the alert because it was absent from the baseline.

    SigNoz Cloud alert history shows a Firing event for the test service and exception type.
    The new exception triggers the alert.
  6. Check the webhook notification for the test service name, exceptionType: Grpc.Core.RpcException, and the custom message. In our run, the serviceName label was cart-new-exception-cloud-20261204.

    Firing webhook payload with serviceName cart-new-exception-cloud-20261204 and exceptionType Grpc.Core.RpcException.
    The webhook notification identifies the test service and exception type.
  7. Turn cartFailure off and continue sending EmptyCart requests. Confirm that requests succeed and no new exceptions appear. Check the alert history for Resolved and the webhook receiver for a resolved notification. After we turned the flag off, SigNoz Cloud recorded 15 successful requests and no exceptions in a five-minute window.

    SigNoz Cloud alert history shows Firing and Resolved events for the test service on December 4, 2026.
    The Cloud alert history records firing and resolution.

Monitor recurring failures

Pair this rule with a standard exceptions-based alert on exception counts to monitor ongoing failures. The new-exception alert resolves once the first occurrence moves into the baseline, even if the errors continue.

Is this page helpful

Tags
alertstraces