elastic / apm-agent-ruby

https://www.elastic.co/solutions/apm
Apache License 2.0
167 stars 131 forks source link

Instrument (other) Rack middleware #643

Open mikker opened 4 years ago

mikker commented 4 years ago

Perhaps we should add instrumentation to Rack middleware.

One could imagine some applications using middleware for user authentication for example. If multiple middlewares are using database calls or http requests, it might be hard to pinpoint which is doing which or perhaps whether one is influencing the other.

Given that a default rails new app comes with ~30 individual pieces of middleware that don't do much/take much time it could potentially just add noise to the waterfall.

  1. We could combine all middleware before the application into one span blob called Rack middleware.
  2. We could have the instrumentation in disabled_instrumentations by default.
  3. We could persuade the UI team to implement a way to collapse multiple spans into a collapsible/expandable block (cc @sqren 😉)

What do you think?

sorenlouv commented 4 years ago

We could persuade the UI team to implement a way to collapse multiple spans into a collapsible/expandable block

We have an issue for collapsing children. But if I understand this correctly, this is another kind of grouping of spans. Maybe if the spans in question had the same parent, then that parent could have a property that indicated that children should be collapsed by default.