Browse Source

fix, assign by event.time

Mitsuhiro Tanda 6 years ago
parent
commit
38457fabc1
1 changed files with 3 additions and 3 deletions
  1. 3 3
      public/app/plugins/datasource/prometheus/datasource.ts

+ 3 - 3
public/app/plugins/datasource/prometheus/datasource.ts

@@ -358,7 +358,7 @@ export class PrometheusDatasource implements DataSourceApi<PromQuery> {
         for (const value of series.values) {
         for (const value of series.values) {
           const valueIsTrue = value[1] === '1'; // e.g. ALERTS
           const valueIsTrue = value[1] === '1'; // e.g. ALERTS
           if (valueIsTrue || annotation.useValueForTime) {
           if (valueIsTrue || annotation.useValueForTime) {
-            const event = {
+            const event: any = {
               annotation: annotation,
               annotation: annotation,
               title: self.resultTransformer.renderTemplate(titleFormat, series.metric),
               title: self.resultTransformer.renderTemplate(titleFormat, series.metric),
               tags: tags,
               tags: tags,
@@ -371,9 +371,9 @@ export class PrometheusDatasource implements DataSourceApi<PromQuery> {
                 continue;
                 continue;
               }
               }
               dupCheck[timestampValue] = true;
               dupCheck[timestampValue] = true;
-              event['time'] = timestampValue;
+              event.time = timestampValue;
             } else {
             } else {
-              event['time'] = Math.floor(parseFloat(value[0])) * 1000;
+              event.time = Math.floor(parseFloat(value[0])) * 1000;
             }
             }
 
 
             eventList.push(event);
             eventList.push(event);