deployer/docs/contrib/grafana.md
Anton Medvedev 4bdf95ebda Update docs
2022-09-12 12:29:44 +02:00

56 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- DO NOT EDIT THIS FILE! -->
<!-- Instead edit contrib/grafana.php -->
<!-- Then run bin/docgen -->
# Grafana Recipe
```php
require 'contrib/grafana.php';
```
[Source](/contrib/grafana.php)
## Configuration options
- **url** *(required)*: the URL to the creates annotation api endpoint.
- **token** *(required)*: authentication token. Can be created at Grafana Console.
- **time** *(optional)* set deploy time of annotation. specify epoch milliseconds. (Defaults is set to the current time in epoch milliseconds.)
- **tags** *(optional)* set tag of annotation.
- **text** *(optional)* set text of annotation. (Defaults is set to "Deployed " + git log -n 1 --format="%h")
```php
deploy.php
set('grafana', [
'token' => 'eyJrIj...',
'url' => 'http://grafana/api/annotations',
'tags' => ['deploy', 'production'],
]);
```
## Usage
If you want to create annotation about successful end of deployment.
```php
after('deploy:success', 'grafana:annotation');
```
## Tasks
### grafana:annotation
[Source](https://github.com/deployphp/deployer/blob/master/contrib/grafana.php#L38)
Creates Grafana annotation of deployment.