The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/plugins/datasource/opentsdb/migrations.ts

23 lines
641 B

import { LegacyAnnotation } from './types';
// this becomes the target in the migrated annotations
const migrateLegacyAnnotation = (json: LegacyAnnotation) => {
// return the target annotation
const annotation: LegacyAnnotation = {
fromAnnotations: true,
target: json.target ?? '',
name: json.name ?? '',
isGlobal: json.isGlobal ?? false,
};
return annotation;
};
// eslint-ignore-next-line
export const prepareAnnotation = (json: any) => {
const resultingTarget = json.target && typeof json.target !== 'string' ? json.target : migrateLegacyAnnotation(json);
json.target = resultingTarget;
return json;
};