|
@@ -8,6 +8,7 @@ import {t} from 'sentry/locale';
|
|
import {space} from 'sentry/styles/space';
|
|
import {space} from 'sentry/styles/space';
|
|
import {trackAnalytics} from 'sentry/utils/analytics';
|
|
import {trackAnalytics} from 'sentry/utils/analytics';
|
|
import {tooltipFormatterUsingAggregateOutputType} from 'sentry/utils/discover/charts';
|
|
import {tooltipFormatterUsingAggregateOutputType} from 'sentry/utils/discover/charts';
|
|
|
|
+import {VisuallyCompleteWithData} from 'sentry/utils/performanceForSentry';
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
import Chart from 'sentry/views/starfish/components/chart';
|
|
import Chart from 'sentry/views/starfish/components/chart';
|
|
import {
|
|
import {
|
|
@@ -78,6 +79,8 @@ export function SpanGroupBreakdown({
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const isEndpointBreakdownView = Boolean(transaction);
|
|
|
|
+
|
|
const handleModuleAreaClick = event => {
|
|
const handleModuleAreaClick = event => {
|
|
switch (event.seriesName) {
|
|
switch (event.seriesName) {
|
|
case 'http':
|
|
case 'http':
|
|
@@ -100,7 +103,7 @@ export function SpanGroupBreakdown({
|
|
<ChartPadding>
|
|
<ChartPadding>
|
|
<Header>
|
|
<Header>
|
|
<ChartLabel>
|
|
<ChartLabel>
|
|
- {transaction ? t('Endpoint Breakdown') : t('Service Breakdown')}
|
|
|
|
|
|
+ {isEndpointBreakdownView ? t('Endpoint Breakdown') : t('Service Breakdown')}
|
|
</ChartLabel>
|
|
</ChartLabel>
|
|
{hasDropdownFeatureFlag && (
|
|
{hasDropdownFeatureFlag && (
|
|
<CompactSelect
|
|
<CompactSelect
|
|
@@ -110,42 +113,48 @@ export function SpanGroupBreakdown({
|
|
/>
|
|
/>
|
|
)}
|
|
)}
|
|
</Header>
|
|
</Header>
|
|
- <Chart
|
|
|
|
- statsPeriod="24h"
|
|
|
|
- height={340}
|
|
|
|
- showLegend
|
|
|
|
- data={dataDisplayType === DataDisplayType.PERCENTAGE ? dataAsPercentages : data}
|
|
|
|
- dataMax={dataDisplayType === DataDisplayType.PERCENTAGE ? 1 : undefined}
|
|
|
|
- durationUnit={dataDisplayType === DataDisplayType.PERCENTAGE ? 0.25 : undefined}
|
|
|
|
- start=""
|
|
|
|
- end=""
|
|
|
|
- errored={errored}
|
|
|
|
- loading={isTimeseriesLoading}
|
|
|
|
- utc={false}
|
|
|
|
- onClick={handleModuleAreaClick}
|
|
|
|
- grid={{
|
|
|
|
- left: '0',
|
|
|
|
- right: '0',
|
|
|
|
- top: '20px',
|
|
|
|
- bottom: '0',
|
|
|
|
- }}
|
|
|
|
- definedAxisTicks={6}
|
|
|
|
- stacked
|
|
|
|
- aggregateOutputFormat={
|
|
|
|
- dataDisplayType === DataDisplayType.PERCENTAGE ? 'percentage' : 'duration'
|
|
|
|
- }
|
|
|
|
- tooltipFormatterOptions={{
|
|
|
|
- valueFormatter: value =>
|
|
|
|
- tooltipFormatterUsingAggregateOutputType(value, 'percentage'),
|
|
|
|
- }}
|
|
|
|
- onLegendSelectChanged={event => {
|
|
|
|
- trackAnalytics('starfish.web_service_view.breakdown.legend_change', {
|
|
|
|
- organization,
|
|
|
|
- selected: Object.keys(event.selected).filter(key => event.selected[key]),
|
|
|
|
- toggled: event.name,
|
|
|
|
- });
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
|
|
+ <VisuallyCompleteWithData id="WSV.SpanGroupBreakdown" hasData={data.length > 0}>
|
|
|
|
+ <Chart
|
|
|
|
+ statsPeriod="24h"
|
|
|
|
+ height={340}
|
|
|
|
+ showLegend
|
|
|
|
+ data={
|
|
|
|
+ dataDisplayType === DataDisplayType.PERCENTAGE ? dataAsPercentages : data
|
|
|
|
+ }
|
|
|
|
+ dataMax={dataDisplayType === DataDisplayType.PERCENTAGE ? 1 : undefined}
|
|
|
|
+ durationUnit={
|
|
|
|
+ dataDisplayType === DataDisplayType.PERCENTAGE ? 0.25 : undefined
|
|
|
|
+ }
|
|
|
|
+ start=""
|
|
|
|
+ end=""
|
|
|
|
+ errored={errored}
|
|
|
|
+ loading={isTimeseriesLoading}
|
|
|
|
+ utc={false}
|
|
|
|
+ onClick={handleModuleAreaClick}
|
|
|
|
+ grid={{
|
|
|
|
+ left: '0',
|
|
|
|
+ right: '0',
|
|
|
|
+ top: '20px',
|
|
|
|
+ bottom: '0',
|
|
|
|
+ }}
|
|
|
|
+ definedAxisTicks={6}
|
|
|
|
+ stacked
|
|
|
|
+ aggregateOutputFormat={
|
|
|
|
+ dataDisplayType === DataDisplayType.PERCENTAGE ? 'percentage' : 'duration'
|
|
|
|
+ }
|
|
|
|
+ tooltipFormatterOptions={{
|
|
|
|
+ valueFormatter: value =>
|
|
|
|
+ tooltipFormatterUsingAggregateOutputType(value, 'percentage'),
|
|
|
|
+ }}
|
|
|
|
+ onLegendSelectChanged={event => {
|
|
|
|
+ trackAnalytics('starfish.web_service_view.breakdown.legend_change', {
|
|
|
|
+ organization,
|
|
|
|
+ selected: Object.keys(event.selected).filter(key => event.selected[key]),
|
|
|
|
+ toggled: event.name,
|
|
|
|
+ });
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ </VisuallyCompleteWithData>
|
|
</ChartPadding>
|
|
</ChartPadding>
|
|
</FlexRowContainer>
|
|
</FlexRowContainer>
|
|
);
|
|
);
|