Monitor MBTA Service Status and Performance With Datadog | Datadog

Monitor MBTA service status and performance with Datadog

Author Joel Barciauskas

Published: 3月 26, 2019

Data drives every decision we make at Datadog. That includes decisions about when to leave the office to catch the train! A few years ago, Datadog engineers created an MTA Service Tracker dashboard to provide ourselves and our fellow New Yorkers with detailed insight into New York’s subway system, the MTA. For a recent Datadog hackathon, Chuck Hagenbuch and I, part of our growing engineering team here in Boston, created a version of the service checker for our local system, the MBTA. You can find the MBTA dashboard here.

Monitor MBTA status with Datadog's dashboard

Accessing the data

The MBTA provides an incredible array of data for analysis, just waiting to be consumed, stored, and displayed using Datadog. We wrote an AWS Lambda function to pull real-time vehicle and station data from the MBTA’s GTFS feed (General Transit Feed Specification) into Datadog. The GTFS feed provides real-time, detailed data about the location of every vehicle and expected arrival times at every station, as well as important service alerts.

Our function takes the raw wait time data and pairs it with route and vehicle metadata as meaningful tags. It then sends this data to Datadog via our metrics API and creates events based on MBTA service alerts.

Visualizing it

Once we had that data in Datadog, it was time to design our dashboard. We’re lucky to have a beautiful office located in the Financial District, with quick access to multiple stops, so our shareable screenboard shows the next scheduled trains for six different stops within a 10-minute walk of our office: State Street, Park Street, Downtown Crossing, South Station, and North Station. It also calculates the average wait times and total number of vehicles across the system for each line.

The MBTA also provides performance data via a separate API. We know many of our customers are interested in service-level indicators (SLIs), and the MBTA provides data about their SLI status publicly—specifically the percentage of trips that are providing “good” service, arriving at each station within three minutes of their scheduled time. This provides insight into more severe service interruptions and whether service is on its way toward recovering.

Monitor MBTA SLIs with Datadog
Track the MBTA's overall performance SLIs with our dashboard.

Try it out

The Lambda function we wrote is publicly available on GitHub, so you’re welcome to use it as well. Just configure it with your own API key and create your own custom dashboard based on the stations and lines you care about. for a free trial of Datadog and let us know if you have other creative ideas about how to use and share this data!