Hello everyone , I configured my signoz for my thr...
# general
k
Hello everyone , I configured my signoz for my three backend microservices (user,department,team), I am using Nginx for Load balancer ,So it redirect request (ip:port/user/id) on respective ports , As signoz is able to show the ports where it redirect after going into Trace by this field {{ net.sock.host.port }} .So as it shows the graphs and statistics for all the aggregated requests. I want to club all the request by the port {{ net.sock.host.port }} to show its rps , latency etc individually .How we can enable and create graphs on basis of port ??
a
@Ketan Sarode so basically you want to see application metrics grouped by port? And that port is available as
net.sock.host.port
in tags in a trace?
Or are you talking about plotting some metrics from nginx?
k
want to see application grouped by port!
yes , that port is available as
net.sock.host.port
in tags in a trace
Also want to know Is their some standard mechanism to grouped the metrics by Tags available in a trace ?
a
@Ketan Sarode for RPS
Copy code
select toStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval, tagMap['net.sock.host.port'] as op_name, toFloat64(count()) as value from signoz_traces.signoz_index_v2  where serviceName='YOUR_SERVICE_NAME' and kind='2' and tagMap['net.sock.host.port']!='' and timestamp > now() - INTERVAL 30 MINUTE  group by (op_name, interval) order by (op_name, interval) asc;
for 99th percentile
Copy code
select toStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval, tagMap['net.sock.host.port'] as op_name, toFloat64(quantile(0.99)(durationNano)) as value from signoz_traces.signoz_index_v2  where serviceName='YOUR_SERVICE_NAME' and kind='2' and timestamp > now() - INTERVAL 30 MINUTE  group by (op_name, interval) order by (op_name, interval) asc;
for avg duration
Copy code
select toStartOfInterval(timestamp, INTERVAL 1 MINUTE) AS interval, tagMap['net.sock.host.port'] as op_name, toFloat64(avg(durationNano)) as value from signoz_traces.signoz_index_v2  where serviceName='frontend' and kind='2' and timestamp > now() - INTERVAL 30 MINUTE  group by (op_name, interval) order by (op_name, interval) asc;
you can freely use similar queries to plot using clickhouse sql query on trace data
the place would be
Dashboards
->
Add Panel
->
CH Query
tab
k
Ok thanks , Will definitely try this out 🙂
a
let me know if you need further help 🙂