Skip to content

Conversation

@bmansoob
Copy link
Contributor

@bmansoob bmansoob commented Feb 28, 2025

I believe Rack::Events is usually one of the first middlewares in chain. For Core, it is the first.

But for some apps it seems like it can appear after the profiling middleware. In that scenario, otel tracing attributes would not work.

Is this okay to do? @gmcgibbon

@bmansoob bmansoob changed the title insert after profiling middleware after Rack::Events insert profiling middleware after Rack::Events Feb 28, 2025
app.middleware.insert_before(0, AppProfiler.viewer::Middleware)
end
app.middleware.insert_before(0, AppProfiler.middleware)
if AppProfiler.otel_instrumentation_enabled
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otel gems use Rack::Events. So inserting the profiling middleware, after Rack::Events, based on the config value makes sense to me.

What do you think @gmcgibbon?

Copy link
Member

@gmcgibbon gmcgibbon Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does otel itself add them events middleware? A vanilla app doesn't have it. If so, this is ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants