Skip to content

Slow /metrics endpoint #4129

Description

@r4victor

The /metrics endpoint p95 is 2.4s in Sky presumably due to run metrics generated via a ~2s select that scans and joins the entire run table:

res = await session.execute(
select(ProjectModel.name, UserModel.name, RunModel.status, func.count(RunModel.id))
.join_from(RunModel, ProjectModel)
.join_from(RunModel, UserModel, RunModel.user_id == UserModel.id)
.group_by(ProjectModel.name, UserModel.name, RunModel.status)
.order_by(ProjectModel.name, UserModel.name, RunModel.status)
)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions