All Products
Search
Document Center

Container Service for Kubernetes:Configure alerting for Knative Services

Last Updated:Jun 25, 2026

Use Simple Log Service (SLS) to collect logs and alert on Knative Service anomalies. Configure alert monitoring rules such as check frequency and trigger conditions, set notification policies, and notify operators and developers via DingTalk, SMS, or email when a service fault occurs so the service keeps running.

How it works

Knative alerting uses a three-stage pipeline:

  1. Query — SLS runs a SQL query against your Logstore at a configured frequency to detect error patterns.

  2. Evaluate — SLS checks whether the query results meet your alert trigger conditions.

  3. Notify — When conditions are met, SLS sends notifications through your configured channels.

Prerequisites

Complete the following:

Step 1: Query and analyze logs

Build and verify the query your alert rule uses to detect errors. For query syntax, see Query and analyze logs.

  1. Log on to the SLS console.

  2. In the Projects section, click your project.

    image

  3. In the left-side navigation pane, click Log Storage. In the Logstores list, click your Logstore.

    image

  4. Enter a query in the search box and click Search & Analyze.

    To monitor Services by error count, use this query. It counts log records with the error field, grouped by type.

    * | select 'ERROR' , count(1) as total group by 'ERROR'

    image.png

Step 2: Configure an alert monitoring rule

From the Logstore query page in the SLS console:

  1. Click the Alert icon icon.

    image

  2. In the Alert Monitoring Rules section, configure your alert rule.

    Key parameters to set:

    Parameter Description Example
    Check frequency How often SLS evaluates your query. Lower values detect faster but cost more. Every 1 minute
    Trigger condition The threshold that causes the alert to fire. Fire when error count exceeds 0

    All parameters are documented in Create log alert monitoring rules.

  3. Configure a notification policy for alert recipients and channels (DingTalk, SMS, or email). See Quickly set log alerts.

  4. Verify the alert. Send a request to helloworld-go to trigger an error in the logs:

    curl -H "Host: helloworld-go.default.example.com" http://<Gateway IP>

    Replace <Gateway IP> with your gateway IP and update the domain to match your setup.

    Expected response:

    Hello Knative!

    After each check interval, SLS evaluates query results against your trigger condition and sends alerts through your configured notification channels.

Next steps

Visualize Knative monitoring data in real time on a Grafana dashboard with Prometheus Service. See View Knative service monitoring dashboard.