sentry icon indicating copy to clipboard operation
sentry copied to clipboard

"System: None" always on Backend / Queries / Query Summary Page

Open fmiqbal opened this issue 1 month ago • 4 comments

Environment

self-hosted (https://develop.sentry.dev/self-hosted/)

Steps to Reproduce

  1. Use metric/tracing on Laravel Project
  2. Observe on the queries summaries page, System dropdown can never actually can be picked

Expected Result

  1. At least from existing result (whatever the db.system/span.system is, or show only otel compliant naming), it show on the dropdown

Actual Result

  1. It didnt show

I suspect its from this line

https://github.com/getsentry/sentry/blob/27e83df18e5bfbabb1d13746683df81b223b54c2/static/app/views/insights/database/components/useSystemSelectorOptions.tsx#L17-L25

that i suspect correspond to this request query

.../events/?dataset=spans&field=span.system&field=count%28%29&per_page=50&project=49&query=span.op%3Adb&referrer=api.insights.database-system-selector&sampling=NORMAL&sort=-count%28%29&statsPeriod=24h

that I suspect, correspond to this clickhouse query

SELECT
    IF(
        mapContains(attributes_string_6, 'db.system'),
        arrayElement(attributes_string_6, 'db.system'),
        NULL
    ) AS "db.system_TYPE_STRING",
    ROUND(
        sumIfOrNull(
            1 / sampling_factor,
            isNotNull(CAST(project_id, 'Int64')) AND true
        )
    ) AS "count()",
    multiply(
        1.96,
        sqrt(
            sumIf(
                minus(
                    multiply(1 / sampling_factor, 1 / sampling_factor),
                    1 / sampling_factor
                ),
                isNotNull("sentry.project_id_TYPE_INT") AND true
            )
        )
    ) AS "__snuba_custom_column__confidence_interval$count()$function_type:count",
    divide(
        countIf("sentry.project_id_TYPE_INT", isNotNull("sentry.project_id_TYPE_INT") AND true),
        sumIf(1 / sampling_factor, isNotNull("sentry.project_id_TYPE_INT") AND true)
    ) AS "__snuba_custom_column__average_sample_rate$count()",
    countIf("sentry.project_id_TYPE_INT", isNotNull("sentry.project_id_TYPE_INT") AND true)
        AS "__snuba_custom_column__count$count()"
FROM eap_items_1_dist
WHERE
    in(project_id, [50])
    AND organization_id = 4509551426732032
    AND timestamp < toDateTime('2025-12-08 10:59:52')
    AND timestamp >= toDateTime('2025-12-08 04:58:52')
    AND (
        IF(
            mapContains(attributes_string_19, 'sentry.op'),
            arrayElement(attributes_string_19, 'sentry.op'),
            NULL
        ) = 'db'
        OR (
            isNull("sentry.op_TYPE_STRING")
            AND isNull('db')
        )
    )
    AND isNotNull("sentry.project_id_TYPE_INT")
    AND item_type = 1
GROUP BY "db.system_TYPE_STRING"
ORDER BY "count()" DESC
LIMIT 52 OFFSET 0;

This is what is shown

Image

with span.op like this

Image

it show that span.op is db.sql.query on other project its db.transaction

I think the correct approach is to use span.category not span.op for the fiilter.

I also try to brute force it, change span.op to db in the clickhouse, and change the span.system to something sentry recognize (laravel sdk also wrong to send, https://github.com/getsentry/sentry-laravel/issues/1075 ) (but for some reason microsoft.sql_server as defined by otel spec is not recognized too, maybe because its not supported yet ? static/app/views/insights/database/utils/constants.tsx)

and now it shows the dropdown correctly

Image

Product Area

Insights

Link

No response

DSN

No response

Version

No response

fmiqbal avatar Dec 08 '25 11:12 fmiqbal

ENG-6070

linear[bot] avatar Dec 08 '25 11:12 linear[bot]

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] avatar Dec 08 '25 11:12 getsantry[bot]

Other issues i encounter is when I brute force it, and I pick one of the system, it correctly show on the project, but It still carry on to other project, meaning the query to get the data on that page is appended by span.system= queries, with no mean of changing it, as you see here

Image

fmiqbal avatar Dec 08 '25 11:12 fmiqbal

Routing to @getsentry/product-owners-performance for triage ⏲️

getsantry[bot] avatar Dec 09 '25 07:12 getsantry[bot]

@fmiqbal we're in the process of reworking and cleaning up the span attributes that are used to power this page, we'll look at your problem as part of this.

bcoe avatar Dec 16 '25 17:12 bcoe