README.md in instana-0.14.2 vs README.md in instana-0.15.0

- old
+ new

@@ -56,10 +56,33 @@ You can find more documentation covering supported components and minimum versions in the Instana [documentation portal](https://instana.atlassian.net/wiki/display/DOCS/Ruby). ## Want End User Monitoring? -Instana provides deep end user monitoring that links server side traces with browser events. See [End User Monitoring](https://instana.atlassian.net/wiki/display/DOCS/Web+End-User+Monitoring) in the Instana documentation portal. +Instana provides deep end user monitoring that links server side traces with browser events. + +For Ruby templates and views, get your EUM API key from your Instana dashboard and you can call `::Instana::Helpers.eum_snippet('example_api_key_string')` from within your layout file. This will output +a small javascript snippet of code to instrument browser events. It's based on [Weasel](https://github.com/instana/weasel). Check it out. + +As an example for Haml, you could do the following: + +```ruby +%html{ :lang => "en", :xmlns => "http://www.w3.org/1999/xhtml" } + %head + - if user_signed_in? + = raw ::Instana::Helpers.eum_snippet('example_api_key_string', :username => current_user.username) + - else + = raw ::Instana::Helpers.eum_snippet('example_api_key_string') + %body +``` +Make sure to use the `raw` helper so the javascript isn't interpolated with escape strings. + +The optional second argument to `::Instana::Helpers.eum_snippet` is a hash of metadata key/values that will be reported along +with the browser instrumentation. + +![Instana EUM example with metadata](https://s3.amazonaws.com/instana/Instana+Gameface+EUM+with+metadata+2016-12-22+at+15.32.01.png) + +See also the [End User Monitoring](https://instana.atlassian.net/wiki/display/DOCS/Web+End-User+Monitoring) in the Instana documentation portal. ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.