Skip to content

Commit

Permalink
feat: add alerting (#138)
Browse files Browse the repository at this point in the history
* feat: add alerting

* chore: generate code/docs for latest

* chore: regenerate code/docs for all versions
  • Loading branch information
Duologic authored Oct 18, 2023
1 parent 16f374f commit b8f5ba5
Show file tree
Hide file tree
Showing 133 changed files with 7,324 additions and 2 deletions.
12 changes: 12 additions & 0 deletions custom/alerting/contactPoint.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local d = import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet';

{
'#'+:: {
help+:
|||
**NOTE**: The schemas for all different contact points is under development, this means we can't properly express them in Grafonnet yet. The way this works now may change heavily.
|||,
},
}
8 changes: 8 additions & 0 deletions custom/alerting/muteTiming.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
'#withTimeIntervals': { ignore: true },
'#withIntervals': super['#withTimeIntervals'],
withIntervals: super.withTimeIntervals,
'#withTimeIntervalsMixin': { ignore: true },
'#withIntervalsMixin': super['#withTimeIntervalsMixin'],
withIntervalsMixin: super.withTimeIntervalsMixin,
}
12 changes: 12 additions & 0 deletions custom/alerting/notificationPolicy.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
'#withReceiver': { ignore: true },
'#withContactPoint': super['#withReceiver'],
withContactPoint: super.withReceiver,

'#withRoutes': { ignore: true },
'#withPolicy': super['#withRoutes'],
withPolicy: super.withRoutes,
'#withRoutesMixin': { ignore: true },
'#withPolicyMixin': super['#withRoutesMixin'],
withPolicyMixin: super.withRoutesMixin,
}
13 changes: 13 additions & 0 deletions custom/alerting/ruleGroup.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local d = import 'github.com/jsonnet-libs/docsonnet/doc-util/main.libsonnet';

{
'#withTitle': { ignore: true },
'#withName': super['#withTitle'],
withName: super.withTitle,
rule+: {
'#':: d.package.newSub('rule', ''),
'#withTitle': { ignore: true },
'#withName': super['#withTitle'],
withName: super.withTitle,
},
}
100 changes: 100 additions & 0 deletions docs/API/alerting/contactPoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# contactPoint

grafonnet.alerting.contactPoint

**NOTE**: The schemas for all different contact points is under development, this means we can't properly express them in Grafonnet yet. The way this works now may change heavily.


## Index

* [`fn withDisableResolveMessage(value=true)`](#fn-withdisableresolvemessage)
* [`fn withName(value)`](#fn-withname)
* [`fn withProvenance(value)`](#fn-withprovenance)
* [`fn withSettings(value)`](#fn-withsettings)
* [`fn withSettingsMixin(value)`](#fn-withsettingsmixin)
* [`fn withType(value)`](#fn-withtype)
* [`fn withUid(value)`](#fn-withuid)

## Fields

### fn withDisableResolveMessage

```jsonnet
withDisableResolveMessage(value=true)
```

PARAMETERS:

* **value** (`boolean`)
- default value: `true`


### fn withName

```jsonnet
withName(value)
```

PARAMETERS:

* **value** (`string`)

Name is used as grouping key in the UI. Contact points with the
same name will be grouped in the UI.
### fn withProvenance

```jsonnet
withProvenance(value)
```

PARAMETERS:

* **value** (`string`)


### fn withSettings

```jsonnet
withSettings(value)
```

PARAMETERS:

* **value** (`object`)


### fn withSettingsMixin

```jsonnet
withSettingsMixin(value)
```

PARAMETERS:

* **value** (`object`)


### fn withType

```jsonnet
withType(value)
```

PARAMETERS:

* **value** (`string`)
- valid values: `"alertmanager"`, `" dingding"`, `" discord"`, `" email"`, `" googlechat"`, `" kafka"`, `" line"`, `" opsgenie"`, `" pagerduty"`, `" pushover"`, `" sensugo"`, `" slack"`, `" teams"`, `" telegram"`, `" threema"`, `" victorops"`, `" webhook"`, `" wecom"`


### fn withUid

```jsonnet
withUid(value)
```

PARAMETERS:

* **value** (`string`)

UID is the unique identifier of the contact point. The UID can be
set by the user.
11 changes: 11 additions & 0 deletions docs/API/alerting/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# alerting

grafonnet.alerting

## Subpackages

* [contactPoint](contactPoint.md)
* [messageTemplate](messageTemplate.md)
* [muteTiming](muteTiming/index.md)
* [notificationPolicy](notificationPolicy/index.md)
* [ruleGroup](ruleGroup/index.md)
32 changes: 32 additions & 0 deletions docs/API/alerting/messageTemplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# messageTemplate

grafonnet.alerting.messageTemplate

## Index

* [`fn withName(value)`](#fn-withname)
* [`fn withTemplate(value)`](#fn-withtemplate)

## Fields

### fn withName

```jsonnet
withName(value)
```

PARAMETERS:

* **value** (`string`)


### fn withTemplate

```jsonnet
withTemplate(value)
```

PARAMETERS:

* **value** (`string`)

48 changes: 48 additions & 0 deletions docs/API/alerting/muteTiming/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# muteTiming

grafonnet.alerting.muteTiming

## Subpackages

* [interval](interval/index.md)

## Index

* [`fn withIntervals(value)`](#fn-withintervals)
* [`fn withIntervalsMixin(value)`](#fn-withintervalsmixin)
* [`fn withName(value)`](#fn-withname)

## Fields

### fn withIntervals

```jsonnet
withIntervals(value)
```

PARAMETERS:

* **value** (`array`)


### fn withIntervalsMixin

```jsonnet
withIntervalsMixin(value)
```

PARAMETERS:

* **value** (`array`)


### fn withName

```jsonnet
withName(value)
```

PARAMETERS:

* **value** (`string`)

144 changes: 144 additions & 0 deletions docs/API/alerting/muteTiming/interval/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# interval



## Subpackages

* [times](times.md)

## Index

* [`fn withDaysOfMonth(value)`](#fn-withdaysofmonth)
* [`fn withDaysOfMonthMixin(value)`](#fn-withdaysofmonthmixin)
* [`fn withLocation(value)`](#fn-withlocation)
* [`fn withMonths(value)`](#fn-withmonths)
* [`fn withMonthsMixin(value)`](#fn-withmonthsmixin)
* [`fn withTimes(value)`](#fn-withtimes)
* [`fn withTimesMixin(value)`](#fn-withtimesmixin)
* [`fn withWeekdays(value)`](#fn-withweekdays)
* [`fn withWeekdaysMixin(value)`](#fn-withweekdaysmixin)
* [`fn withYears(value)`](#fn-withyears)
* [`fn withYearsMixin(value)`](#fn-withyearsmixin)

## Fields

### fn withDaysOfMonth

```jsonnet
withDaysOfMonth(value)
```

PARAMETERS:

* **value** (`array`)


### fn withDaysOfMonthMixin

```jsonnet
withDaysOfMonthMixin(value)
```

PARAMETERS:

* **value** (`array`)


### fn withLocation

```jsonnet
withLocation(value)
```

PARAMETERS:

* **value** (`string`)


### fn withMonths

```jsonnet
withMonths(value)
```

PARAMETERS:

* **value** (`array`)


### fn withMonthsMixin

```jsonnet
withMonthsMixin(value)
```

PARAMETERS:

* **value** (`array`)


### fn withTimes

```jsonnet
withTimes(value)
```

PARAMETERS:

* **value** (`array`)


### fn withTimesMixin

```jsonnet
withTimesMixin(value)
```

PARAMETERS:

* **value** (`array`)


### fn withWeekdays

```jsonnet
withWeekdays(value)
```

PARAMETERS:

* **value** (`array`)


### fn withWeekdaysMixin

```jsonnet
withWeekdaysMixin(value)
```

PARAMETERS:

* **value** (`array`)


### fn withYears

```jsonnet
withYears(value)
```

PARAMETERS:

* **value** (`array`)


### fn withYearsMixin

```jsonnet
withYearsMixin(value)
```

PARAMETERS:

* **value** (`array`)

Loading

0 comments on commit b8f5ba5

Please sign in to comment.