Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion docs/settings-gen/source/kibana-alert-action-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ groups:
* {applies_to}`stack: ga 9.2` Defaults to `us.anthropic.claude-sonnet-4-5-20250929-v1:0`.
* {applies_to}`stack: ga 9.1` Defaults to `us.anthropic.claude-3-7-sonnet-20250219-v1:0`.
* {applies_to}`stack: ga 9.0` Defaults to `anthropic.claude-3-5-sonnet-20240620-v1:0`.
* For a [{{gemini}} connector](/reference/connectors-kibana/gemini-action-type.md), current support is for the Gemini models.
* For a [{{gemini}} connector](/reference/connectors-kibana/gemini-action-type.md), current support is for the Gemini models.
* {applies_to}`serverless: ga` Defaults to `gemini-2.5-pro`.
* {applies_to}`stack: ga 9.1` Defaults to `gemini-2.5-pro`.
* {applies_to}`stack: ga 9.0` Defaults to `gemini-1.5-pro-002`.
Expand Down Expand Up @@ -2601,3 +2601,25 @@ groups:
- id: '.server-log'
max: 5
```

- setting: xpack.alerting.rules.apiKeyType
description: |
The API key type to use for execting alerting rules. The default value, corresponding to the existing behavior, is `es`, which uses an ElasticSearch API key.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The API key type to use for execting alerting rules. The default value, corresponding to the existing behavior, is `es`, which uses an ElasticSearch API key.
The API key type to use for executing alerting rules. The default value, corresponding to the existing behavior, is `es`, which uses an Elasticsearch API key.

The 'uiam' value will be used for the migration to the new UIAM API keys.
Comment thread
darnautov marked this conversation as resolved.
Outdated
datatype: string
default: es
options:
- option: es
description: ElasticSearch api key
Comment thread
umbopepato marked this conversation as resolved.
Outdated
- option: uiam
description: UIAM api key
applies_to:
deployment:
self: all
ess: all
Comment thread
darnautov marked this conversation as resolved.
example: |
For example:

```yaml
xpack.alerting.rules.apiKeyType: uiam
```
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('config validation', () => {
"removalDelay": "1h",
},
"rules": Object {
"apiKeyType": "es",
"maxScheduledPerMinute": 32000,
"minimumScheduleInterval": Object {
"enforce": false,
Expand Down
3 changes: 3 additions & 0 deletions x-pack/platform/plugins/shared/alerting/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ const rulesSchema = schema.object({
}),
ruleTypeOverrides: schema.maybe(schema.arrayOf(ruleTypeSchema)),
}),
apiKeyType: schema.oneOf([schema.literal('es'), schema.literal('uiam')], {
defaultValue: 'es',
}),
});

export const configSchema = schema.object({
Expand Down
1 change: 1 addition & 0 deletions x-pack/platform/plugins/shared/alerting/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ export class AlertingPlugin {
usageCounter: this.usageCounter,
getEventLogClient: (request: KibanaRequest) => plugins.eventLog.getClient(request),
isServerless: this.isServerless,
apiKeyType: this.config.rules.apiKeyType ?? 'es',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum could be used here too. ApiKeyTypes.ES

});

this.eventLogService!.registerSavedObjectProvider(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ describe('createRuleRoute', () => {
max: 1000,
},
},
apiKeyType: 'es',
},
rulesSettings: {
enabled: true,
Expand All @@ -68,7 +69,7 @@ describe('createRuleRoute', () => {
maintenanceWindow: {
enabled: true,
},
};
} as const;
const action: RuleAction = {
actionTypeId: 'test',
group: 'default',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ const taskRunnerFactoryInitializerParams: TaskRunnerFactoryInitializerParamsType
usageCounter: mockUsageCounter,
isServerless: false,
getEventLogClient: jest.fn(),
apiKeyType: 'es',
};

const mockedTaskInstance: ConcreteTaskInstance = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ describe('Task Runner', () => {
usageCounter: mockUsageCounter,
isServerless: false,
getEventLogClient: jest.fn().mockReturnValue(eventLogClientMock.create()),
apiKeyType: 'es',
};

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ describe('Task Runner', () => {
usageCounter: mockUsageCounter,
isServerless: false,
getEventLogClient: jest.fn().mockReturnValue(eventLogClientMock.create()),
apiKeyType: 'es',
};

describe(`using ${label} for alert indices`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ describe('Task Runner Cancel', () => {
usageCounter: mockUsageCounter,
isServerless: false,
getEventLogClient: jest.fn().mockReturnValue(eventLogClientMock.create()),
apiKeyType: 'es',
};

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ describe('Task Runner Factory', () => {
usageCounter: mockUsageCounter,
isServerless: false,
getEventLogClient: jest.fn().mockReturnValue(eventLogClientMock.create()),
apiKeyType: 'es',
};

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export interface TaskRunnerContext {
maxAlerts: number;
ruleTypeRegistry: RuleTypeRegistry;
rulesSettingsService: RulesSettingsService;
apiKeyType: 'es' | 'uiam';

@ersin-erdal ersin-erdal Feb 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we create an enum in the types files and use it where ever we use these strings?

export enum ApiKeyTypes {
  ES = 'es',
  UIAM = 'uiam',
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely!

savedObjects: SavedObjectsServiceStart;
share: SharePluginStart;
spaceIdToNamespace: SpaceIdToNamespaceFunction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export function generateAlertingConfig(overwrites: Partial<AlertingConfig> = {})
max: 1000,
},
},
apiKeyType: 'es',
},
rulesSettings: { enabled: true, cacheInterval: 60000 },
...overwrites,
Expand Down
Loading