jgraichen / telegraf-ruby

Send events from Ruby to a Telegraf agent
GNU Lesser General Public License v3.0
13 stars 7 forks source link

Extract request handler info for Grape APIs #17

Closed franzliedke closed 2 years ago

franzliedke commented 2 years ago

grape is a common gem for defining API endpoints. We used to get this instrumentation via the processing pipeline in mnemosyne-server, but this has been disabled in favor of explicit Telegraf metrics as the app's responsibility. Grape support had not been added here since then.

franzliedke commented 2 years ago

I did mean to ask two things:

  1. Right now, controller = instance. I did not yet dive deeper how to differentiate multiple actions / methods within one endpoint class.
  2. No tests, because setting up a Grape API just for testing felt like hassle. I can try to add those, though - just like documentation in the README, now that I'm talking about that... 🤔
jgraichen commented 2 years ago

Lets how it goes and if it is too much hassle, we will remove it from the gem. That small snippet should be easy for an application to carry it in an initializer, and there it can be maintained along the application and whatever version of grape is used.

Especially if a framework already uses ActiveSupport::Notifications and patches are not needed at all.