Hey folks, Can somebody help me to understand how ...
# support
s
Hey folks, Can somebody help me to understand how to apply formula to the query. I have the following query and it gives me the value in nanoseconds and I want to apply
/ 1000000000.0
to get the seconds. What I can't understand is how to access fields from the output of the query in the formula:
m
Hey! I see from your screenshot that you need to use the letter A (the metric name shown in the top left corner). So your formula should be
A / 1000000000.0
If you need any specific help with your query, feel free to share it and I'd be happy to assist further!
s
Hey @Mykola Marchuk Thanks for reaching out. As soon as I add the formula it stops finding any results:
this is the error I get:
Copy code
{
  "level": "error",
  "timestamp": "2025-05-02T07:45:21.606Z",
  "caller": "clickhouseReader/reader.go:4468",
  "msg": "error while reading time series result",
  "error": "code: 62, message: Syntax error: failed at position 10 ('A'): A.value / 1000.0 as value FROM (SELECT  sum(duration_nano) as value from signoz_traces.distributed_signoz_index_v3 where (timestamp >= '1745912721000000000' AND. Expected one of: ALL, DISTINCT ON, DISTINCT, TOP, not empty list of expressions, list of expressions, list of elements, expression with optional alias, element of expression with optional alias, lambda expression",
  "stacktrace": "<http://github.com/SigNoz/signoz/pkg/query-service/app/clickhouseReader.(*ClickHouseReader).GetTimeSeriesResultV3|github.com/SigNoz/signoz/pkg/query-service/app/clickhouseReader.(*ClickHouseReader).GetTimeSeriesResultV3>\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/clickhouseReader/reader.go:4468\ngithub.com/SigNoz/signoz/pkg/query-service/app/querier.(*querier).execClickHouseQuery\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/querier/querier.go:115\ngithub.com/SigNoz/signoz/pkg/query-service/app/querier.(*querier).runBuilderExpression\n\t/home/runner/work/signoz/signoz/pkg/query-service/app/querier/helper.go:327"
}
m
@Sergei Zobov You need to add anything in
GROUP BY
clause to your metric for the formula to work. Try add
trace_id
for example. Unfortunately, without
GROUP BY
it won't work - seems to be a bug.
s
it worked, thanks!