SignalForm: Charts as Code with SignalFx and Terraform
Antonio Verardi, Yashashree Kokje, Software Engineers
- Oct 6, 2017
Monitoring the health of our systems is a critical part of maintaining Yelp’s infrastructure. We collect millions of data points that help us observe the performance and status of our services. This data powers visualization and monitoring systems so that we can alert on anomalies and derive actionable insights, especially during on-call procedures.
SignalFx is our preferred vendor for metrics visualization and monitoring. They provide a rich UI with many robust analytics capabilities. At Yelp’s scale, we use SignalFx to create hundreds of detectors, charts and dashboards. Managing and finding these resources quickly is a challenge. Our engineering teams need to be able to discover the graphs and detectors they own, quickly create and update them and be informed about changes to them.
In an effort to programmatically improve how we manage dashboards, we developed SignalForm, a tool to codify SignalFx resources and version control them.
At Yelp we believe in “infrastructure as code”. We extensively use Terraform to programmatically build, change, and version infrastructure safely and efficiently. Terraform manages most of our AWS infrastructure, allowing engineers to code review infrastructure changes before they’re applied.
We decided to apply the same methodology to our SignalFx artifacts. SignalForm is a Terraform provider which leverages the new SignalFx API to create, update and delete SignalFx resources. We now keep all critical SignalFx artifacts versioned in git and engineers are able to programmatically manage them. Artifacts are namespaced under each team and project to enable quick discovery. With the ability to review the SignalFlow code powering a detector, teams have started to collectively devise and validate the alerting logic before anyone gets paged by an inefficiently configured detector.
What would creating detectors as code look like? The snippet below creates a detector monitoring the maximum delay seen by our application for every region it’s been deployed to. Terraform’s interpolation syntax allows us to create one detector resource for each value declared in the list of regions. This list can be shared across multiple files and folders to create additional resources.
Similarly, you can create a chart with SignalForm to visualize a metric:
To provide validation and easier introspection of all SignalFx artifacts created through Terraform, we built a set of developers tools. Additionally, these tools allow us to test whether a detector would have fired by replaying data from the past using SignalFx preflight.
SignalForm has ended up being more than just another Terraform provider for us. It has enabled us to improve Yelp’s monitoring culture. Today we are able to evolve our charts, dashboards and detectors together with the rest of our infrastructure.