Skip to content

Stats V2: inconsistent return for varying intervals: empty groups #83700

Open
@constantinius

Description

@constantinius

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

A search query for the outcomes dataset produces varying results depending on the granularity specified by the interval parameter. Here is a request with 1h granularity that has the expected groups property filled.

{
    "start": "2025-01-07T13:00:00Z",
    "end": "2025-01-07T15:00:00Z",
    "intervals": [
        "2025-01-07T13:00:00Z",
        "2025-01-07T14:00:00Z"
    ],
    "groups": [
        {
            "by": {
                "outcome": "accepted",
                "reason": "none"
            },
            "totals": {
                "sum(quantity)": 27231
            },
            "series": {
                "sum(quantity)": [
                    0,
                    27231
                ]
            }
        }
    ]
}

But with a granularity of 1m, the otherwise same request returns an empty groups property:

{
    "start": "2025-01-07T13:35:00Z",
    "end": "2025-01-07T14:01:00Z",
    "intervals": [
        "2025-01-07T13:35:00Z",
        "2025-01-07T13:36:00Z",
        "2025-01-07T13:37:00Z",
        "2025-01-07T13:38:00Z",
        "2025-01-07T13:39:00Z",
        ...
        "2025-01-07T14:00:00Z"
    ],
    "groups": []
}

Expected Result

Responses similar to this with groups:

{
    "start": "2025-01-07T13:00:00Z",
    "end": "2025-01-07T15:00:00Z",
    "intervals": [
        "2025-01-07T13:00:00Z",
        "2025-01-07T14:00:00Z"
    ],
    "groups": [
        {
            "by": {
                "outcome": "accepted",
                "reason": "none"
            },
            "totals": {
                "sum(quantity)": 27231
            },
            "series": {
                "sum(quantity)": [
                    0,
                    27231
                ]
            }
        }
    ]
}

Actual Result

Missing groups:

{
    "start": "2025-01-07T13:35:00Z",
    "end": "2025-01-07T14:01:00Z",
    "intervals": [
        "2025-01-07T13:35:00Z",
        "2025-01-07T13:36:00Z",
        "2025-01-07T13:37:00Z",
        "2025-01-07T13:38:00Z",
        "2025-01-07T13:39:00Z",
        ...
        "2025-01-07T14:00:00Z"
    ],
    "groups": []
}

Product Area

Stats

Link

No response

DSN

No response

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions