Skip to content

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

@fmiqbal

Description

@fmiqbal

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

const {data, isPending, isError} = useSpans(
{
search: MutableSearch.fromQueryObject({'span.op': 'db'}),
fields: [SpanFields.SPAN_SYSTEM, 'count()'],
sorts: [{field: 'count()', kind: 'desc'}],
},
'api.insights.database-system-selector'
);

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, getsentry/sentry-laravel#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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Support

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions