Skip to content

Commit

Permalink
parse date on auto ops
Browse files Browse the repository at this point in the history
  • Loading branch information
ashokaditya committed Nov 26, 2024
1 parent a6fdfa5 commit 9e4cd42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x-pack/plugins/data_usage/server/services/autoops_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Logger } from '@kbn/logging';
import type { AxiosError, AxiosRequestConfig } from 'axios';
import axios from 'axios';
import { LogMeta } from '@kbn/core/server';
import { momentDateParser } from '../../common/utils';
import {
UsageMetricsAutoOpsResponseSchema,
type UsageMetricsAutoOpsResponseSchemaBody,
Expand Down Expand Up @@ -75,8 +76,8 @@ export class AutoOpsAPIService {
const requestConfig: AxiosRequestConfig = {
url: getAutoOpsAPIRequestUrl(autoopsConfig.api?.url, cloudSetup?.serverless.projectId),
data: {
from: requestBody.from,
to: requestBody.to,
from: momentDateParser(requestBody.from)?.toISOString(),
to: momentDateParser(requestBody.to)?.toISOString(),
size: requestBody.dataStreams.length,
level: 'datastream',
metric_types: requestBody.metricTypes,
Expand Down

0 comments on commit 9e4cd42

Please sign in to comment.