Skip to content

Commit

Permalink
Set useEcs to true in SLO burn rate rule (#194322)
Browse files Browse the repository at this point in the history
## Summary

This PR sets useEcs to true in the SLO burn rate rule. (more info
[here](https://docs.google.com/document/d/1mhWcMR3aIp3z4SmPywpW89RG4hHiBAjYCQIQBDUYNj0/edit?usp=sharing))
  • Loading branch information
maryam-saeidi authored Oct 1, 2024
1 parent af1dc87 commit 67f3043
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import * as rt from 'io-ts';
import { Either } from 'fp-ts/lib/Either';
import { AlertSchema } from './alert_schema';
import { EcsSchema } from './ecs_schema';
import { LegacyAlertSchema } from './legacy_alert_schema';
const ISO_DATE_PATTERN = /^d{4}-d{2}-d{2}Td{2}:d{2}:d{2}.d{3}Z$/;
export const IsoDateString = new rt.Type<string, string, unknown>(
Expand Down Expand Up @@ -88,6 +89,6 @@ const ObservabilitySloAlertOptional = rt.partial({
});

// prettier-ignore
export const ObservabilitySloAlertSchema = rt.intersection([ObservabilitySloAlertRequired, ObservabilitySloAlertOptional, AlertSchema, LegacyAlertSchema]);
export const ObservabilitySloAlertSchema = rt.intersection([ObservabilitySloAlertRequired, ObservabilitySloAlertOptional, AlertSchema, EcsSchema, LegacyAlertSchema]);
// prettier-ignore
export type ObservabilitySloAlert = rt.TypeOf<typeof ObservabilitySloAlertSchema>;
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function sloBurnRateRuleType(
alerts: {
context: SLO_RULE_REGISTRATION_CONTEXT,
mappings: { fieldMap: { ...legacyExperimentalFieldMap, ...sloRuleFieldMap } },
useEcs: false,
useEcs: true,
useLegacyAlerts: true,
shouldWrite: true,
},
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/api_integration/apis/maps/maps_telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export default function ({ getService }: FtrProviderContext) {
return fieldStat.name === 'geo_point';
}
);
expect(geoPointFieldStats.count).to.be(47);
expect(geoPointFieldStats.index_count).to.be(11);
expect(geoPointFieldStats.count).to.be(55);
expect(geoPointFieldStats.index_count).to.be(12);

const geoShapeFieldStats = apiResponse.cluster_stats.indices.mappings.field_types.find(
(fieldStat: estypes.ClusterStatsFieldTypes) => {
Expand Down

0 comments on commit 67f3043

Please sign in to comment.