Loading...

Platform engineering: Monitor Backstage with Application Insights

Platform engineering: Monitor Backstage with Application Insights

DavidHernandez_0-1718183010068.png

 

The platform engineering journey requires abundant information to make informed decisions. Understanding how developers use the platform—how frequently and for how long—is invaluable. Since the internal developer portal (IDP) serves as the central hub for developers’ regular tasks, it becomes the ideal location for monitoring these activities and collecting essential data.

 

Backstage, a common IDP implementation, provides an excellent opportunity to demonstrate how to integrate monitoring. In this article, we’ll explore how to add monitoring to the Backstage portal using Azure Monitor, specifically Application Insights.

Upon reviewing the Backstage documentation, we find that the portal is already instrumented using OpenTelemetry. Furthermore, Application Insights is a supported provider for OpenTelemetry.

This is excellent news, as it streamlines the process and saves time that would otherwise be spent manually adding tracing calls to the Backstage code.

 

To enable OpenTelemetry instrumentation, follow the steps in the official documentation(https://backstage.io/docs/tutorials/setup-opentelemetry/). Start by adding the required packages using the following command:

 

yarn --cwd packages/backend add \ @opentelemetry/sdk-node \ @opentelemetry/auto-instrumentations-node \ /monitor-opentelemetry-exporter

 


Next, create a new file named 
instrumentation.js inside the backend/src folder.

The content of the file should be: 

 

const { NodeSDK } = require('@opentelemetry/sdk-node'); const { getNodeAutoInstrumentations, } = require('@opentelemetry/auto-instrumentations-node'); const { AzureMonitorTraceExporter } = require("@azure/monitor-opentelemetry-exporter"); const { AzureMonitorMetricExporter } = require("@azure/monitor-opentelemetry-exporter"); // Create an exporter instance const azTraceExporter = new AzureMonitorTraceExporter({ connectionString: process.env["APPLICATIONINSIGHTS_CONNECTION_STRING"] || "<YourAppInsightsConnectionString>" }); const sdk = new NodeSDK({ traceExporter: azTraceExporter, instrumentations: [getNodeAutoInstrumentations()], }); sdk.start();

 

 

And with that...we are done!

 

Browse some pages within the Backstage portal and in a few minutes, telemetry will be available in Application Insights.

Here are some samples of information that has been gathered. All this information is out-of-the-box reports, so without any other customization, we can obtain a wealth of information.


We can check if the portal is returning errors, if the response time is within acceptable parameters, how many requests are made and the usage pattern...

 

DavidHernandez_1-1718129096966.png

Examine the details of a request to Backstage, the time taken to serve the request and the time spent on all dependencies...

DavidHernandez_0-1718129002459.png

Retrieve information from the accessed URLs, for example, to identify the most common searches and ascertain developers' interests.

DavidHernandez_2-1718129402524.png

Published on:

Learn more
Need help with this product?

We can help you with Platform engineering: Monitor Backstage with Application Insights

If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.

Azure Developer Community Blog articles
Azure Developer Community Blog articles

Azure Developer Community Blog articles

Share post:

Related posts

This Month in Azure Static Web Apps | 09/2024

    We are back with another edition of the Azure Static Web Apps Community! :party_popper:   September was yet another month ...

1 year ago

GitHub Copilot for Azure: 6 Must-Try Features

As developers, we are constantly seeking tools that streamline our workflows and boost productivity. … Enter GitHub Copilot for Azure, now in ...

1 year ago

Responsible AI Mitigation Layers

Generative AI is increasingly being used in various kinds of systems to augment humans and infuse intelligent behavior into existing and new a...

1 year ago

Streamline Your Azure Workflow: Introducing GitHub Copilot for Azure in VS Code

I'm excited to announce the public preview of GitHub Copilot for Azure - a new addition to your toolkit that seamlessly integrates with G...

1 year ago

Build Intelligent Apps Code-First with Prompty and Azure AI

      Building Generative AI applications can feel daunting for traditional app developers. What does the end-to-end applicati...

1 year ago

Certificación AI-900 (Fundamentos de IA) con Chicas en IA

La inteligencia artificial ha llegado para quedarse, ¡y más aún con la revolucionaria IA generativa! Para ayudar a los profesionales a especia...

1 year ago

Get certified with Learn Live GitHub series!

GitHub Universe is coming, and Microsoft and GitHub are partnering to offer a new special Learn Live series in Brazilian Portuguese, English a...

1 year ago

Certifícate con Learn Live GitHub en Español

Microsoft y GitHub se han unido para ofrecer una nueva serie especial de Learn Live en inglés y español: GitHub 2024. Del 10 al 24 de Octubre,...

1 year ago

Evaluating generative AI: Best practices for developers

As a developer working with generative AI, you've likely marveled at the impressive outputs your models can produce. But how do you ensure the...

1 year ago

Introducing Azure Product Retirement Livestreams

The Azure Retirements team, in collaboration with key partner groups, is excited t...

1 year ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.