mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
UAlerting: Increase default max datapoints (#34223)
Change const value from 100 to 43200 (12 hours at 1sec interval)
This commit is contained in:
parent
31c1fc3e6e
commit
331991ca10
@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/grafana/grafana/pkg/expr"
|
"github.com/grafana/grafana/pkg/expr"
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultMaxDataPoints float64 = 100
|
const defaultMaxDataPoints float64 = 43200 // 12 hours at 1sec interval
|
||||||
const defaultIntervalMS float64 = 1000
|
const defaultIntervalMS float64 = 1000
|
||||||
|
|
||||||
// Duration is a type used for marshalling durations.
|
// Duration is a type used for marshalling durations.
|
||||||
|
@ -109,7 +109,7 @@ func (ng *AlertNG) Init() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run starts the scheduler
|
// Run starts the scheduler.
|
||||||
func (ng *AlertNG) Run(ctx context.Context) error {
|
func (ng *AlertNG) Run(ctx context.Context) error {
|
||||||
ng.Log.Debug("ngalert starting")
|
ng.Log.Debug("ngalert starting")
|
||||||
ng.schedule.WarmStateCache(ng.stateManager)
|
ng.schedule.WarmStateCache(ng.stateManager)
|
||||||
|
@ -863,7 +863,7 @@ func TestAlertRuleCRUD(t *testing.T) {
|
|||||||
"model":{
|
"model":{
|
||||||
"expression":"2 + 3 \u003e 1",
|
"expression":"2 + 3 \u003e 1",
|
||||||
"intervalMs":1000,
|
"intervalMs":1000,
|
||||||
"maxDataPoints":100,
|
"maxDataPoints":43200,
|
||||||
"type":"math"
|
"type":"math"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -898,7 +898,7 @@ func TestAlertRuleCRUD(t *testing.T) {
|
|||||||
"model":{
|
"model":{
|
||||||
"expression":"2 + 3 \u003e 1",
|
"expression":"2 + 3 \u003e 1",
|
||||||
"intervalMs":1000,
|
"intervalMs":1000,
|
||||||
"maxDataPoints":100,
|
"maxDataPoints":43200,
|
||||||
"type":"math"
|
"type":"math"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1122,7 +1122,7 @@ func TestAlertRuleCRUD(t *testing.T) {
|
|||||||
"model":{
|
"model":{
|
||||||
"expression":"2 + 3 \u003C 1",
|
"expression":"2 + 3 \u003C 1",
|
||||||
"intervalMs":1000,
|
"intervalMs":1000,
|
||||||
"maxDataPoints":100,
|
"maxDataPoints":43200,
|
||||||
"type":"math"
|
"type":"math"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ func TestPrometheusRules(t *testing.T) {
|
|||||||
"rules": [{
|
"rules": [{
|
||||||
"state": "inactive",
|
"state": "inactive",
|
||||||
"name": "AlwaysFiring",
|
"name": "AlwaysFiring",
|
||||||
"query": "[{\"refId\":\"A\",\"queryType\":\"\",\"relativeTimeRange\":{\"from\":18000,\"to\":10800},\"datasourceUid\":\"-100\",\"model\":{\"expression\":\"2 + 3 \\u003e 1\",\"intervalMs\":1000,\"maxDataPoints\":100,\"type\":\"math\"}}]",
|
"query": "[{\"refId\":\"A\",\"queryType\":\"\",\"relativeTimeRange\":{\"from\":18000,\"to\":10800},\"datasourceUid\":\"-100\",\"model\":{\"expression\":\"2 + 3 \\u003e 1\",\"intervalMs\":1000,\"maxDataPoints\":43200,\"type\":\"math\"}}]",
|
||||||
"duration": 10,
|
"duration": 10,
|
||||||
"annotations": {
|
"annotations": {
|
||||||
"annotation1": "val1"
|
"annotation1": "val1"
|
||||||
@ -184,7 +184,7 @@ func TestPrometheusRules(t *testing.T) {
|
|||||||
}, {
|
}, {
|
||||||
"state": "inactive",
|
"state": "inactive",
|
||||||
"name": "AlwaysFiringButSilenced",
|
"name": "AlwaysFiringButSilenced",
|
||||||
"query": "[{\"refId\":\"A\",\"queryType\":\"\",\"relativeTimeRange\":{\"from\":18000,\"to\":10800},\"datasourceUid\":\"-100\",\"model\":{\"expression\":\"2 + 3 \\u003e 1\",\"intervalMs\":1000,\"maxDataPoints\":100,\"type\":\"math\"}}]",
|
"query": "[{\"refId\":\"A\",\"queryType\":\"\",\"relativeTimeRange\":{\"from\":18000,\"to\":10800},\"datasourceUid\":\"-100\",\"model\":{\"expression\":\"2 + 3 \\u003e 1\",\"intervalMs\":1000,\"maxDataPoints\":43200,\"type\":\"math\"}}]",
|
||||||
"labels": null,
|
"labels": null,
|
||||||
"health": "ok",
|
"health": "ok",
|
||||||
"lastError": "",
|
"lastError": "",
|
||||||
@ -223,7 +223,7 @@ func TestPrometheusRules(t *testing.T) {
|
|||||||
"rules": [{
|
"rules": [{
|
||||||
"state": "inactive",
|
"state": "inactive",
|
||||||
"name": "AlwaysFiring",
|
"name": "AlwaysFiring",
|
||||||
"query": "[{\"refId\":\"A\",\"queryType\":\"\",\"relativeTimeRange\":{\"from\":18000,\"to\":10800},\"datasourceUid\":\"-100\",\"model\":{\"expression\":\"2 + 3 \\u003e 1\",\"intervalMs\":1000,\"maxDataPoints\":100,\"type\":\"math\"}}]",
|
"query": "[{\"refId\":\"A\",\"queryType\":\"\",\"relativeTimeRange\":{\"from\":18000,\"to\":10800},\"datasourceUid\":\"-100\",\"model\":{\"expression\":\"2 + 3 \\u003e 1\",\"intervalMs\":1000,\"maxDataPoints\":43200,\"type\":\"math\"}}]",
|
||||||
"duration": 10,
|
"duration": 10,
|
||||||
"annotations": {
|
"annotations": {
|
||||||
"annotation1": "val1"
|
"annotation1": "val1"
|
||||||
@ -239,7 +239,7 @@ func TestPrometheusRules(t *testing.T) {
|
|||||||
}, {
|
}, {
|
||||||
"state": "inactive",
|
"state": "inactive",
|
||||||
"name": "AlwaysFiringButSilenced",
|
"name": "AlwaysFiringButSilenced",
|
||||||
"query": "[{\"refId\":\"A\",\"queryType\":\"\",\"relativeTimeRange\":{\"from\":18000,\"to\":10800},\"datasourceUid\":\"-100\",\"model\":{\"expression\":\"2 + 3 \\u003e 1\",\"intervalMs\":1000,\"maxDataPoints\":100,\"type\":\"math\"}}]",
|
"query": "[{\"refId\":\"A\",\"queryType\":\"\",\"relativeTimeRange\":{\"from\":18000,\"to\":10800},\"datasourceUid\":\"-100\",\"model\":{\"expression\":\"2 + 3 \\u003e 1\",\"intervalMs\":1000,\"maxDataPoints\":43200,\"type\":\"math\"}}]",
|
||||||
"labels": null,
|
"labels": null,
|
||||||
"health": "ok",
|
"health": "ok",
|
||||||
"lastError": "",
|
"lastError": "",
|
||||||
|
@ -94,7 +94,7 @@ func TestAlertRulePermissions(t *testing.T) {
|
|||||||
"model":{
|
"model":{
|
||||||
"expression":"2 + 3 \u003E 1",
|
"expression":"2 + 3 \u003E 1",
|
||||||
"intervalMs":1000,
|
"intervalMs":1000,
|
||||||
"maxDataPoints":100,
|
"maxDataPoints":43200,
|
||||||
"type":"math"
|
"type":"math"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ func TestAlertRulePermissions(t *testing.T) {
|
|||||||
"model":{
|
"model":{
|
||||||
"expression":"2 + 3 \u003E 1",
|
"expression":"2 + 3 \u003E 1",
|
||||||
"intervalMs":1000,
|
"intervalMs":1000,
|
||||||
"maxDataPoints":100,
|
"maxDataPoints":43200,
|
||||||
"type":"math"
|
"type":"math"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -216,7 +216,7 @@ func TestAlertRulePermissions(t *testing.T) {
|
|||||||
"model":{
|
"model":{
|
||||||
"expression":"2 + 3 \u003E 1",
|
"expression":"2 + 3 \u003E 1",
|
||||||
"intervalMs":1000,
|
"intervalMs":1000,
|
||||||
"maxDataPoints":100,
|
"maxDataPoints":43200,
|
||||||
"type":"math"
|
"type":"math"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user