npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kozmoai/backstage-plugin-datadog

v2.2.7

Published

Embed Datadog graphs and dashboards into Backstage.

Downloads

3

Readme

Datadog Plugin for Backstage

Embed Datadog graphs and dashboards into Backstage.

Datadog is a monitoring service for cloud-scale applications, providing monitoring of servers, databases, tools, and services through a SaaS-based data analytics platform.

This readme will show you how to

  • Setup and integrate the plugin into Backstage.
  • Obtain the dashboard URL and graph tokens from Datadog that you will need for your metadata.
  • Adding the annotations and the values from Datadog to your component's metadata file.

dashboard

Setup and integrate the plugin into Backstage.

  1. In the packages/app directory of your backstage instance, add the plugin as a package.json dependency:
$ yarn add @kozmoai/backstage-plugin-datadog
  1. import the plugin to the entityPage.tsx source file:
import {
  EntityDatadogContent,
  EntityDatadogGraphCard,
  isDatadogGraphAvailable,
} from '@kozmoai/backstage-plugin-datadog';
  1. Add a Datadog card to the overview tab to the entityPage.tsx source file:
const overviewContent = (
  <Grid container spacing={3} alignItems="stretch">
    ...
    <EntitySwitch>
      <EntitySwitch.Case if={isDatadogGraphAvailable}>
        <Grid item>
          <EntityDatadogGraphCard />
        </Grid>
      </EntitySwitch.Case>
    </EntitySwitch>
    ...
  </Grid>
);
  1. Add a Datadog tab to the entityPage.tsx source file:
const serviceEntityPage = (
  <EntityPageLayout>
    ...
    <EntityLayout.Route path="/datadog" title="Datadog">
      <EntityDatadogContent />
    </EntityLayout.Route>
    ...
  </EntityPageLayout>
);

Specify datadog domain

Datadog embedded graph is using datadoghq.euas default top-level domain, when other is not specified. If you are using other domain, you need to specify it with corresponding annotations datadoghq.com/site.

Adding the annotations and the values from Datadog to your component's metadata file.

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: sample-service
  description: |
    A sample service
  annotations:
    datadoghq.com/site: <<DATADOGDOMAIN>>

Embed a datadog dashboard in Backstage

Obtain the dashboard URL from Datadog that you will need for your metadata.

  • Login to your Datadog account.

Get the dashboard URL.

  • Navigate to the dashboards list by hovering over dashboards on the page's left-hand side and selecting the dashboard list.

  • Select a dashboard from this list.

  • Within the dashboard you have chosen, click the settings cog on the screen's right-hand side, circled in red.

dashboard

  • Copy the URL from the Sharing textbox.

  • This URL is the value you need for the datadoghq.com/dashboard-url annotation.

dashboard share

  • Note: You can also add multiple dashboards by creating a list of URLs in the annotation file (Each URL must be separated by a comma - , )

Adding the annotations and the values from Datadog to your component's metadata file

Embedding a single dashboard

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: sample-service
  description: |
    A sample service
  annotations:
    datadoghq.com/dashboard-url: datadoghq.com

Embedding multiple dashboards

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: sample-service
  description: |
    A sample service
  annotations:
    datadoghq.com/dashboard-url: datadoghq.com,datadoghq.com/dashboard2

Embed a datadog graph in Backstage

  • Login to your Datadog account.

Get the graph token.

  • Click on the graph pencil, circled in red, from your dashboard.

dashboard

  • Click on the Share tab, choose a timeframe, graph size and legend. Click generate the embedded code.

  • Copy the token value that is highlighted in the red square.

  • this token is the value you need for the datadoghq.com/graph-token annotation

dashboard

Customize graph size.

  • In order to customize size of the graph you may specify datadoghq.com/graph-size annotations and specify one of the following options:

  • 'small'

  • 'medium'

  • 'large'

  • 'x-large';

If not specified, your graph will be 'medium' size per default.

Adding the annotations and the values from Datadog to your component's metadata file.

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: sample-service
  description: |
    A sample service
  annotations:
    datadoghq.com/graph-token: <<TOKEN>

What it looks like

For the dashboard

Navigate to the Datadog tab, and you will see your dashboard. dashboard share

For the graph

Navigate to the overview tab for your component. And you will see the graph. dashboard share

Security

A word of note regarding the security of the datadog dashboards and graphs.

The instructions provided for sharing dashboards and graphs generate a URL.

This URL is public to anyone who bears it.

If obtained by another actor, it is usable by them.

Contributing

Everyone is welcome to contribute to this repository. Feel free to raise issues or to submit Pull Requests.

Join our Discord server!

Links

  • Backstage
  • Get hosted, managed Backstage for your company: https://glint.io