mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alertmanager: Adding SigV4 Authentication to Alertmanager Datasource (#49718)
* adding sigv4 alertmanager * adding sigv4 alertmanager * ConfigEditor: Adding Render Prop
This commit is contained in:
@@ -565,7 +565,7 @@ func awsServiceNamespace(dsType string) string {
|
|||||||
switch dsType {
|
switch dsType {
|
||||||
case models.DS_ES, models.DS_ES_OPEN_DISTRO, models.DS_ES_OPENSEARCH:
|
case models.DS_ES, models.DS_ES_OPEN_DISTRO, models.DS_ES_OPENSEARCH:
|
||||||
return "es"
|
return "es"
|
||||||
case models.DS_PROMETHEUS:
|
case models.DS_PROMETHEUS, models.DS_ALERTMANAGER:
|
||||||
return "aps"
|
return "aps"
|
||||||
default:
|
default:
|
||||||
panic(fmt.Sprintf("Unsupported datasource %q", dsType))
|
panic(fmt.Sprintf("Unsupported datasource %q", dsType))
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { SIGV4ConnectionConfig } from '@grafana/aws-sdk';
|
||||||
import { DataSourcePluginOptionsEditorProps, SelectableValue } from '@grafana/data';
|
import { DataSourcePluginOptionsEditorProps, SelectableValue } from '@grafana/data';
|
||||||
import { DataSourceHttpSettings, InlineFormLabel, Select } from '@grafana/ui';
|
import { DataSourceHttpSettings, InlineFormLabel, Select } from '@grafana/ui';
|
||||||
|
import { config } from 'app/core/config';
|
||||||
|
|
||||||
import { AlertManagerDataSourceJsonData, AlertManagerImplementation } from './types';
|
import { AlertManagerDataSourceJsonData, AlertManagerImplementation } from './types';
|
||||||
|
|
||||||
@@ -21,7 +23,9 @@ const IMPL_OPTIONS: SelectableValue[] = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ConfigEditor: React.FC<Props> = ({ options, onOptionsChange }) => {
|
export const ConfigEditor = (props: Props) => {
|
||||||
|
const { options, onOptionsChange } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<h3 className="page-heading">Alertmanager</h3>
|
<h3 className="page-heading">Alertmanager</h3>
|
||||||
@@ -51,6 +55,8 @@ export const ConfigEditor: React.FC<Props> = ({ options, onOptionsChange }) => {
|
|||||||
dataSourceConfig={options}
|
dataSourceConfig={options}
|
||||||
showAccessOptions={true}
|
showAccessOptions={true}
|
||||||
onChange={onOptionsChange}
|
onChange={onOptionsChange}
|
||||||
|
sigV4AuthToggleEnabled={config.sigV4AuthEnabled}
|
||||||
|
renderSigV4Editor={<SIGV4ConnectionConfig {...props}></SIGV4ConnectionConfig>}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user