Librato Destination

Segment makes it easy to send your data to Librato (and lots of other destinations). Once you've tracked your data through our open source libraries we'll translate and route your data to Librato in the format they understand. Learn more about how to use Librato with Segment.

Getting Started

When you toggle on Librato in Segment, this is what happens:

  • Our CDN is updated within 5-10 minutes with our custom Librato provider inside analytics.js.
  • Since Librato only records custom events, no metrics will appear in Librato until you start using the API outlined below.

Librato supports our track method for both client-side and server-side.


Track

When you call track, we add a gauge measurement to Librato. The gauge is named after your event.

Here’s an example using Node.js

analytics.track({
  userId: '507f191e81',
  event: 'Event Triggered'
  properties: {
    value: 2
  }});

And here’s an example with Python

analytics.track('507f191e81', 'Event Triggered', {
      'value': 2
 })

The value event property allows you to set the magnitude of the data point. All other event properties will be ignored.

Metrics

To get the most out of your event gauges, you’ll want to enable the following options in the Librato interface for each Segment gauge:

librato event gauges segment destination

Period - if set to 60 seconds, each data point on the graph represents the sum of the total number of events that happened in the last 60 seconds.

Source Aggregation - allows you to aggregate your gauge metrics over a period of time.

Average: Sum - sums measurement values over time.

Metric Source

You may want to be able to split your time series metrics by the source, such as the computer which the event is coming from. By default, the source is set to the event, but you can override it by setting context.Librato.source.

Here’s an example using Node.js

analytics.track({
  userId: '507f191e81',
  event: 'Event Triggered'
  properties: {
    value: 2
  },
  context: {
     'Librato': {
        'source': 'your-web-server-X.X.X.XX'
     }
  }
});

And here’s an example with Python

analytics.track('507f191e81', 'Event Triggered',
  {
    'value': 2
   },
   {
    'Librato': {
      'source': 'your-web-server-X.X.X.XX'
  }
})

Personas

You can send computed traits and audiences generated through Segment Personas to this destination as a user property. To learn more about Personas, reach out for a demo.

For user-property destinations, an identify call will be sent to the destination for each user being added and removed. The property name will be the snake_cased version of the audience name you provide with a true/false value. For example, when a user first completes an order in the last 30 days, we will send an identify call with the property order_completed_last_30days: true, and when this user no longer satisfies we will set that value to false.

When the audience is first created an identify call is sent for every user in the audience. Subsequent syncs will only send updates for those users which were added or removed since the last sync.

Supported Sources and Connection Modes

WebMobileServer
📱 Device-based
☁️ Cloud-based

To learn more about about Connection Modes and what dictates which we support, see here.

Settings

Segment lets you change these destination settings via your Segment dashboard without having to touch any code.

email

This should be the email you signed up for your Librato account with.

Token

You can find your API Token on the Librato Account page.



Questions? Need help? Contact us!
Can we improve this doc?
Email us: docs-feedback@segment.com!