Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Rack instrumentation middleware #1139

Merged
merged 5 commits into from
Jul 4, 2024

Conversation

tombruijn
Copy link
Member

Remove duplicate rack requires

The AbstractMiddleware requires the rack library. The other middlewares that inherit from it don't have to require it as well.

Add test for GenericInstrumentation action name

Add a test that makes sure the action name isn't always set to unknown.

Add new Rack instrumentation middleware

Let's no longer the GenericInstrumentation middleware with its default action name set to unknown.

This new InstrumentationMiddleware will not report any action name, only report an instrumentation event.

The action name can be set by the app using the Appsignal.set_action helper from now on in this middleware.

This will require us to update the Rack docs page to replace GenericInstrumentation with InstrumentationMiddleware.

Deprecate our GenericInstrumentation middleware

Deprecate the Appsignal::Rack::GenericInstrumentation in favor of the Appsignal::Rack::InstrumentationMiddleware. This other middleware doesn't set the action name to "unknown" by default.

The GenericInstrumentation is no longer loaded automatically. This helps with printing a deprecation warning when it is used.

Update the Grape specs which I copied this from to not mention the Minutely constant, which I copied it from there.

The AbstractMiddleware requires the rack library. The other middlewares
that inherit from it don't have to require it as well.
Add a test that makes sure the action name isn't always set to
`unknown`.
Let's no longer the GenericInstrumentation middleware with its
default action name set to `unknown`.

This new InstrumentationMiddleware will not report any action name, only
report an instrumentation event.

The action name can be set by the app using the `Appsignal.set_action`
helper from now on in this middleware.

This will require us to update the Rack docs page to replace
GenericInstrumentation with InstrumentationMiddleware.
Deprecate the Appsignal::Rack::GenericInstrumentation in favor of the
Appsignal::Rack::InstrumentationMiddleware. This other middleware
doesn't set the action name to "unknown" by default.

The GenericInstrumentation is no longer loaded automatically. This helps
with printing a deprecation warning when it is used.

Update the Grape specs which I copied this from to not mention the
Minutely constant, which I copied it from there.
@tombruijn tombruijn force-pushed the rack-instrumentation-middleware branch from dd66212 to 2ad6fc1 Compare July 2, 2024 15:25
lib/appsignal/rack.rb Outdated Show resolved Hide resolved
Explain a little bit the differences between middlewares and link to the
docs.
@tombruijn tombruijn merged commit b172ec3 into main Jul 4, 2024
117 checks passed
@tombruijn tombruijn deleted the rack-instrumentation-middleware branch July 10, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants