[APM] Set minimum bucket size to connect dots in metric chart (#34473) (#34773)

This commit is contained in:
Søren Louv-Jansen 2019-04-09 11:02:38 +02:00 committed by GitHub
parent 0fe636cddf
commit 8a333d2ee6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 6 deletions

View file

@ -56,7 +56,7 @@ Array [
"min": 100,
},
"field": "@timestamp",
"interval": "1s",
"interval": "30s",
"min_doc_count": 0,
},
},

View file

@ -37,7 +37,7 @@ export async function fetch({
setup
}: MetricsRequestArgs): Promise<ESResponse> {
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_NAME]: 'metric' } },
@ -59,7 +59,9 @@ export async function fetch({
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 }
},

View file

@ -48,7 +48,7 @@ Array [
"min": 100,
},
"field": "@timestamp",
"interval": "1s",
"interval": "30s",
"min_doc_count": 0,
},
},

View file

@ -33,7 +33,7 @@ export async function fetch({
setup
}: MetricsRequestArgs): Promise<ESResponse> {
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_NAME]: 'metric' } },
@ -62,7 +62,9 @@ export async function fetch({
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 }
},