Blog

Platform Extensibility with API v2 and the Custom Events Transformer

by David Hayes June 22, 2016 | 4 min read

Developer-StoryThe PagerDuty platform has enabled thousands of our customers to build great tools on top of our various APIs to resolve incidents faster and more effectively.  We’re proud to power the best ops teams on earth, so we’ve invested heavily in the next iteration of our API — officially available as of today.

Below are a few improvements that enable easier development and extended functionality on our platform:

  • Embedding PagerDuty in your apps: We’ve streamlined the API to make it faster and more consistent for your tooling to communicate with PagerDuty via our APIs.
  • Embedding your apps in PagerDuty: Leverage either pre-built or custom add-ons to embed applications within PagerDuty and extend functionality across all your events.
  • Create your own integrations: You can write your own custom integrations in JavaScript and seamlessly deploy them to multiple data centers, unlocking endless possibilities while still ensuring best-of-breed reliability and availability.

The innovative tools and use cases that many of our customers have already contributed are critical to our rich community, enabling developers (and non-developers) to take advantage of the latest and greatest industry best practices, and leverage PagerDuty as a single source of truth across any toolset.  

We’ll dive into each of these exciting new features below and showcase some impactful customer examples that illustrate how easy it is to use existing best practices and tools, build custom tools and integrations, and extend functionality with our API to get exactly what you want out of your PagerDuty experience. If you can dream it, you can build it.

Embedding PagerDuty in your app

Just like in our first API, you can display PagerDuty information in your app — such as embedding your PagerDuty schedules in your wiki or corporate intranet. You can import an individual’s schedule or a team’s schedule through the WebCal or iCal feed — some tools such as Confluence can even import that directly into your wiki.

If you need something more sophisticated, you can query the oncalls API in JavaScript and display who’s on call inline, wherever you’d like. Check out this simple JavaScript example that you can tweak to create your own embeddable widget.

Other helpful use cases from our customers include creating PagerDuty-powered dashboards and tools, and syncing their PagerDuty users with their Active Directory users or their services with a CMDB.

Embedding your apps in PagerDuty

Customers can now install either custom or pre-built add-ons via the API to embed rich dashboards inside PagerDuty for extended functionality. Examples include dashboards that showcase real-time Datadog, New Relic or Stackdriver data across all your incidents.

Here is how you can begin to embed apps within PagerDuty today:

traffic-breakdown

  • Embed a dashboard or tool on the menu bar by specifying “type”: “full_page_addon”: we use this to make runbooks, tools and Splunk reports easily available to our responders
  • Embed contextual information on all incidents in a service by specifying “type”: “incident_show_addon”: Get a notification from outside the firewall but embed information from Datadog, New Relic or Stackdriver

cpu-usage

Create your own integrations

With our new Custom Event Transformer, customers can take any tool that can run a script or send an HTTP/HTTPS request and run arbitrary JavaScript to convert those requests into PagerDuty events. In other words, PagerDuty can ingest raw unstructured data from almost any source and transform it into a valid event. Best of all, you can take advantage of PagerDuty’s legendary reliability — when you click “Save”, your code is deployed to four data centers in three continents for enterprise-grade availability and reliability. The whole process takes just minutes.

Here’s an integration one of our customers wrote to integrate with ServerGuard24. We even leverage it internally in PagerDuty to prototype new integrations.

But anything you can do with our events API is possible as well, such as writing code to enhance, filter or convert your events.

custom-event-transformer

You’ll be seeing more examples of custom event transformers soon, but if you create one today, you’ll start with a script that will make a unique incident out of any HTTP request.

Stay tuned to this blog for more examples to come — and if you’re local, come see us and explore our sessions at Velocity in Santa Clara this week, to learn more about PagerDuty’s continuous commitment to developer success.

Finally, we highly encourage you to access our latest and greatest developer resources, documentation, SDKs, and more at our Developer Portal.