Giter Club home page Giter Club logo

backstage-plugin-datadog's Introduction

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

Repository migration notice (June/July 2021)

In order to make testing and deployment of our plugins easier we are migrating all Roadie plugins to a monorepo at https://github.com/RoadieHQ/roadie-backstage-plugins. The plugins will still be published to the same place on NPM and will have the same package names so nothing should change for consumers of these plugins.

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 @roadiehq/backstage-plugin-datadog
  1. import the plugin to the entityPage.tsx source file:
import {
  EntityDatadogContent,
  EntityDatadogGraphCard,
  isDatadogGraphAvailable
} from '@roadiehq/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

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/dashboard-url: <<DATADOGURL>>

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 us on Discord.

Join our Discord server!

Links

backstage-plugin-datadog's People

Contributors

dependabot[bot] avatar dtuite avatar gaardsholt avatar irma12 avatar mcalus3 avatar padraigobrien avatar stwf avatar xantier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

backstage-plugin-datadog's Issues

Dashboard with mutliple charts fails to load

Expected Behavior

You can view a dashboard url with multiple charts/widgets.

Current Behavior

Trying to view a dashboard with multiple widgets doesn't see to work and results in a datadog Oof error. It seems to be related to the appending of the tvmode query string. Removing it seems to avoid the error.

Possible Solution

I'm not sure what tvmode does, but is it necessary?

Steps to Reproduce

  1. Create a Datadog dashboard with 5-6 charts
  2. Configure the dashboard for sharing
  3. Use the shared dashboard url on the datadog entity annotation
  4. Try and view the dashboard

Context

Testing out the datadog plugin:

Your Environment

  • Plugin Version: 0.2.1
  • Backstage version: Up to date
  • NodeJS Version: 14
  • Operating System and Version: macOS
  • Browser Information: chrome or ff

CSP Issue - Datadog Limitation?

Hi!

I've tried loading the plugin following the instructions (including adding the CSP settings), but it seems there might be some issue related to headers set by Datadog in order to prevent their stuff from being referenced from iframes?

When trying to use the EntityDataDogContent with a dashboard URL (e.g. https://app.datadoghq.com/dashboard/844435-e4p-vue/some_dashboard?from_ts=1669289464232&to_ts=1669293064232&live=true), I'm getting the following error:
Refused to frame 'https://app.datadoghq.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".

Any idea if this plugin still works?

Thanks!

Installation step 4 no longer works with version 0.2.1

Hey Guys

thanks for the project but I was just wondering if you could update the installation steps for version 0.2.1 as there only work for version 0.1.1

looks like a couple thing have been deprecated in the last version.

cheers

Documentation on main plugin site

Hey guys,

Just wondering if there were plans to update the documentation on here ? That documentation threw me off for a while because it's the main link on the Backstage site.

Happy to help if needed.

Josh

Upgrade @backstage/core and @backstage/catalog-model to 0.7.x

Expected Behavior

That the yarn backstage-cli versions:check runs without any issues.

Current Behavior

It fails.

Possible Solution

Upgrade @backstage/core and @backstage/catalog-model to 0.7.x

Steps to Reproduce

  1. Run This plugin prevents the yarn backstage-cli versions:check command to run successfully.
  2. See it fail

Context

Your Environment

  • Plugin Version (version of this software e.g. v0.4.3): 1.0.0

Top level domain for the embedded graph url is fixed to .eu

Expected Behavior

Current Behavior

The url used for embedded graph it's using the eu as the top-level domain and it causes the graph to not be found. In our case we use .com

src={`https://app.datadoghq.eu/graph/embed?token=${graphToken}&height=${height}&width=${width}&legend=true`}

Possible Solution

Maybe add the url as a config or part of the annotations

Steps to Reproduce

Context

Your Environment

  • Plugin Version (version of this software e.g. v0.4.3): 1.0.0
  • Backstage version (e.g. 0.1.1-alpha23): 0.7.4
  • NodeJS Version (e.g. v12):
  • Operating System and Version (e.g. Ubuntu 14.04):
  • Browser Information (e.g. chrome 85):

No Public Sharing

Can a different scenario be taken into consideration. This is the one in which you do NOT "public share" your dashboard, and if you do just do all the request via the backend not the frontend.

All of this comes because at our end we have the "pubblic share" whitelisted base on IPs, so it is not possible for a dev that is at home (and not connected to the VPN) to check the Datadog backstage plugin as it would be impossible to whitelist his/her IP.

Hope this easy explanation helps.

expected workspace package to exist for rollup-plugin-typescript2

Getting the following error when running the following in /packages/app: yarn add @roadiehq/backstage-plugin-datadog

error An unexpected error occurred: "expected workspace package to exist for "rollup-plugin-typescript2"".

Current Behavior

Possible Solution

Steps to Reproduce

  1. Step 1
  2. Step 2
  3. ...

Context

Your Environment

  • Plugin Version (version of this software e.g. v0.4.3):
  • Backstage version (e.g. 0.1.1-alpha23):
  • NodeJS Version (e.g. v12):
  • Operating System and Version (e.g. Ubuntu 14.04):
  • Browser Information (e.g. chrome 85):

The datadog annotations should be prefixed with datadoghq.com

Expected Behavior

As per common backstage conventions for annotations, the left side of annotation typically matches the domain name of the company or organization (e.g. github.com, backstage.io, jenkins.io, etc.)

Current Behavior

The annotation for the plugin uses the prefix datadog/dashboard-url which doesn't map to a domain name of https://www.datadoghq.com/.

Possible Solution

Rename the annotation prefix to match datadoghq.com or datadog.com (which seems to redirect to the prior). For example datadoghq.com/dashboard-url

Steps to Reproduce

n/a

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.