Skip to content

Bug: rule_source field contains full compositeQuery instead of ruleId in webhook payload for single-host alert rules #10940

@RajafarAttala21

Description

@RajafarAttala21

================================================================================
ISSUE SUMMARY

When testing alert rules with a single hostname filter, the rule_source field
in the webhook payload contains the entire compositeQuery parameter
(URL-encoded JSON) instead of a clean ruleId parameter. This results in
extremely long URLs that are difficult to parse and use.

================================================================================
EXPECTED BEHAVIOR

rule_source: "https://apmsignoz.myenv.co.id/alerts/edit?ruleId=APH Disk Usage%"

================================================================================
ACTUAL BEHAVIOR

rule_source: "https://apmsignoz.myenv.co.id/alerts/overview?tab=AlertRules&search=aph&compositeQuery=%257B%2522queryType%2522%253A%2522builder%2522%252C%2522builder%2522%253A%257B%2522queryData%2522%253A%255B%257B%2522dataSource%2522%253A%2522metrics%2522%252C%2522queryName%2522%253A%2522A%2522%252C%2522aggregateOperator%2522%253A%2522count%2522%252C%2522aggregateAttribute%2522%253A%257B%2522key%2522%253A%2522system.filesystem.usage%2522%252C%2522dataType%2522%253A%2522float64%2522%252C%2522type%2522%253A%2522Gauge%2522%252C%2522isColumn%2522%253Atrue%252C%2522isJSON%2522%253Afalse%252C%2522id%2522%253A%2522system.filesystem.usage--float64--Gauge%2522%257D%252C%2522timeAggregation%2522%253A%2522rate%2522%252C%2522spaceAggregation%2522%253A%2522sum%2522%252C%2522filter%2522%253A%257B%2522expression%2522%253A%2522management.zone%2520%253D%2520%27APH%27%2520AND%2520mountpoint%2520NOT%2520IN%2520%28%27%252Fmnt%27%252C%2520%27%252Fmnt%252Fcdrom%27%252C%2520%27%252Fmnt%252Fcdroom%27%29%2520AND%2520host.name%2520%253D%2520%27myaph01%27%2520AND%2520mountpoint%2520%253D%2520%27%252Fvar%27%2522%257D%252C%2522aggregations%2522%253A%255B%257B%2522metricName%2522%253A%2522system.filesystem.usage%2522%252C%2522temporality%2522%253A%2522%2522%252C%2522timeAggregation%2522%253A%2522latest%2522%252C%2522spaceAggregation%2522%253A%2522sum%2522%252C%2522reduceTo%2522%253A%2522%2522%257D%255D%252C%2522functions%2522%253A%255B%255D%252C%2522filters%2522%253A%257B%2522items%2522%253A%255B%255D%252C%2522op%2522%253A%2522AND%2522%257D%252C%2522expression%2522%253A%2522A%2522%252C%2522disabled%2522%253Atrue%252C%2522stepInterval%2522%253A0%252C%2522having%2522%253A%257B%2522expression%2522%253A%2522%2522%257D%252C%2522limit%2522%253Anull%252C%2522orderBy%2522%253A%255B%255D%252C%2522groupBy%2522%253A%255B%257B%2522key%2522%253A%2522host.name%2522%252C%2522dataType%2522%253A%2522string%2522%252C%2522type%2522%253A%2522attribute%2522%252C%2522id%2522%253A%2522host.name--string--attribute%2522%257D%252C%257B%2522key%2522%253A%2522host.ip%2522%252C%2522dataType%2522%253A%2522string%2522%252C%2522type%2522%253A%2522attribute%2522%252C%2522id%2522%253A%2522host.ip--string--attribute%2522%257D%252C%257B%2522key%2522%253A%2522mountpoint%2522%252C%2522dataType%2522%253A%2522string%2522%252C%2522type%2522%253A%2522attribute%2522%252C%2522id%2522%253A%2522mountpoint--string--attribute%2522%257D%255D%252C%2522legend%2522%253A%2522%2522%252C%2522reduceTo%2522%253A%2522avg%2522%252C%2522source%2522%253A%2522%2522%252C%2522name%2522%253A%2522A%2522%252C%2522signal%2522%253A%2522metrics%2522%257D%252C%257B%2522dataSource%2522%253A%2522metrics%2522%252C%2522queryName%2522%253A%2522B%2522%252C%2522aggregateOperator%2522%253A%2522count%2522%252C%2522aggregateAttribute%2522%253A%257B%2522key%2522%253A%2522system.filesystem.usage%2522%252C%2522dataType%2522%253A%2522float64%2522%252C%2522type%2522%253A%2522Gauge%2522%252C%2522isColumn%2522%253Atrue%252C%2522isJSON%2522%253Afalse%252C%2522id%2522%253A%2522system.filesystem.usage--float64--Gauge%2522%257D%252C%2522timeAggregation%2522%253A%2522rate%2522%252C%2522spaceAggregation%2522%253A%2522sum%2522%252C%2522filter%2522%253A%257B%2522expression%2522%253A%2522management.zone%2520%253D%2520%27APH%27%2520AND%2520mountpoint%2520NOT%2520IN%2520%28%27%252Fmnt%27%252C%2520%27%252Fmnt%252Fcdrom%27%252C%2520%27%252Fmnt%252Fcdroom%27%29%2520AND%2520host.name%2520%253D%2520%27myaph01%27%2520AND%2520mountpoint%2520%253D%2520%27%252Fvar%27%2522%257D%252C%2522aggregations%2522%253A%255B%257B%2522metricName%2522%253A%2522system.filesystem.usage%2522%252C%2522temporality%2522%253A%2522%2522%252C%2522timeAggregation%2522%253A%2522latest%2522%252C%2522spaceAggregation%2522%253A%2522sum%2522%252C%2522reduceTo%2522%253A%2522%2522%257D%255D%252C%2522functions%2522%253A%255B%255D%252C%2522filters%2522%253A%257B%2522items%2522%253A%255B%255D%252C%2522op%2522%253A%2522AND%2522%257D%252C%2522expression%2522%253A%2522B%2522%252C%2522disabled%2522%253Afalse%252C%2522stepInterval%2522%253A0%252C%2522having%2522%253A%257B%2522expression%2522%253A%2522%2522%257D%252C%2522limit%2522%253Anull%252C%2522orderBy%2522%253A%255B%255D%252C%2522groupBy%2522%253A%255B%257B%2522key%2522%253A%2522host.name%2522%252C%2522dataType%2522%253A%2522string%2522%252C%2522type%2522%253A%2522attribute%2522%252C%2522id%2522%253A%2522host.name--string--attribute%2522%257D%252C%257B%2522key%2522%253A%2522host.ip%2522%252C%2522dataType%2522%253A%2522string%2522%252C%2522type%2522%253A%2522attribute%2522%252C%2522id%2522%253A%2522host.ip--string--attribute%2522%257D%252C%257B%2522key%2522%253A%2522mountpoint%2522%252C%2522dataType%2522%253A%2522string%2522%252C%2522type%2522%253A%2522attribute%2522%252C%2522id%2522%253A%2522mountpoint--string--attribute%2522%257D%255D%252C%2522legend%2522%253A%2522%2522%252C%2522reduceTo%2522%253A%2522avg%2522%252C%2522source%2522%253A%2522%2522%252C%2522name%2522%253A%2522B%2522%252C%2522signal%2522%253A%2522metrics%2522%257D%255D%252C%2522queryFormulas%2522%253A%255B%257B%2522name%2522%253A%2522F1%2522%252C%2522expression%2522%253A%2522%28A%2520%252B%2520B%29%2520%252A%2520100%2522%257D%255D%257D%257D&edit?ruleId=APH Disk Usage%"

(URL is extremely long and contains full compositeQuery parameter)

================================================================================
STEPS TO REPRODUCE

  1. Create an alert rule with multiple queries (A, B, F1 formula)
  2. Add filter with single hostname:
    host.name = 'myaph01'
  3. Configure additional filters:
    • management.zone = 'APH'
    • mountpoint NOT IN ('/mnt', '/mnt/cdrom', '/mnt/cdroom')
    • mountpoint = '/var'
  4. Test the alert rule
  5. Check the webhook payload sent to your notification channel
  6. Observe the rule_source field contains full compositeQuery parameter

================================================================================
ALERT RULE CONFIGURATION

Query A:

Data Source: metrics
Metric: system.filesystem.usage
Time Aggregation: latest
Space Aggregation: sum

Filter Expression:
management.zone = 'APH' AND mountpoint NOT IN ('/mnt', '/mnt/cdrom', '/mnt/cdroom') AND host.name = 'myaph01' AND mountpoint = '/var'
Group By:

  • host.name
  • host.ip
  • mountpoint

Query B:

Data Source: metrics
Metric: system.filesystem.usage
Time Aggregation: latest
Space Aggregation: sum

Filter Expression:
management.zone = 'APH' AND mountpoint NOT IN ('/mnt', '/mnt/cdrom', '/mnt/cdroom') AND host.name = 'myaph01' AND state = 'used' AND mountpoint = '/var'
Group By:

  • host.name
  • host.ip
  • mountpoint

Formula F1:

Expression: (B/A) * 100

================================================================================
WEBHOOK PAYLOAD (ACTUAL)

{
"receiver": "webhook-channel",
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"alertname": "APH Disk Usage%"
},
"annotations": {
"description": "Disk usage alert triggered"
},
"startsAt": "2026-04-15T10:18:53Z",
"endsAt": "0001-01-01T00:00:00Z",
"generatorURL": "",
"fingerprint": "abc123def456"
}
],
"groupLabels": {
"alertname": "APH Disk Usage%"
},
"commonLabels": {
"alertname": "APH Disk Usage%"
},
"commonAnnotations": {
"description": "Disk usage alert triggered"
},
"externalURL": "https://apmsignoz.myenv.co.id",
"version": "4",
"groupKey": "{}/{}:{alertname="APH Disk Usage%"}",
"truncatedAlerts": 0,
"rule_source": "https://apmsignoz.myenv.co.id/alerts/overview?tab=AlertRules&search=aph&compositeQuery=%257B%2522queryType%2522%253A%2522builder%2522%252C%2522builder%2522%253A%257B%2522queryData%2522%253A%255B..."
}

================================================================================
ENVIRONMENT

SigNoz Version: v0.110.1
Deployment Type: Self-hosted
Notification Channel: Webhook
Browser: Chrome-based
Operating System: Rocky Linux

================================================================================
ADDITIONAL CONTEXT

Observations:

  • ✅ Works correctly with MULTIPLE hostnames in filter
  • ❌ Fails with SINGLE hostname in filter
  • The URL becomes too long to be practical for notification messages
  • Makes it difficult to parse and extract the actual ruleId
  • URL length exceeds practical limits for most notification systems

Impact:

  • Webhook payloads become extremely large
  • Difficult to parse rule_source field programmatically
  • Notification messages may be truncated by some systems
  • Poor user experience when clicking on rule_source link

================================================================================
LABELS

bug
alert-rules
webhook
url-encoding

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions