Revert "Add min time interval in opentsdb plugin (#31534)" (#32226)

This reverts commit 4a2ba2a3ab.
This commit is contained in:
Andrej Ocenas 2021-03-22 18:39:59 +01:00 committed by GitHub
parent 4c3343deea
commit f8ec947700
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 45 deletions

View File

@ -23,22 +23,6 @@ To access OpenTSDB settings, hover your mouse over the **Configuration** (gear)
| `Version` | Version = opentsdb version, either <=2.1 or 2.2 | | `Version` | Version = opentsdb version, either <=2.1 or 2.2 |
| `Resolution` | Metrics from opentsdb may have datapoints with either second or millisecond resolution. | | `Resolution` | Metrics from opentsdb may have datapoints with either second or millisecond resolution. |
| `Lookup Limit`| Default is 1000. | | `Lookup Limit`| Default is 1000. |
| `Min time interval`| A lower limit for the auto group by time interval. Recommended to be set to write frequency, for example `1m` if your data is written every minute. This option can also be overridden/configured in a dashboard panel under data source options. It's important to note that this value _must_ be formatted as a number followed by a [valid time identifier](#Supported min time identifiers), e.g. `1m` (1 minute) or `30s` (30 seconds). |
### Supported min time identifiers
The following time identifiers are supported:
| Identifier | Description |
| ---------- | ----------- |
| `y` | Years (365 days)|
| `n` | Months (30 days)|
| `w` | Weeks (7 days)|
| `d` | Days (24 hours)|
| `h` | Hours |
| `m` | Minutes |
| `s` | Seconds |
| `ms` | Milliseconds |
## Query editor ## Query editor

View File

@ -1,6 +1,6 @@
import React, { SyntheticEvent } from 'react'; import React, { SyntheticEvent } from 'react';
import { EventsWithValidation, regexValidation, InlineFormLabel, LegacyForms } from '@grafana/ui'; import { InlineFormLabel, LegacyForms } from '@grafana/ui';
const { Select, Input, FormField } = LegacyForms; const { Select, Input } = LegacyForms;
import { DataSourceSettings, SelectableValue } from '@grafana/data'; import { DataSourceSettings, SelectableValue } from '@grafana/data';
import { OpenTsdbOptions } from '../types'; import { OpenTsdbOptions } from '../types';
@ -53,30 +53,6 @@ export const OpenTsdbDetails = (props: Props) => {
onChange={onInputChangeHandler('lookupLimit', value, onChange)} onChange={onInputChangeHandler('lookupLimit', value, onChange)}
/> />
</div> </div>
<div className="gf-form-inline">
<div className="gf-form">
<FormField
labelWidth={7}
label="Min time interval"
inputEl={
<Input
className={'width-6'}
value={value.jsonData.interval || ''}
onChange={onInputChangeHandler('interval', value, onChange)}
placeholder="1m"
validationEvents={{
[EventsWithValidation.onBlur]: [
regexValidation(
/^\d+(ms|[Mwdhmsy])$/,
'Value is not valid, you can use number with time unit specifier: y, M, w, d, h, m, s'
),
],
}}
/>
}
/>
</div>
</div>
</> </>
); );
}; };

View File

@ -24,7 +24,6 @@ export default class OpenTsDatasource extends DataSourceApi<OpenTsdbQuery, OpenT
tsdbVersion: any; tsdbVersion: any;
tsdbResolution: any; tsdbResolution: any;
lookupLimit: any; lookupLimit: any;
interval: any;
tagKeys: any; tagKeys: any;
aggregatorsPromise: any; aggregatorsPromise: any;
@ -41,7 +40,6 @@ export default class OpenTsDatasource extends DataSourceApi<OpenTsdbQuery, OpenT
this.tsdbVersion = instanceSettings.jsonData.tsdbVersion || 1; this.tsdbVersion = instanceSettings.jsonData.tsdbVersion || 1;
this.tsdbResolution = instanceSettings.jsonData.tsdbResolution || 1; this.tsdbResolution = instanceSettings.jsonData.tsdbResolution || 1;
this.lookupLimit = instanceSettings.jsonData.lookupLimit || 1000; this.lookupLimit = instanceSettings.jsonData.lookupLimit || 1000;
this.interval = instanceSettings.jsonData.interval || '30s';
this.tagKeys = {}; this.tagKeys = {};
this.aggregatorsPromise = null; this.aggregatorsPromise = null;

View File

@ -8,5 +8,4 @@ export interface OpenTsdbOptions extends DataSourceJsonData {
tsdbVersion: number; tsdbVersion: number;
tsdbResolution: number; tsdbResolution: number;
lookupLimit: number; lookupLimit: number;
interval: string;
} }