Skip to content

Minute aggregation #466

@abaenaDSET

Description

@abaenaDSET

I have been exploring minute-level aggregation since it is listed as a potential return type of api.DeviceServiceClient.GetMetrics(). However, I discovered that this option is not included in the default settings, as seen in the

vec![Aggregation::HOUR, Aggregation::DAY, Aggregation::MONTH]
file.

While I understand the decision to exclude minute-level support by default, it would be beneficial to have it available as an optional feature. Currently, using the following code:

...

resp, err := client.GetMetrics(context.Background(), &api.GetDeviceMetricsRequest{
  DevEui:      DevEui,
  Start:       timestamppb.New(time.Now().AddDate(0, 0, -1)),
  End:         timestamppb.Now(),
  Aggregation: common.Aggregation_MINUTE,
})

...

results in common.Metric.MetricDataset.Data being populated with zeros. However, when using common.Aggregation_HOUR (the default), the values are returned correctly.

Given that my LoRa device transmits data at a one-minute interval, it would be ideal for Aggregation_MINUTE to function as expected, providing data aggregated by the minute.

Is there a way to enable this feature, perhaps through a configuration option in the chirpstack.toml file? Adding this capability would greatly enhance the flexibility and usability of the API.

Thank you for your consideration!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions