Skip to content

Commit

Permalink
Merge branch 'v3' into PMM-13166_nodes_monitor_db
Browse files Browse the repository at this point in the history
  • Loading branch information
doracretu3pillar authored Sep 30, 2024
2 parents 09097c3 + 89a0db3 commit 4bd8d20
Show file tree
Hide file tree
Showing 32 changed files with 53 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options {
limit: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options extends common.OptionsWithLegend, common.OptionsWithTooltip, common.OptionsWithTextFormatting {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options extends common.SingleStatBaseOptions {
displayMode: common.BarGaugeDisplayMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export enum VizDisplayMode {
Candles = 'candles',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as ui from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export enum HorizontalConstraint {
Center = 'center',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface MetricStat {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options {
selectedSeries: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export type UpdateConfig = {
render: boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export type BucketAggregation = (DateHistogram | Histogram | Terms | Filters | GeoHashGrid | Nested);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options extends common.SingleStatBaseOptions {
minVizHeight: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as ui from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options {
basemap: ui.MapLayerOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as ui from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

/**
* Controls the color mode of the heatmap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options extends common.OptionsWithLegend, common.OptionsWithTooltip {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options {
dedupStrategy: common.LogsDedupStrategy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export enum QueryEditorMode {
Builder = 'builder',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface ArcOption {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

/**
* Select the pie chart display style.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options extends common.SingleStatBaseOptions {
colorMode: common.BigValueColorMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as ui from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options extends ui.OptionsWithLegend, ui.OptionsWithTooltip, ui.OptionsWithTimezones {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as ui from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options extends ui.OptionsWithLegend, ui.OptionsWithTooltip, ui.OptionsWithTimezones {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as ui from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export enum TextMode {
Code = 'code',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

export interface Options extends common.OptionsWithTimezones {
legend: common.VizLegendOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

/**
* Identical to timeseries... except it does not have timezone settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import * as common from '@grafana/schema';

export const pluginVersion = "";
export const pluginVersion = "11.1.5";

/**
* Auto is "table" in the UI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ export interface TemplatesList extends Omit<TemplatesListAPI, 'templates'> {
}

export enum SourceDescription {
BUILT_IN = 'BUILT_IN',
SAAS = 'SAAS',
USER_FILE = 'USER_FILE',
USER_API = 'USER_API',
BUILT_IN = 'TEMPLATE_SOURCE_BUILT_IN',
SAAS = 'TEMPLATE_SOURCE_SAAS',
USER_FILE = 'TEMPLATE_SOURCE_USER_FILE',
USER_API = 'TEMPLATE_SOURCE_USER_API',
}

// https://github.com/percona-platform/saas/blob/main/pkg/alert/type.go
// https://github.com/percona/saas/blob/main/pkg/alert/type.go
export enum TemplateParamType {
FLOAT = 'FLOAT',
BOOL = 'BOOL',
STRING = 'STRING',
FLOAT = 'PARAM_TYPE_FLOAT',
BOOL = 'PARAM_TYPE_BOOL',
STRING = 'PARAM_TYPE_STRING',
}

// https://github.com/percona-platform/saas/blob/main/pkg/alert/unit.go
// https://github.com/percona/saas/blob/main/pkg/alert/unit.go
export enum TemplateParamUnit {
PERCENTAGE = 'PERCENTAGE',
SECONDS = 'SECONDS',
PERCENTAGE = 'PARAM_UNIT_PERCENTAGE',
SECONDS = 'PARAM_UNIT_SECONDS',
}

export interface TemplateFloatParamAPI {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('AlertRuleTemplatesTable utils', () => {
});

test('formatSource', () => {
expect(formatSource(SourceDescription.BUILT_IN)).toBe(SOURCE_MAP.BUILT_IN);
expect(formatSource(SourceDescription.SAAS)).toBe(SOURCE_MAP.SAAS);
expect(formatSource(SourceDescription.BUILT_IN)).toBe(SOURCE_MAP.TEMPLATE_SOURCE_BUILT_IN);
expect(formatSource(SourceDescription.SAAS)).toBe(SOURCE_MAP.TEMPLATE_SOURCE_SAAS);
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { SelectableValue } from '@grafana/data';
import { Severity } from 'app/percona/shared/core';

import { TemplateParamType } from '../AlertRuleTemplate/AlertRuleTemplate.types';

// TODO: generate SEVERITY_OPTIONS from its type definitions
export const SEVERITY_OPTIONS: Array<SelectableValue<keyof typeof Severity>> = [
{
Expand Down Expand Up @@ -40,3 +42,9 @@ export const SEVERITY_OPTIONS: Array<SelectableValue<keyof typeof Severity>> = [
// We define our default evaluation interval as 60s
// 'for' can't be less than that, hence this minimum
export const MINIMUM_DURATION_VALUE = 60;

export const TYPE_TO_KEY_MAP: Record<TemplateParamType, 'bool' | 'float' | 'string'> = {
PARAM_TYPE_BOOL: 'bool',
PARAM_TYPE_FLOAT: 'float',
PARAM_TYPE_STRING: 'string',
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { AlertRuleCreatePayload, AlertRulesListResponseChannel, Severity } from

import { TemplatedAlertFormValues } from '../../types';

import { TYPE_TO_KEY_MAP } from './TemplateForm.constants';

export const formatChannelsOptions = (channels: string[]): Array<SelectableValue<string>> =>
channels
? channels.map((channel) => ({
Expand Down Expand Up @@ -48,7 +50,7 @@ export const formatCreateAPIPayload = (data: TemplatedAlertFormValues): AlertRul
payload.params?.push({
name,
type,
[type.toLowerCase()]: value,
[TYPE_TO_KEY_MAP[type]]: value,
});
}
});
Expand Down
3 changes: 2 additions & 1 deletion public/app/percona/shared/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export enum Severity {
import {
TemplateAnnotation,
TemplateParam,
TemplateParamType,
} from 'app/percona/integrated-alerting/components/AlertRuleTemplate/AlertRuleTemplate.types';

export enum AlertRuleParamType {
Expand Down Expand Up @@ -159,7 +160,7 @@ export interface AlertRulesListPayloadFilter {

export interface AlertRulesListResponseParam {
name: string;
type: keyof typeof AlertRuleParamType;
type: TemplateParamType;
[AlertRuleParamType.BOOL]?: boolean;
[AlertRuleParamType.FLOAT]?: number;
[AlertRuleParamType.STRING]?: string;
Expand Down

0 comments on commit 4bd8d20

Please sign in to comment.