prometheus: Prometheus 3: Performance of target list is bad

What did you do?

  1. Go to /targets
  2. Select All pools

What did you expect to see?

Seeing all pools, being able to search, being able to see failing scrape targets, …

What did you see instead? Under which circumstances?

The page loads forever, then becomes unusable and slow. In Prometheus 2 I could easily open all out targets in this view, now I the page barely works.

When I inspect the HTML I see that each target pool with one target (HTML element with class mantine-Stack-root) consists of roughly 600 lines of HTML code.

When there’s two targets it’s already 1600 lines, and so on.

System information

Linux 6.1.128-136.201.amzn2023.x86_64 x86_64

Prometheus version

prometheus, version 3.2.1 (branch: HEAD, revision: 804c49d58f3f3784c77c9c8ec17c9062092cae27)
  build user:       root@42fd9529152a
  build date:       20250226-09:19:49
  go version:       go1.23.6
  platform:         linux/amd64
  tags:             netgo,builtinassets,stringlabels

Browser and System

Some more information about my system:

Browser: Vivaldi 7.2.3621.67 Computer: MacBook Pro 2023 with M2 Max Chip and 32GB RAM OS Version: 15.3.2 (24D81)

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 4
  • Comments: 15 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@Nexucis I’d say let’s keep this issue for discussing the original question and not unnecessarily feed obvious trolls 😃

Thanks for bringing this to my attention again. Yeah, the other issue probably shouldn’t have been fully closed, but let’s just continue here then, since this one is open and the other one is closed 😃

@KevinGimbel In the previous issue + PRs I focused on the “many targets in not that many pools” use case by virtualizing the scrolling within a pool, and that seemed to work fairly well for that problematic case. However for you, you have the use case of many pools with potentially just 1 target each, but still wanting to show all pools at once (instead of the default single pool when your Prometheus has more than 20 pools).

A couple of thoughts:

  • The number of DOM elements that Mantine creates even for simple elements is indeed excessive (for example, each label badge consists of two elements instead of one - this is because you can add more stuff like left-side/right-side sections to them in Mantine, but we don’t need that for simple labels). We could use a custom label badge component here that is just one DOM element. And maybe do similar things for other elements.
  • We are currently dumping the hidden discovered labels into the DOM even if they are not expanded. I’ll just remove those from the DOM completely when not expanded.
  • By default, we show a target pool even when no targets in it match your filters (target health = bad). Such pools will then contain a message like “No targets in this pool match your filter criteria (omitted N filtered targets). [Hide empty pools]”, and after clicking “[Hide empty pools]”, things are fast again because those pools are hidden. Maybe we should hide empty pools by default instead of showing them. However, that would not help you if each of your pools still has some healthy targets (is that the case for you?).
  • We use a lot of inline styles on Mantine components, but for performance-sensitive elements we may want to shift more to CSS modules again: https://mantine.dev/styles/styles-performance/

I’m looking into a few of those right now. Maybe there’s some other possible improvements as well that help even further, happy to hear ideas.

Similar issue occurs to me. It’s the /service-discovery page that loads very slow which can make the Chrome crash. The version is also v3.2.1.