Atlassian Connect brings together developers from around the world to build better connected tools in the Atlassian Ecosystem. Last week’s Atlassian Connect Week in Austin, Texas was Dynatrace’s first attendance of this 5 day Hackathon-style event. While we came prepared to build new and tighter integrations between Dynatrace, JIRA Cloud, JIRA Service Desk and HipChat we left this event with additional integrations we built with our friends from xMatters.
On the final day each team had 3 minutes to demo the integrations they built during that week. We, Dynatrace and xMatters, decided to pair up and demo our end-to-end problem resolution DevOps use case. From a high-level perspective – this is what we built:
Even though the “Conference Wi-Fi Demo Gods” weren’t always on our side, we managed to demo our end-to-end integration as planned. When detecting a problem, Dynatrace notifies xMatters On-Call notification service. xMatters then gives the On-Call personal the option to create a JIRA ticket linked to the Dynatrace Problem. The Dynatrace JIRA Add-On pulls in live problem root cause information to enrich the JIRA ticket problem details. This fully integrated process shortens MTTR (Mean Time To Repair) as it gives every DevOps team member the right information in their respective tool.
Until Atlassian publishes the official demo recording, see what we built in the following video (or watch it on the Dynatrace YouTube channel):
Sharing is caring: How we leverage the Atlassian Connect Platform
We received a lot of help from the on-site Atlassian product team. While helping with technical questions they also shared their thoughts on additional use cases we havent thought about yet.
In order to give back to the community, I thought to write up our lessons learned while building our integration. Hope you follow our lead and help us grow the Atlassian ecosystem.
On a personal note, this week provided one of the steepest technical learning curves for me in a while. Special thanks to my colleague Daniel Dyla whom I partnered up with this week. While he implemented most of the integration I got to learn a ton from him during our doing pair programming sessions. I am grateful that he was so patient with me 🙂
Introducing our dev toolset
Daniel also taught me how to best use our choice of development tools and frameworks:
- Node.js for building our Jira and HipChat Add-Ons
- Express with the Atlassian Connect Express Add-On
- handlebars as templating framework
- Visual Studio Code as an IDE
- Bitbucket for our Source Code Repo
- ngrok for secure tunneling our local dev instance to the web
- Everything hosted on AWS EC2 behind an AWS ELB
Another great tool to have when implementing Cloud Add-Ons is ngrok. Ngrok is a reverse proxy and exposes your local dev service to the web so that you can register it with e.g: Atlassian Connect. Ngrok also gives you full visibility into every single request it proxies and allows you to replay requests. Replay is especially useful for debugging and testing.
While there are more personal lessons to share I think its time to dig into some of the specific technical integrations we built this week. Hope this suites your efforts when building Atlassian Connect Add-Ons:
Entity Properties: Linking Dynatrace Problems with JIRA Tickets
In order to link a JIRA Ticket with a Dynatrace Problem we simply store the Dynatrace Problem ID as an Entity Properties on the JIRA ticket. Entity Properties have unique names with a JSON object as value. We called our Entity Property “dynatraceProblemId” with the JSON object to contain the actual unique PID and optionally additional properties such as severity, impact, status and tags.
Whether Dynatrace directly creates a JIRA ticket using our Dynatrace to JIRA Integration or whether tools such as xMatters creates a JIRA ticket. It is enough to simply set the “dynatraceProblemId” entity property. This property will link the JIRA ticket back to the originating Dynatrace Problem.
The Atlassian dev team showed us a cool trick for troubleshooting. The free Entity Property Tool Add-On makes it easy to debug and validate if your properties are stored and contain the correct values.
We also decided to use webhooks to keep the entity property values up to date, e.g: when a JIRA ticket status changes, we synchronize these values with the Dynatrace Problem Information we pull through the Dynatrace REST API. More on webhooks later in this blog post.
JIRA UI Extension: Live Data Feed and Configuration
The most visible part of our JIRA integration is our UI Add-On. We took advantage of creating creating custom issue tabs, web panels, and configuration panels. The most interesting ones for our users can be seen in the following screenshots:
#1: LIVE Dynatrace Problem Status
This Add-On is only visible in case the JIRA ticket has the dynatraceProblemId entity property set. If that is the case the Add-On pulls live data through the Dynatrace Problem REST API. It immediately shows the person who views the JIRA ticket which status the problem is in, whether there is a root cause detected, how many components are impacted and which tags are assigned to the components that are impacted. Clicking on a tag opens a JIRA search which results in similar JIRA Problem tickets. This makes it easy to find related or previous similar problems. More on that later in the blog under Indexable Properties.
#2: Live Dynatrace Problem Event Feed
We also added a JIRA issue tab where we show the full list of events and comments on the linked Dynatrace Problem. This allows the user to see the complete event history for that problem with direct links to the Dynatrace Root Cause dashboard for every single event, e.g: Response Time Hotspots in case a Service degraded in performance.
Indexable Properties: Enables JQL for Dynatrace Meta Data
Add-Ons can define Entity Properties that should be indexed by JIRA. That makes these values available for advanced searches via JQL (JIRA Query Language). We decided to make all our properties indexable by simply following the description under How do I make the properties of an entity searchable.
Having these entities such as Dynatrace tags indexed allows another cool feature. When analyzing a JIRA ticket for a problem, a user can simply click on the tag name which will open a JQL search for tickets that also have the same tag. Makes it easier to find related problems.
The idea about this feature came up in a conversation with xMatters and other attendees at Atlassian Connect Week. This enables users and tools like xMatters to execute JQL queries against problem information collected by Dynatrace. The ability to query JIRA tickets using Dynatrace data is a key capability for large DevOps teams using multiple tools such as JIRA, xMatters and Dynatrace.
Webhooks: Synchronize JIRA Ticket and Dynatrace Problem
Atlassian provides a handful of Webhooks for their different product. The JIRA webhooks allow us to react on changes to entities such as a JIRA ticket. Here the list of webhooks we are using for our Add-On:
- comment_created: we parse new comments on JIRA tickets and see if it is relevant for us. If the JIRA ticket is already associated with a Dynatrace Problem (stored in the entity property) we push the comment to the Dynatrace ticket via the Problem API. If the comment contains an HTTP link to a Dynatrace Problem we parse the Dynatrace Problem ID from the link and set it as an entity property. This enables our JIRA Add-On which will then pull in live data
- jira:issue_created: we parse the description of a newly created ticket and do the same as with comments in case it contains a link to a Dynatrace problem
- jira:issue_updated: we are listening for changes to the description and status field. This allows us to keep the ticket and Dynatrace problem in sync
HipChat panel: Live Problem Feed into your chat room
Besides the integration with JIRA, Daniel also built another great integration with HipChat. HipChat can be extended with a sidebar that allows us to show a list of current open Dynatrace Problems. If your DevOps teams are collaborating through HipChat to work on open issues, then this side bar makes it very easy to quickly jump on new problems. The list is sorted, showing open problems on the top. The list also allows teams to directly jump into the Dynatrace Problem Details by clicking on the Dynatrace Problem Title.
Atlassian Connect(ions) build stronger and better tools
Atlassian build a great ecosystem with many partners, extending the tools that empower many organizations already to improve collaboration. I encourage everyone to follow our lead and build new solutions based on the existing Atlassian Connect framework.
If you happen to be at the Atlassian Summit this September feel free to chat with us. Both xMatters and Dynatrace will be there. Happy to chat about our lessons learned when building our integrations.