# Instrumenting Elastic APM with Grape/Rack (incomplete docs?)

**URL:** <https://discuss.elastic.co/t/instrumenting-elastic-apm-with-grape-rack-incomplete-docs/167918>\
**Category:** APM\
**Created:** [February 11, 2019, 7:01pm UTC](https://discuss.elastic.co/t/instrumenting-elastic-apm-with-grape-rack-incomplete-docs/167918 "2019-02-11T19:01:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudostack](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudostack/32/40738_2.png) [@sudostack](https://discuss.elastic.co/u/sudostack)\
**Post date:** [February 11, 2019, 7:01pm UTC](https://discuss.elastic.co/t/instrumenting-elastic-apm-with-grape-rack-incomplete-docs/167918/1 "2019-02-11T19:01:33Z")

</div>

I'm making attempts to instrument Elastic APM with Ruby Grape/Rack following the documentation provided here: [https://www.elastic.co/guide/en/apm/agent/ruby/current/getting-started-rack.html](https://www.elastic.co/guide/en/apm/agent/ruby/current/getting-started-rack.html).

This is important to us as we are an enterprise consumer and we are currently experiencing a huge bottleneck with limited introspection.

I've forked the repo and have been able to inspect the Elastic APM transaction results locally, but I've seen elsewhere that it should essentially work out of the box ([Ruby transactions - workers and grape](https://discuss.elastic.co/t/ruby-transactions-workers-and-grape/165907)) with Sidekiq to pass them to Kibana on Elastic Cloud. This is the part I can't seem to figure out and would be grateful for any help. Note, I'm making attempts to do this locally. The only message that I see when I'm in Elastic cloud's dashboard under APM is, "Looks like you don't have any services with APM installed. Let's add some!".

Note, my fork (locally) not updated on my GitHub includes some of the code (with minor changes) following what was listed under this discussion on GH: [https://github.com/elastic/apm-agent-ruby/pull/119#issuecomment-411991347](https://github.com/elastic/apm-agent-ruby/pull/119#issuecomment-411991347) and I've tried this fork: [https://github.com/kressh/apm-agent-ruby](https://github.com/kressh/apm-agent-ruby).

I've double-checked the server URL and server token. Now, I'm wondering if I need to do some sort of an IP safelisting in Elastic Cloud/Kibana or whether I'm missing some additional steps to ensure that the dashboard is populated.

This is what my `elastic_apm.yml` looks like:

```auto
# Set service name - allowed characters:
# a-z, A-Z, 0-9, -, _ and space
#
# Defaults to the name of your Rails app
service_name: 'ElasticAPM'

# Use if APM Server requires a token
#
secret_token: <%= ENV["APM_SECRET"] || '' %>

# Set custom APM Server URL (
# default: http://localhost:8200)
#
server_url: <%= ENV["APM_SERVER_URL"] || '' %>

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![mikker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikker/32/22118_2.png) [@mikker](https://discuss.elastic.co/u/mikker)\
**Post date:** [February 11, 2019, 10:09pm UTC](https://discuss.elastic.co/t/instrumenting-elastic-apm-with-grape-rack-incomplete-docs/167918/2 "2019-02-11T22:09:06Z")

</div>

Hi David

There's no official, automatic Grape support yet. It's something we want to have eventually but I can't tell you when we'll have it.

The implementations you link to are user submitted and not official solutions. They are using the old `1.x` APIs. There was a significant update to the APIs with the `2.0` update.

The approach of using a custom middleware can work. The examples just need to be updated per the new APIs: [https://www.elastic.co/guide/en/apm/agent/ruby/current/api.html](https://www.elastic.co/guide/en/apm/agent/ruby/current/api.html)  
See perhaps the built-in Middleware for something to built off of:  
[https://github.com/elastic/apm-agent-ruby/blob/master/lib/elastic\_apm/middleware.rb](https://github.com/elastic/apm-agent-ruby/blob/master/lib/elastic_apm/middleware.rb)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 4, 2019, 6:09pm UTC](https://discuss.elastic.co/t/instrumenting-elastic-apm-with-grape-rack-incomplete-docs/167918/3 "2019-03-04T18:09:08Z")

</div>

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