Reference documentation and code samples for the Google Cloud Monitoring v3 API class Aggregation.
Describes how to combine multiple time series to provide a different view of
the data. Aggregation of time series is done in two steps. First, each time
series in the set is aligned to the same time interval boundaries, then the
set of time series is optionally reduced in number.
Alignment consists of applying the per_series_aligner operation
to each time series after its data has been divided into regular
alignment_period time intervals. This process takes all of the data
points in an alignment period, applies a mathematical transformation such as
averaging, minimum, maximum, delta, etc., and converts them into a single
data point per period.
Reduction is when the aligned and transformed time series can optionally be
combined, reducing the number of time series through similar mathematical
transformations. Reduction involves applying a cross_series_reducer to
all the time series, optionally sorting the time series into subsets with
group_by_fields, and applying the reducer to each subset.
The raw time series data can contain a huge amount of information from
multiple sources. Alignment and reduction transforms this mass of data into
a more manageable and representative collection of data, for example "the
95% latency across the average of all tasks in a cluster". This
representative data can be more easily graphed and comprehended, and the
individual time series data is still available for later drilldown. For more
details, see Filtering and
aggregation.
The alignment_period specifies a time interval, in seconds, that is used
to divide the data in all the
[time series][google.monitoring.v3.TimeSeries] into consistent blocks of
time. This will be done before the per-series aligner can be applied to
the data.
The value must be at least 60 seconds. If a per-series
aligner other than ALIGN_NONE is specified, this field is required or an
error is returned. If no per-series aligner is specified, or the aligner
ALIGN_NONE is specified, then this field is ignored.
The maximum value of the alignment_period is 104 weeks (2 years) for
charts, and 90,000 seconds (25 hours) for alerting policies.
The reduction operation to be used to combine time series into a single
time series, where the value of each data point in the resulting series is
a function of all the already aligned values in the input time series.
Not all reducer operations can be applied to all time series. The valid
choices depend on the metric_kind and the value_type of the original
time series. Reduction can yield a time series with a different
metric_kind or value_type than the input time series.
Time series data must first be aligned (see per_series_aligner) in order
to perform cross-time series reduction. If cross_series_reducer is
specified, then per_series_aligner must be specified, and must not be
ALIGN_NONE. An alignment_period must also be specified; otherwise, an
error is returned.
public RepeatedField<string> GroupByFields { get; }
The set of fields to preserve when cross_series_reducer is
specified. The group_by_fields determine how the time series are
partitioned into subsets prior to applying the aggregation
operation. Each subset contains time series that have the same
value for each of the grouping fields. Each individual time
series is a member of exactly one subset. The
cross_series_reducer is applied to each subset of time series.
It is not possible to reduce across different resource types, so
this field implicitly contains resource.type. Fields not
specified in group_by_fields are aggregated away. If
group_by_fields is not specified and all the time series have
the same resource type, then the time series are aggregated into
a single output time series. If cross_series_reducer is not
defined, this field is ignored.
An Aligner describes how to bring the data points in a single
time series into temporal alignment. Except for ALIGN_NONE, all
alignments cause all the data points in an alignment_period to be
mathematically grouped together, resulting in a single data point for
each alignment_period with end timestamp at the end of the period.
Not all alignment operations may be applied to all time series. The valid
choices depend on the metric_kind and value_type of the original time
series. Alignment can change the metric_kind or the value_type of
the time series.
Time series data must be aligned in order to perform cross-time
series reduction. If cross_series_reducer is specified, then
per_series_aligner must be specified and not equal to ALIGN_NONE
and alignment_period must be specified; otherwise, an error is
returned.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis page provides reference documentation for the \u003ccode\u003eAggregation\u003c/code\u003e class within the Google Cloud Monitoring v3 API, used to combine multiple time series for data analysis.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAggregation\u003c/code\u003e process involves two main steps: aligning time series to consistent time intervals using \u003ccode\u003eper_series_aligner\u003c/code\u003e and optionally reducing the number of time series with a \u003ccode\u003ecross_series_reducer\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAlignmentPeriod\u003c/code\u003e is a crucial property that defines the length of time intervals to be applied to the time series data, with a minimum requirement of 60 seconds and certain limitations for charts and alerts.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGroupByFields\u003c/code\u003e property allows partitioning time series into subsets before applying aggregation, ensuring that the reducer is applied to groups of similar data, implicitly including \u003ccode\u003eresource.type\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eMultiple versions of the \u003ccode\u003eAggregation\u003c/code\u003e class are available, ranging from version 2.3.0 up to the latest version 3.15.0, with corresponding links provided for each.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Monitoring v3 API - Class Aggregation (3.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.15.0 (latest)](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.14.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.13.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.12.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.11.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.10.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.9.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.8.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.7.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.6.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.5.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.4.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.3.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.2.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.1.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/3.0.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/2.6.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/2.5.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/2.4.0/Google.Cloud.Monitoring.V3.Aggregation)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/2.3.0/Google.Cloud.Monitoring.V3.Aggregation) \n\n public sealed class Aggregation : IMessage\u003cAggregation\u003e, IEquatable\u003cAggregation\u003e, IDeepCloneable\u003cAggregation\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Monitoring v3 API class Aggregation.\n\nDescribes how to combine multiple time series to provide a different view of\nthe data. Aggregation of time series is done in two steps. First, each time\nseries in the set is *aligned* to the same time interval boundaries, then the\nset of time series is optionally *reduced* in number.\n\nAlignment consists of applying the `per_series_aligner` operation\nto each time series after its data has been divided into regular\n`alignment_period` time intervals. This process takes *all* of the data\npoints in an alignment period, applies a mathematical transformation such as\naveraging, minimum, maximum, delta, etc., and converts them into a single\ndata point per period.\n\nReduction is when the aligned and transformed time series can optionally be\ncombined, reducing the number of time series through similar mathematical\ntransformations. Reduction involves applying a `cross_series_reducer` to\nall the time series, optionally sorting the time series into subsets with\n`group_by_fields`, and applying the reducer to each subset.\n\nThe raw time series data can contain a huge amount of information from\nmultiple sources. Alignment and reduction transforms this mass of data into\na more manageable and representative collection of data, for example \"the\n95% latency across the average of all tasks in a cluster\". This\nrepresentative data can be more easily graphed and comprehended, and the\nindividual time series data is still available for later drilldown. For more\ndetails, see [Filtering and\naggregation](https://cloud.google.com/monitoring/api/v3/aggregation). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Aggregation \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Aggregation](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.Aggregation), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Aggregation](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.Aggregation), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Aggregation](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3.Aggregation), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Monitoring.V3](/dotnet/docs/reference/Google.Cloud.Monitoring.V3/latest/Google.Cloud.Monitoring.V3)\n\nAssembly\n--------\n\nGoogle.Cloud.Monitoring.V3.dll\n\nConstructors\n------------\n\n### Aggregation()\n\n public Aggregation()\n\n### Aggregation(Aggregation)\n\n public Aggregation(Aggregation other)\n\nProperties\n----------\n\n### AlignmentPeriod\n\n public Duration AlignmentPeriod { get; set; }\n\nThe `alignment_period` specifies a time interval, in seconds, that is used\nto divide the data in all the\n\\[time series\\]\\[google.monitoring.v3.TimeSeries\\] into consistent blocks of\ntime. This will be done before the per-series aligner can be applied to\nthe data.\n\nThe value must be at least 60 seconds. If a per-series\naligner other than `ALIGN_NONE` is specified, this field is required or an\nerror is returned. If no per-series aligner is specified, or the aligner\n`ALIGN_NONE` is specified, then this field is ignored.\n\nThe maximum value of the `alignment_period` is 104 weeks (2 years) for\ncharts, and 90,000 seconds (25 hours) for alerting policies.\n\n### CrossSeriesReducer\n\n public Aggregation.Types.Reducer CrossSeriesReducer { get; set; }\n\nThe reduction operation to be used to combine time series into a single\ntime series, where the value of each data point in the resulting series is\na function of all the already aligned values in the input time series.\n\nNot all reducer operations can be applied to all time series. The valid\nchoices depend on the `metric_kind` and the `value_type` of the original\ntime series. Reduction can yield a time series with a different\n`metric_kind` or `value_type` than the input time series.\n\nTime series data must first be aligned (see `per_series_aligner`) in order\nto perform cross-time series reduction. If `cross_series_reducer` is\nspecified, then `per_series_aligner` must be specified, and must not be\n`ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an\nerror is returned.\n\n### GroupByFields\n\n public RepeatedField\u003cstring\u003e GroupByFields { get; }\n\nThe set of fields to preserve when `cross_series_reducer` is\nspecified. The `group_by_fields` determine how the time series are\npartitioned into subsets prior to applying the aggregation\noperation. Each subset contains time series that have the same\nvalue for each of the grouping fields. Each individual time\nseries is a member of exactly one subset. The\n`cross_series_reducer` is applied to each subset of time series.\nIt is not possible to reduce across different resource types, so\nthis field implicitly contains `resource.type`. Fields not\nspecified in `group_by_fields` are aggregated away. If\n`group_by_fields` is not specified and all the time series have\nthe same resource type, then the time series are aggregated into\na single output time series. If `cross_series_reducer` is not\ndefined, this field is ignored.\n\n### PerSeriesAligner\n\n public Aggregation.Types.Aligner PerSeriesAligner { get; set; }\n\nAn `Aligner` describes how to bring the data points in a single\ntime series into temporal alignment. Except for `ALIGN_NONE`, all\nalignments cause all the data points in an `alignment_period` to be\nmathematically grouped together, resulting in a single data point for\neach `alignment_period` with end timestamp at the end of the period.\n\nNot all alignment operations may be applied to all time series. The valid\nchoices depend on the `metric_kind` and `value_type` of the original time\nseries. Alignment can change the `metric_kind` or the `value_type` of\nthe time series.\n\nTime series data must be aligned in order to perform cross-time\nseries reduction. If `cross_series_reducer` is specified, then\n`per_series_aligner` must be specified and not equal to `ALIGN_NONE`\nand `alignment_period` must be specified; otherwise, an error is\nreturned."]]