🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@datadog/vis-fetch

Package Overview
Dependencies
Maintainers
1
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/vis-fetch

Datadog Data Visualization SDK - Data fetching / parsing functions for Datadog APIs

1.2.3
latest
npm
Version published
Weekly downloads
310
30900%
Maintainers
1
Weekly downloads
 
Created
Source

@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

FAQs

Package last updated on 25 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts