oncall-engine/docs
Nick Moore cf589d45c6
feat: add timedeltaparse function to the jinja template (#5142)
# What this PR does
If an OnCall template needs to contain a date relative to a date in the
alert response, currently there is no way for the template to add or
subtract time from a parsed date.

This PR adds a function that allows a time-window (e.g., 1s, 5m, 6h, 7d,
2w) to be converted into a Python timedelta, which can then be added or
subtracted from a datetime. An example usage might be:

```
{% set delta = alert.timeWindow | timedeltaparse %}
{% set time = alert.startsAt | iso8601_to_time - delta | datetimeformat('%s') %}
```

## Checklist

- [X] Unit, integration, and e2e (if applicable) tests updated
- [X] Documentation added (or `pr:no public docs` PR label added if not
required)
- [X] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will show up in the
autogenerated release notes.
2024-10-09 18:27:48 +00:00
..
img cleanup some unused images 2024-06-06 10:02:40 -04:00
sources feat: add timedeltaparse function to the jinja template (#5142) 2024-10-09 18:27:48 +00:00
.markdownlint.json Update all links to use docs/reference style (#2456) 2023-07-13 14:38:35 +00:00
docs.mk Update make docs procedure (#4523) 2024-06-13 20:30:35 +00:00
make-docs Update make docs procedure (#4913) 2024-08-27 11:28:24 +00:00
Makefile Use centralized make-docs script from Writers' Toolkit (#1742) 2023-04-24 08:52:43 +00:00
README.md Mobile app docs updates (#2026) 2023-05-29 14:52:42 +00:00
variables.mk Update make docs procedure (#2808) 2023-08-17 11:46:49 +00:00

Grafana Cloud Documentation

Source for documentation at https://grafana.com/docs/oncall/

Preview the website

Run make docs. This launches a preview of the website with the current grafana docs at http://localhost:3002/docs/oncall/latest/ which will refresh automatically when changes are made to content in the sources directory. Make sure Docker is running.

Image support

See the documentation in writers toolkit about how to store images