@datadog/vis-fetch
This package assists with using data from Datadog APIs.
It is under active development, and subject to breaking changes.
Install
yarn add @datadog/vis-fetch
Usage
import { init } from "@datadog/ui-apps-sdk";
import {
fetchMetrics,
metricsResponseToDataFrame,
} from "@datadog/vis-fetch";
const datadogClient = init();
const query = 'avg:system.cpu.user{*}';
const now = Date.now();
const timeframe = {
live: false,
start: now - 600
end: now
}
const rawResponse = fetchMetrics(query, timeframe, client);
const dataFrame = metricsResponseToDataFrame(rawResponse);
The full documentation page is under review