Azure: Split insights into two services (#25410)
Azure Application Insights Analytics is no longer accessed by the edit button from within the Application Insights service. Instead, there is now an Insights Analytics option in the Service drop down. Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
co-authored by
Ryan McKinley
parent
af0c73720e
commit
bc9c53389c
@@ -68,7 +68,9 @@ function convertTimeSeriesToDataFrame(timeSeries: TimeSeries): DataFrame {
|
||||
const times: number[] = [];
|
||||
const values: TimeSeriesValue[] = [];
|
||||
|
||||
for (const point of timeSeries.datapoints) {
|
||||
// Sometimes the points are sent as datapoints
|
||||
const points = timeSeries.datapoints || (timeSeries as any).points;
|
||||
for (const point of points) {
|
||||
values.push(point[0]);
|
||||
times.push(point[1] as number);
|
||||
}
|
||||
@@ -96,7 +98,7 @@ function convertTimeSeriesToDataFrame(timeSeries: TimeSeries): DataFrame {
|
||||
}
|
||||
|
||||
return {
|
||||
name: timeSeries.target,
|
||||
name: timeSeries.target || (timeSeries as any).name,
|
||||
refId: timeSeries.refId,
|
||||
meta: timeSeries.meta,
|
||||
fields,
|
||||
@@ -293,7 +295,7 @@ export function toDataFrame(data: any): DataFrame {
|
||||
return convertJSONDocumentDataToDataFrame(data);
|
||||
}
|
||||
|
||||
if (data.hasOwnProperty('datapoints')) {
|
||||
if (data.hasOwnProperty('datapoints') || data.hasOwnProperty('points')) {
|
||||
return convertTimeSeriesToDataFrame(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,14 +5,17 @@ import {
|
||||
KeyValue,
|
||||
LoadingState,
|
||||
DataQueryError,
|
||||
TimeSeries,
|
||||
TableData,
|
||||
toDataFrame,
|
||||
} from '@grafana/data';
|
||||
|
||||
interface DataResponse {
|
||||
error?: string;
|
||||
refId?: string;
|
||||
dataframes?: string[];
|
||||
// series: null,
|
||||
// tables: null,
|
||||
series?: TimeSeries[];
|
||||
tables?: TableData[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,6 +38,24 @@ export function toDataQueryResponse(res: any): DataQueryResponse {
|
||||
}
|
||||
}
|
||||
|
||||
if (dr.series && dr.series.length) {
|
||||
for (const s of dr.series) {
|
||||
if (!s.refId) {
|
||||
s.refId = refId;
|
||||
}
|
||||
rsp.data.push(toDataFrame(s));
|
||||
}
|
||||
}
|
||||
|
||||
if (dr.tables && dr.tables.length) {
|
||||
for (const s of dr.tables) {
|
||||
if (!s.refId) {
|
||||
s.refId = refId;
|
||||
}
|
||||
rsp.data.push(toDataFrame(s));
|
||||
}
|
||||
}
|
||||
|
||||
if (dr.dataframes) {
|
||||
for (const b64 of dr.dataframes) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user