Ruby transactions - workers and grape

Hello,

I'm trying to apply configure APM transactions on 2 places:

  1. On workers, I try to apply the ElasticAPM.transaction {} and it doenst send any new data
  2. On Grape (gem) endpoints: all endpoints shows as Rack instead of the correct path/controller

Any help on the issues is more than welcome.

Hi!

  1. What worker library are you using? The gem should automatically instrument DelayedJob and Sidekiq so if one of them, then no need to add your own transactions.

  2. There's no official Grape support yet. A user submitted their custom Grape middleware which you can find here: https://github.com/kressh/apm-agent-ruby/blob/e1d8a6d3396021c16c0ca46f2f31c3d0362ac1f3/lib/elastic_apm/middlewares/grape.rb#L37-L54

Thanks for the response.

  1. Custom workers. I was able to make it work wrapping a ElasticAPM.transaction
    ElasticAPM.with_transaction / ElasticAPM.start_transaction / ElasticAPM.end_transaction dont exist even though it appears on the doc.

  2. I tried that but it didnt work. After improvements, it stopped throwing errors but doesnt split the Rack on APM into requests.
    Do you intend to merge it soon?

  1. Sounds like you are using a version of the agent < 2.0? The APIs changed in 2.0 from transaction to the ones in the docs. (Docs for 1.x are also available)

  2. Grape support is on the todo although I can't give you any dates. I think I want to do it through ActiveSupport::Notifications instead though.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.