diff --git a/public/app/plugins/datasource/stackdriver/constants.ts b/public/app/plugins/datasource/stackdriver/constants.ts index 3846bfc68a1..eb808d48408 100644 --- a/public/app/plugins/datasource/stackdriver/constants.ts +++ b/public/app/plugins/datasource/stackdriver/constants.ts @@ -33,3 +33,15 @@ export const aggOptions = [ { text: '50th percentile', value: 'REDUCE_PERCENTILE_50' }, { text: '5th percentile', value: 'REDUCE_PERCENTILE_05' }, ]; + +export const alignmentPeriods = [ + { text: 'auto', value: 'auto' }, + { text: '1m', value: '+60s' }, + { text: '5m', value: '+300s' }, + { text: '30m', value: '+1800s' }, + { text: '1h', value: '+3600s' }, + { text: '6h', value: '+21600s' }, + { text: '1d', value: '+86400s' }, + { text: '1w', value: '+604800s' }, + { text: '1m', value: '+18748800s' }, +]; diff --git a/public/app/plugins/datasource/stackdriver/datasource.ts b/public/app/plugins/datasource/stackdriver/datasource.ts index 9c1706095bf..fb78f1fb559 100644 --- a/public/app/plugins/datasource/stackdriver/datasource.ts +++ b/public/app/plugins/datasource/stackdriver/datasource.ts @@ -31,6 +31,7 @@ export default class StackdriverDatasource { primaryAggregation: t.aggregation.crossSeriesReducer, secondaryAggregation: t.aggregation.secondaryCrossSeriesReducer, perSeriesAligner: t.aggregation.perSeriesAligner, + alignmentPeriod: t.aggregation.alignmentPeriod, groupBys: t.aggregation.groupBys, view: t.view || 'FULL', filters: t.filters, diff --git a/public/app/plugins/datasource/stackdriver/partials/query.editor.html b/public/app/plugins/datasource/stackdriver/partials/query.editor.html index 23a7493c7b7..42b93c1826e 100755 --- a/public/app/plugins/datasource/stackdriver/partials/query.editor.html +++ b/public/app/plugins/datasource/stackdriver/partials/query.editor.html @@ -53,16 +53,21 @@