From c3d9c251a44e6b73c0bc1ac6903c814b42d6c026 Mon Sep 17 00:00:00 2001 From: Aaron Steinfeld Date: Mon, 22 Nov 2021 10:37:35 -0500 Subject: [PATCH] feat: change default visualization for spans to count --- .../explore-query-editor/explore-visualization-builder.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/observability/src/shared/components/explore-query-editor/explore-visualization-builder.ts b/projects/observability/src/shared/components/explore-query-editor/explore-visualization-builder.ts index d1e9ff789..ccddaba83 100644 --- a/projects/observability/src/shared/components/explore-query-editor/explore-visualization-builder.ts +++ b/projects/observability/src/shared/components/explore-query-editor/explore-visualization-builder.ts @@ -149,7 +149,7 @@ export class ExploreVisualizationBuilder implements OnDestroy { defaultIfEmpty([]), map(attributes => attributes - .filter(attribute => !attribute.onlySupportsAggregation) + .filter(attribute => !attribute.onlySupportsGrouping) .map(attribute => this.specBuilder.attributeSpecificationForKey(attribute.name)) ), map(specsFromRequest => uniqBy(specsFromRequest, spec => spec.name)) @@ -205,11 +205,10 @@ export class ExploreVisualizationBuilder implements OnDestroy { } private buildDefaultSeries(context: string): ExploreSeries { - const attributeKey = context === SPAN_SCOPE ? 'duration' : 'calls'; // Todo revisit this - const aggregation = context === SPAN_SCOPE ? MetricAggregationType.Average : MetricAggregationType.Count; + const attributeKey = context === SPAN_SCOPE ? 'spans' : 'calls'; return { - specification: this.exploreSpecBuilder.exploreSpecificationForKey(attributeKey, aggregation), + specification: this.exploreSpecBuilder.exploreSpecificationForKey(attributeKey, MetricAggregationType.Count), visualizationOptions: { type: CartesianSeriesVisualizationType.Column }