- Top ↑
- netuitived is a daemon that allows metrics to be exported to the Netuitive API.
- netuitive_ruby_api is a gem that allows for easy integration with netuitived.
- netuitive_rails_agent is a gem that provides default Ruby on Rails metrics and sends them to netuitived using netuitive_ruby_api.
The Netuitive Ruby agent can also be tuned to help application performance and used to read garbage collection metrics. The flow-chart below details the flow of data from your application to Netuitive.
Setting up the Ruby agent is a two-step process:
- Copy the unique API key from the Ruby integration in your account.
- Install the three gems on your system.
Step 1: Copy the API key from the Ruby integration in your account
- From the top navigation menu, select Integrations.
- Select the Ruby card. The name should be already populated, and Data Collection should be enabled. A unique API key for your account has already been generated.
Step 2: Install the Gems
- Install the netuitived gem using the below command:
gem install netuitivedImportant For busier Rails applications, you'll want to avoid running the daemon on the same server as your application.
- Run the start script once the gem has been installed:
- Enter the desired element name into the prompt, then type into the prompt the unique API key generated for your account that you copied in step 1.
If you're unsure what to name your element, you should use the name of your ruby application. Example(s) Below is a sample prompt generated by the Ruby agent. A sample element name and API key are highlighted.
admin:~$ netuitived start please enter an element name: sample_app please enter an api key: cb73834fa800f987s84sffas767f11b2c
- Optionally, edit the netuitived config/agent.yml file if you wish to update the caching interval, use environment variables, change the host location instead of using the default, or want to adjust the logging configuration options.
- Add the following line to the Gemfile in your rails application:
gem 'netuitive_rails_agent'Important The netuitived gem must be running before you install the netuitive_rails_agent gem.
- Inside your rails application project directory run the following code snippet to install both the netuitive_rails_agent and netuitive_ruby_api gems:
bundle installImportant You'll need the netuitive_ruby_api gem If you're not using a rails application or if you are using a rails application and want to create your own custom metrics.
- Optionally, edit the netuitive_rails_agent config/agent.yml file if you want to adjust the default settings. Check out the performance tuning section to learn more about the different options.
- Optionally, edit the netuitive_ruby_api config/agent.yml file if you want to adjust the default settings. Check out the performance tuning section to learn more about the different options.
- Restart your rails application and begin monitoring your data with Netuitive.Note This integration's package (computed metrics, dashboards, and policies that will give you important events and alerts) will be automatically enabled and provisioned to your account as soon as Netuitive receives data from the integration. The PACKAGES button on the integration setup page will become active once data is received, so you'll be able to disable and re-enable the package at will.
Additional Configuration Options
The Netuitive Ruby agent is capable of several thousand hits per minute on a basic setup and comes with a wealth of logging, event, metric, error tracking, and caching options. The cache acts as a buffer, batching requests to the daemon. The larger the cache, the larger the memory footprint, but less CPU and network time will be spent sending errors and metrics to the daemon. Depending on your preferences, you can tune the agent to help with CPU / network usage or memory usage.
Netuitive Rails Agent configuration options
|Log config options||
|Active support notifications||
The active support notifications are a pub-sub model that trigger active support notifications when certain actions are performed within your rails application(s). Each flag is toggling a certain set of active support notifications for a subset of metrics in Netuitive.
|Error tracking features||
Netuitive Ruby API configuration options
|Netuitived connection properties||Netuitived address and port information.|
The cache settings are related to the threads and events on your host ruby application. It allows for a small buffer to limit the amount of calls made to the daemon. The main purpose is to cache enough data to not have excessive thread growth when making calls to the daemon.
Important Owners of busy rails applications may have to adjust the settings; otherwise, the default settings should be fine for most applications. If you find you're receiving a lot of errors, you may want to turn the error cache on.
Enabling Garbage Collection Metrics
The garbage collector attempts to return memory consumed by objects no longer in use by your application. Netuitive can be used to collect metrics on how much time is spent in garbage collection for your Ruby applications. You should have Matz's Ruby Intepreter (MRI) version 1.9.2 or greater or Ruby Enterprise Edition installed before enabling garbage collection metrics.
- Navigate to your application's initialization file.
- Add the following call (depending on your Ruby version) to the file:
Note If you have a Rails application, you can add one of the calls above to an initializer in config/initializers or directly to your config/application.rb.
- For MRI v1.9.2 or greater:
- For Ruby Enterprise Edition:
- For MRI v1.9.2 or greater:
- Save the file and restart your application.
Interpreting Exception External Events
If you have the sendErrorEvents setting enabled in the netuitive_rails_agent config/agent.yaml file and the actionErrorsEnabled and/or sidekiqEnabled settings are set to true, exceptions will be sent to Netuitive as external events. A Ruby Exception external event has the following tags to help you dissect the exception:
|Action||The action the error originated from.|
|Controller||The name of the controller that the exception came from.|
|Exception||The type of exception.|
|Sidekiq||If true, this exception comes from sidekiq. If false, this exception comes from elsewhere.|
|URI||The resource identifier that names the resource the exception came from.|
Because these tags are located within the message body, you can create a policy matching against the body of the message.
|Fully Qualified Name (FQN)||Description||Statistic||Units||Min||Max||BASE||CORR||UTIL||Related Default policies|
The total time spent on requests to a specific controller.