Skip to content

Commit

Permalink
[Infra] Remove indexFields from /api/metrics/source endpoint (#18…
Browse files Browse the repository at this point in the history
…9541)

## Summary

This PR removes `indexFields` from `/api/metrics/source endpoint`


![image](https://github.com/user-attachments/assets/496710da-55b8-4ec4-aadc-7bab794a8cfb)

## Testing

Check all infra pages (try creating an alert, open a host as page, etc.)
it should work as before
  • Loading branch information
jennypavlova authored Jul 31, 2024
1 parent b009ea0 commit 1144647
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const metricsSourceConfigurationOriginRT = rt.keyof({
export const metricsSourceStatusRT = rt.strict({
metricIndicesExist: SourceStatusRuntimeType.props.metricIndicesExist,
remoteClustersExist: SourceStatusRuntimeType.props.metricIndicesExist,
indexFields: SourceStatusRuntimeType.props.indexFields,
});

export type MetricsSourceStatus = rt.TypeOf<typeof metricsSourceStatusRT>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ export const SourceStatusRuntimeType = rt.type({
logIndicesExist: rt.boolean,
metricIndicesExist: rt.boolean,
remoteClustersExist: rt.boolean,
indexFields: rt.array(SourceStatusFieldRuntimeType),
});

export interface InfraSourceStatus extends rt.TypeOf<typeof SourceStatusRuntimeType> {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { InfraPluginRequestHandlerContext } from '../../types';
import { getInfraMetricsClient } from '../../lib/helpers/get_infra_metrics_client';

const defaultStatus = {
indexFields: [],
metricIndicesExist: false,
remoteClustersExist: false,
};
Expand All @@ -51,9 +50,6 @@ export const initMetricsSourceConfigurationRoutes = (libs: InfraBackendLibs) =>
/**
* Extract values from promises settlements
*/
const indexFields = isFulfilled<InfraSourceIndexField[]>(indexFieldsSettled)
? indexFieldsSettled.value
: defaultStatus.indexFields;
const metricIndicesExist = isFulfilled<boolean>(metricIndicesExistSettled)
? metricIndicesExistSettled.value
: defaultStatus.metricIndicesExist;
Expand All @@ -73,7 +69,6 @@ export const initMetricsSourceConfigurationRoutes = (libs: InfraBackendLibs) =>
}

return {
indexFields,
metricIndicesExist,
remoteClustersExist,
};
Expand Down

0 comments on commit 1144647

Please sign in to comment.