cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Embed Dynatrace dashboard into our web application

Thanrindu
Newcomer

I'm trying to Embed the Dynatrace dashboard into our website. for that, I have tried Dynatrace Dashboard API which is provided by the documentation. I tried the below API endpoint to get all available tiles in the given dashboard. here I pass the dashboard ID.

https://{environmentid}.live.dynatrace.com/api/config/v1/dashboards

but this API call only returns the dashboard with all the layout of the tiles available in the given dashboard. the response doesn't have the relevant data to draw the graph or charts whatever things we need to show as the result.

so my question is how can we get each tile with its data?

1 REPLY 1

andreas_kothmei
Dynatrace Promoter
Dynatrace Promoter

Hi Thanrindu,

besides the layout, the dashboard json received from the API also contains information on how a tile gets its data. For tiles of type

  • data: The query property contains the dql query.
  • code: The input property contains the code executed on the server side.

So, for example, to fetch the data for a data tile you'll have to use the queryExecutionClient from the dynatrace-sdk. In a code tile on a dashboard it would look like this:

import { queryExecutionClient } from '@dynatrace-sdk/client-query';

export default async function () {
  // fetch the dashboard json here and assign it to a constant called "dashboard"

  // then get the query from the first tile
  const query = dashboard.tiles["1"].query;

  // and execute it via the queryExecutionClient
  const response = await queryExecutionClient.queryExecute({ body: { query } });

  return response.result;
}

 

I'm not sure if the same can be achieved for your case, but I hope this leads you in the right direction.

- Andy

Featured Posts