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:
If you want to test drive our plugins simply follow the instructions on our GitHub pages: Dynatrace Jira AddOn and xMatters Dynatrace Integration.
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
I have to admit that developing with Node.js was a paradigm shift for me as I mainly used to develop “plain old” Java or C#. It took a while to fully understand and embrace event and callback-driven JavaScript development. I wasted a lot of time in “trial & error” attempts to test my code. Most of my runtime errors were due to typos which I am used to being highlighted by my IDE or compiler. Visual Studio Code, and especially some of the language specific extensions that Daniel showed me, made it much easier. At the end of the week I got to a stage where our tools allowed me to quickly roll out and test new changes.
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.
Looking for answers?
Start a new discussion or ask for help in our Q&A forum.
Go to forum