import React, { SyntheticEvent } from 'react'; import { DataSourcePluginOptionsEditorProps, onUpdateDatasourceJsonDataOptionChecked, SelectableValue, updateDatasourcePluginJsonDataOption, } from '@grafana/data'; import { InlineField, InlineSwitch, EventsWithValidation, InlineFormLabel, LegacyForms, regexValidation, } from '@grafana/ui'; import { PromOptions } from '../types'; import { ExemplarsSettings } from './ExemplarsSettings'; const { Select, Input, FormField } = LegacyForms; const httpOptions = [ { value: 'POST', label: 'POST' }, { value: 'GET', label: 'GET' }, ]; type Props = Pick, 'options' | 'onOptionsChange'>; export const PromSettings = (props: Props) => { const { options, onOptionsChange } = props; // We are explicitly adding httpMethod so it is correctly displayed in dropdown. This way, it is more predictable for users. if (!options.jsonData.httpMethod) { options.jsonData.httpMethod = 'POST'; } return ( <>
} tooltip="Set this to the typical scrape and evaluation interval configured in Prometheus. Defaults to 15s." />
} tooltip="Set the Prometheus query timeout." />
HTTP Method