import { groupBy } from 'lodash'; import React, { useMemo } from 'react'; import { MetadataInspectorProps } from '@grafana/data'; import { CloudWatchDatasource } from '../datasource'; import { CloudWatchQuery, CloudWatchJsonData } from '../types'; export type Props = MetadataInspectorProps; export function MetaInspector({ data = [] }: Props) { const rows = useMemo(() => groupBy(data, 'refId'), [data]); return ( <> {Object.entries(rows).map(([refId, frames], idx) => { if (!frames.length) { return null; } const frame = frames[0]; const custom = frame.meta?.custom; if (!custom) { return null; } return ( ); })}
RefId Metric Data Query ID Metric Data Query Expression Period
{refId} {custom.id} {frame.meta?.executedQueryString} {custom.period}
); }