Sftrace::Agent
Sftracing enables you to analyze performance throughout your microservices architecture all in one view. This is accomplished by tracing all the requests - from the initial web request to your front-end service - to queries made to your back-end services. This makes finding possible bottlenecks throughout your application much easier and faster.
Installation
Add this line to your application's Gemfile:
gem 'sftrace-agent'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install sftrace-agent
Usage
Add the dependency at the top in the application.rb file.
require "elastic-apm"
Add the following line inside the class of the main module in the application.rb file.
Sftrace::Agent.set_sftrace_config('sftrace-demo', '/opt/sfagent/config.yaml')
Create config.yaml file either inside the config
folder of the Ruby on Rails Application or inside the /opt/sfagent/
folder.
The config file should have the following details.
tags:
serviceName: sftrace-demo
appName: ruby
projectName: sftrace
key: k64QokCTjcgxlBZ6m0tBn0+iZpXB3602LED5nsnhPsWSvRtPfEioLRkF8BMQDZDki5R6kLCozgeoWsNXPa7zl7q6OdHjbHKHbLetc39ABseSq75tuGc6HUGpXhtiXkjO0l8IW2zFv5+2NxhY8ybJX/0Y8WgDr3CtyDVNLuaNeKljjTyNBMFO+iP4oOR9kA2YjV8f1//e/niu3FhJFA1CI7bXh+c3BsRPrpOkC8NOEjuvLbKRZLQYb5VilvxY5rxOyKTiKNer+J+MgXIUm+laAMBF9rXfW1m9YgpFoPtK2s1xysvLsjZteIvvPSBDZdA9PW/oa44y4etiwhEQQ5PUO3sSkyHKefkwyk+LqdqyJdm0XJja/a/n9/DbSn/G1MceaFC/f1Jt8u9AQq9OGnAkpA==
Development
If you want to edit the Gem, then you can edit the following :
lib/sftrace/agent.rb
: contains the actual logic
lib/sftrace/agent/version.rb
: contains the Gem version
sftrace-agent.gemspec
: contains the Gem specification
License
The gem is available as open source under the terms of the MIT License.