grafana / cortex-jsonnet

Deprecated: see https://github.com/grafana/mimir/tree/main/operations/mimir instead
Apache License 2.0
74 stars 53 forks source link

Fix `compactor_blocks_retention_period` type in `extra_small_user` #395

Closed kavirajk closed 3 years ago

kavirajk commented 3 years ago

The actual type of compactor_blocks_retention_period is model.Duration. Which comes from prometheus common package.

The problem is that model.Duration have custom JSON unmarshal which treat the incoming value as string. https://github.com/prometheus/common/blob/main/model/time.go#L276

So setting it as integer, won't work when unmarshalling with JSON.

NOTE: This won't be an issue for YamlUnmarshal, as it always treating it as string (even though you put it as integer) https://github.com/prometheus/common/blob/main/model/time.go#L307

What this PR does:

Which issue(s) this PR fixes: Fixes NA

Checklist