[APM] Set minimum bucket size to connect dots in metric chart (#34473)
This commit is contained in:
parent
47e97532ed
commit
0eff2e15f5
|
@ -56,7 +56,7 @@ Array [
|
|||
"min": 100,
|
||||
},
|
||||
"field": "@timestamp",
|
||||
"interval": "1s",
|
||||
"interval": "30s",
|
||||
"min_doc_count": 0,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -34,7 +34,7 @@ interface Aggs {
|
|||
export type ESResponse = PromiseReturnType<typeof fetch>;
|
||||
export async function fetch({ serviceName, setup }: MetricsRequestArgs) {
|
||||
const { start, end, esFilterQuery, client, config } = setup;
|
||||
const { intervalString } = getBucketSize(start, end, 'auto');
|
||||
const { bucketSize } = getBucketSize(start, end, 'auto');
|
||||
const filters: ESFilter[] = [
|
||||
{ term: { [SERVICE_NAME]: serviceName } },
|
||||
{ term: { [PROCESSOR_EVENT]: 'metric' } },
|
||||
|
@ -56,7 +56,9 @@ export async function fetch({ serviceName, setup }: MetricsRequestArgs) {
|
|||
timeseriesData: {
|
||||
date_histogram: {
|
||||
field: '@timestamp',
|
||||
interval: intervalString,
|
||||
|
||||
// ensure minimum bucket size of 30s since this is the default resolution for metric data
|
||||
interval: `${Math.max(bucketSize, 30)}s`,
|
||||
min_doc_count: 0,
|
||||
extended_bounds: { min: start, max: end }
|
||||
},
|
||||
|
|
|
@ -48,7 +48,7 @@ Array [
|
|||
"min": 100,
|
||||
},
|
||||
"field": "@timestamp",
|
||||
"interval": "1s",
|
||||
"interval": "30s",
|
||||
"min_doc_count": 0,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -30,7 +30,7 @@ interface Aggs {
|
|||
export type ESResponse = PromiseReturnType<typeof fetch>;
|
||||
export async function fetch({ serviceName, setup }: MetricsRequestArgs) {
|
||||
const { start, end, esFilterQuery, client, config } = setup;
|
||||
const { intervalString } = getBucketSize(start, end, 'auto');
|
||||
const { bucketSize } = getBucketSize(start, end, 'auto');
|
||||
const filters: ESFilter[] = [
|
||||
{ term: { [SERVICE_NAME]: serviceName } },
|
||||
{ term: { [PROCESSOR_EVENT]: 'metric' } },
|
||||
|
@ -59,7 +59,9 @@ export async function fetch({ serviceName, setup }: MetricsRequestArgs) {
|
|||
timeseriesData: {
|
||||
date_histogram: {
|
||||
field: '@timestamp',
|
||||
interval: intervalString,
|
||||
|
||||
// ensure minimum bucket size of 30s since this is the default resolution for metric data
|
||||
interval: `${Math.max(bucketSize, 30)}s`,
|
||||
min_doc_count: 0,
|
||||
extended_bounds: { min: start, max: end }
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue