Skip to main content

statsd

This document describes the ways in which a user can send ship metrics via statsd to Levitate.

Introduction

statsd is one of the oldest and most common ways to ship your application or infra metrics to a backend time series database like Graphite, InfluxDB, etc.

statsd comprises 3 basic concepts :

  1. client: usually a client library that instruments an application to send metrics e.g. statsd-kafka
  2. server: the statsd daemon accepting metrics from the client
  3. backend:- TSDB accepting metrics from the server

Pre-requisites

  1. You have created a Levitate cluster by following the getting started guide and have the following info:
    1. Remote write endpoint URL = $LEVITATE_REMOTE_WRITE_URL
    2. Remote write username = $LEVITATE_REMOTE_WRITE_USERNAME
    3. Remote write password = $LEVITATE_REMOTE_WRITE_PASSWORD
  2. Clone last9-integrations GitHub repo which contains the sample code.

statsd Graphite backend method

  1. statsd_client_application pushes metrics to statsd_server
  2. statsd_server has enabled built in backend Graphite.
  3. vmagent listens on port 2003 to accept metrics in Graphite format.
  4. vmagent remote writes these metrics to Levitate/

A complete example using this approach can be found here.

This is our recommended approach for pushing statsd metrics to Levitate.

Relay method

Relay method

  1. statsd_client_application pushes metrics to statsd_exporter.
  2. statsd_exporter transparently relays the metrics to existing statsd_server, which writes them to the statsd_backend e.g. Graphite, InfluxDb.
  3. statsd_exporter exposes the metrics on a /metrics port
  4. vmagent scrapes these metrics and remote writes them to Levitate.

A complete example using this approach can be found here

Repeater method

Repeater method

  1. statsd_application pushes metrics to statsd_server
  2. statsd_server enables repeater mode to push metrics to existing statsd_backend and statsd_exporter
  3. statsd_exporter exposes metrics on /metrics
  4. vmagent scrapes these metrics and remote writes them to Levitate.

A complete example using this approach can be found here

Comparison

ApproachProsCons
Graphite backendvmagent can push metrics to Levitate, no config changes to the applicaitonRequires changing statsd config
RelayNo config changes to the statsd.Requires changing application config.
RepeaterNo config changes to the application.Requires changing statsd config.

Next steps

Create a read token for your Levitate Cluster and follow our guide to Configure Grafana to visualize the time series data getting sent to Levitate.

Troubleshooting

Please get in touch with us on Discord or Email if you have any questions.