New Relic Microsoft Teams App- 4 minutes read - 696 words
I am working with a global enterprise on rolling out the entire New Relic platform capabilities across their organization. The technical teams are happy and very confident in using the New Relic One platform. They have pretty much all the information they need and get all the way from high-level overviews of their entire stack down to code-level views.
However, for management and executive leadership it is hard to get an overview themselves. This is due to the fact that this user group typically does not have New Relic user accounts and can’t look at any dashboards, etc. The requirement is also that this user group does not need to log into “another tool” just to get an overview of how their business is performing. Their leadership team lives and breathes in Microsoft Teams.
This is where the requirement came up to have capabilities in the form of a Microsoft Teams app to visualize data in this environment without the need to log in to New Relic. The proposed solution seems like a valid approach to deliver on this requirement.
In general, a Microsoft Teams application consists of two components:
- The Microsoft Teams specification that can be configured using the built-in App Studio
- An application service that can be as easy as a custom web application that runs anywhere
Microsoft Teams App Specification
To configure the Microsoft Teams App, the easiest way to achieve this is by using the Microsoft Teams App Studio application that is part of Microsoft Teams app store itself. This can also be configured in Visual Studio Code.
To configure the Microsoft Teams App, the easiest way to achieve this is by using the files in the NewRelicTeamsApp folder. You need to customize the staticTabs part of the manifest.json and enter the appropriate contentUrl from the Azure Function or wherever your app backend lives. You can then zip the entire NewRelicTeamsApp folder and import into App Studio.
The Azure Function can be created without any specific requirements to keep in mind. You can simply create a Function App and add a HTTP triggered function. The code used in this example is based on Node.js, but you can actually also adopt it to any other language of your choice.
To customize the function you need to specify a couple of Azure Functions Application Settings:
- NEWRELIC_USER_KEY: the New Relic user API key
- NEWRELIC_DASHBOARD_ENTITYGUID: the entity GUID of the dashboard you want to display in Microsoft Teams
- REFRESH_INTERVAL: the refresh interval for the dashboard to automatically refresh
- IS_REFRESH_PAGE: an indicator on whether you want to refresh (true) the dashboard within the Microsoft Teams app or not (false)
The Azure Function then leverages New Relic’s NerdGraph interface in order to create a snapshot URL for the given dashboard and displays this dashboard as an image in the Microsoft Teams app.
In general, this code could also live anywhere else. It does not need to be an Azure Function. This code could also be deployed to any local web server that is available for the Microsoft Teams users.
There are obviously pros and cons to the approach described above. One the one hand side, the current solution solves one of the pain points of the customer. Managers can get an easily accessible high level overview of their business without leaving Microsoft Teams. At the same time, it is not much effort involved to get this in place.
On the other hand, it only delivers a static image of a dashboard. This can automatically be refreshed and updated, but still it is quite static. New Relic Dashboards are typically very interactive and allow you to select a different time window, filter the data and dive deeper into other areas. I did initially investigate another approach that would just retrieve the raw data from New Relic by leveraging New Relic Query API. I would then chart the data in different chart types and build a dashboard myself. But this is quite a lot of effort and would basically reinvent the wheel. However, this is absolutely possible and may solve some real problems that others face.
Below please find a sample screenshot of a dashboard.