Reported by Sergiy Dybskiy.
sentry log list <org>/<project> can return No logs found in the last 30d even when the Events API has plenty of logs for that project. Org-wide explore/aggregate queries still work.
Root cause (high confidence)
In src/lib/api/logs.ts, listLogs() scopes slug targets only via search syntax:
const projectFilter = isNumericProject ? "" : `project:${projectSlug}`;
// ...
project: isNumericProject ? [Number(projectSlug)] : undefined,
For a normal slug it never sends the numeric project= query param. The logs Events API then only matches if that project is actively selected; otherwise it returns empty data: [] with no error.
Same class of bug already fixed for issues in #312.
Evidence
Against a project with hasLogs=true and hundreds of thousands of logs in 7d:
- org-wide logs query → works
query=project:<slug> only → empty
project=<numeric-id> → works
query=project:<slug>&project=-1 → works
sentry log list <org>/<slug> → empty
sentry log list <org>/<numeric-id> → works
- some other projects still work via slug (selection-dependent)
Secondary gap
- Explicit
org/project resolution returns slug only and drops projectId
getLogs() (log view by id) uses the same project:{slug} pattern
Workaround
Pass the numeric project id:
sentry log list <org>/<project-id>
Likely fix
Resolve slug → numeric project id and pass project: [id] on the Events request (mirror issues), instead of relying on query=project:{slug} for scoping.
Requested by Burak Yigit Kaya via Junior.
--
View Junior Session in Sentry
Reported by Sergiy Dybskiy.
sentry log list <org>/<project>can returnNo logs found in the last 30deven when the Events API has plenty of logs for that project. Org-wide explore/aggregate queries still work.Root cause (high confidence)
In
src/lib/api/logs.ts,listLogs()scopes slug targets only via search syntax:For a normal slug it never sends the numeric
project=query param. The logs Events API then only matches if that project is actively selected; otherwise it returns emptydata: []with no error.Same class of bug already fixed for issues in #312.
Evidence
Against a project with
hasLogs=trueand hundreds of thousands of logs in 7d:query=project:<slug>only → emptyproject=<numeric-id>→ worksquery=project:<slug>&project=-1→ workssentry log list <org>/<slug>→ emptysentry log list <org>/<numeric-id>→ worksSecondary gap
org/projectresolution returns slug only and dropsprojectIdgetLogs()(log view by id) uses the sameproject:{slug}patternWorkaround
Pass the numeric project id:
Likely fix
Resolve slug → numeric project id and pass
project: [id]on the Events request (mirror issues), instead of relying onquery=project:{slug}for scoping.Requested by Burak Yigit Kaya via Junior.
--
View Junior Session in Sentry