Grouping Fields in Clickhouse Query for Graph
TLDR Romario had difficulty displaying http_status
in a graph using a clickhouse query. Srikanth suggested using toString
to resolve the issue.
May 30, 2023 (4 months ago)
Romario
08:00 PMI'm trying this but the status is not shown in the graph
SELECT
toStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval,
stringTagMap['net.host.name'] AS host,
numberTagMap['http.status_code'] as http_status,
count() AS value
FROM signoz_traces.distributed_signoz_index_v2
WHERE timestamp > {{.start_datetime}} AND timestamp < {{.end_datetime}}
AND (stringTagMap['net.host.name'] = 'some_host' OR stringTagMap['net.host.name'] = 'other_host')
AND stringTagMap['http.target'] = '/api/webhooks/1'
GROUP BY (host, http_status), interval
ORDER BY host ASC, http_status ASC, interval
I'm not seeing the
http_status
in the graph altough I'm selecting itRomario
08:07 PMRomario
08:09 PMMay 31, 2023 (4 months ago)
Srikanth
01:55 AMSELECT
count() AS value,
toStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval,
stringTagMap['net.host.name'] AS host,
numberTagMap['http.status_code'] as http_status
FROM signoz_traces.distributed_signoz_index_v2
WHERE timestamp > {{.start_datetime}} AND timestamp < {{.end_datetime}}
AND (stringTagMap['net.host.name'] = 'some_host' OR stringTagMap['net.host.name'] = 'other_host')
AND stringTagMap['http.target'] = '/api/webhooks/1'
GROUP BY (host, http_status), interval
ORDER BY host ASC, http_status ASC, interval
Try this instead
Romario
05:46 PMRomario
05:48 PMJun 01, 2023 (4 months ago)
Srikanth
01:32 AMtoString
explicitly since you are not doing anything with status code.Romario
01:33 AMtoString
thing?Srikanth
01:34 AMSELECT
count() AS value,
toStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval,
stringTagMap['net.host.name'] AS host,
toString(numberTagMap['http.status_code']) as http_status
FROM signoz_traces.distributed_signoz_index_v2
WHERE timestamp > {{.start_datetime}} AND timestamp < {{.end_datetime}}
AND (stringTagMap['net.host.name'] = 'some_host' OR stringTagMap['net.host.name'] = 'other_host')
AND stringTagMap['http.target'] = '/api/webhooks/1'
GROUP BY (host, http_status), interval
ORDER BY host ASC, http_status ASC, interval
Romario
01:42 AMSigNoz Community
Indexed 825 threads (61% resolved)
Similar Threads
Incorrect Alert Firing Issue in Threshold Condition
Harshith.R.S is experiencing an issue with alerts firing when the value is above the threshold. The issue remains unresolved after trying different query modifications suggested by Amol.

Creating GraphQL Query Traces Graph
Romario requested help with a graph for GraphQL queries. vishal-signoz provided a sample query and additional resources, while Ankit suggested potential improvements to the documentation and integrations.

Issues with SigNoz Setup and Data Persistence in AKS
Vaibhavi experienced issues setting up SigNoz in AKS, and faced data persistence issues after installation. Srikanth provided guidance on ClickHouse version compatibility and resource requirements, helping Vaibhavi troubleshoot and resolve the issue.
Creating Signoz Dashboard for GC Metrics
Div wanted to create a dashboard for GC events and metrics. Ankit and vishal-signoz provided help with Clickhouse queries and template variables.



Forwarding Exception Alerts from Rails to Mattermost
Andreas needs guidance setting up exception alerts in Rails to Mattermost. Amol provides a sample query and explains the setup process.