Azuremonitor schematize backend (#69822)

* metrics schematize

* metrics now use schemas

* logs schema

* remove unused code

* fix tests
This commit is contained in:
Andrew Hackmann
2023-06-10 23:30:49 +03:00
committed by GitHub
parent d29124214a
commit 8d37d8f60b
9 changed files with 244 additions and 246 deletions
@@ -8,14 +8,14 @@ var (
// SetAutoTimeGrain tries to find the closest interval to the query's intervalMs value
// if the metric has a limited set of possible intervals/time grains then use those
// instead of the default list of intervals
func SetAutoTimeGrain(intervalMs int64, timeGrains []int64) (string, error) {
func SetAutoTimeGrain(intervalMs int64, timeGrains []int64) (*string, error) {
autoInterval := FindClosestAllowedIntervalMS(intervalMs, timeGrains)
autoTimeGrain, err := CreateISO8601DurationFromIntervalMS(autoInterval)
if err != nil {
return "", err
return nil, err
}
return autoTimeGrain, nil
return &autoTimeGrain, nil
}
// FindClosestAllowedIntervalMS is used for the auto time grain setting.