@datadog/vis-fetch
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

@datadog/vis-fetch

vis-fetch

This package provides functions for fetching and transforming data from Datadog sources.

Install

yarn add @datadog/vis-fetch

Documentation and Demos

Visit our live demos page for current examples.

Usage

import { init } from "@datadog/ui-extensions-sdk";
import {
  fetchMetrics,
  metricsResponseToDataFrame,
} from "@datadog/vis-fetch";

const datadogClient = init();

// See Datadog metrics query syntax
// https://docs.datadoghq.com/metrics/
const query = 'avg:system.cpu.user{*}';
const now = Date.now();
const timeframe = {
  live: false,
  start: now - 600 // 60 seconds * 10 minutes
  end: now
}

const rawResponse = fetchMetrics(query, timeframe, client);
const dataFrame = metricsResponseToDataFrame(rawResponse);

// You can pass the dataFrame to one of the graphs in @datadog/vis-draw, or use your own
// charting library

Readme

Keywords

none

Package Sidebar

Install

npm i @datadog/vis-fetch

Weekly Downloads

2

Version

1.2.3

License

none

Unpacked Size

11.8 kB

Total Files

10

Last publish

Collaborators

  • datadog