Skip to content

Commit

Permalink
[v9.5.x] Documentation: Update Hubot Integration documentation (grafa…
Browse files Browse the repository at this point in the history
…na#77565)

* Documentation: Update Hubot Integration documentation (grafana#76925)

* Update Hubot Integration documentation

The script package has improved over the years to allow for direct uploading to Slack, etc. This updates the documentation to reflect that.

* Apply suggestions from code review

Co-authored-by: lwandz13 <[email protected]>

---------

Co-authored-by: lwandz13 <[email protected]>
(cherry picked from commit c73a2bd)

* Fix codespell issues

Signed-off-by: Jack Baldry <[email protected]>

---------

Signed-off-by: Jack Baldry <[email protected]>
Co-authored-by: Stephen Yeargin <[email protected]>
Co-authored-by: Jack Baldry <[email protected]>
  • Loading branch information
3 people authored Nov 13, 2023
1 parent 84729d6 commit ef2bcdc
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 33 deletions.
2 changes: 1 addition & 1 deletion docs/sources/administration/api-keys/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Complete the following steps to migrate from API keys to service accounts using
This action generates a service account token.

1. Store the ID and secret that the system returns to you.
1. Pass the token in the `Authrorization` header, prefixed with `Bearer`.
1. Pass the token in the `Authorization` header, prefixed with `Bearer`.

This action authenticates API requests.

Expand Down
4 changes: 2 additions & 2 deletions docs/sources/administration/provisioning/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ When Grafana starts, it updates/inserts all dashboards available in the configur
By default, Grafana deletes dashboards in the database if the file is removed. You can disable this behavior using the `disableDeletion` setting.

> **Note:** Provisioning allows you to overwrite existing dashboards
> which leads to problems if you re-use settings that are supposed to be unique.
> Be careful not to re-use the same `title` multiple times within a folder
> which leads to problems if you reuse settings that are supposed to be unique.
> Be careful not to reuse the same `title` multiple times within a folder
> or `uid` within the same installation as this will cause weird behaviors.

### Provision folders structure from filesystem to Grafana
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ weight: 500

# Manage dashboard permissions

Dashboard and dasboard folder permissions enable you to grant a viewer the ability to edit and save dashboard changes, or limit an editor's permission to modify a dashboard.
Dashboard and dashboard folder permissions enable you to grant a viewer the ability to edit and save dashboard changes, or limit an editor's permission to modify a dashboard.

For more information about dashboard permissions, refer to [Dashboard permissions]({{< relref "../../roles-and-permissions/#dashboard-permissions" >}}).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ Alert summary:

You can use any of the following built-in template options to embed custom templates.

| Name | Notes |
| ----------------------- | ------------------------------------------------------------- |
| `default.title` | Displays high-level status information. |
| `default.message` | Provides a formatted summary of firing and resolved alerts. |
| `teams.default.message` | Similar to `default.messsage`, formatted for Microsoft Teams. |
| Name | Notes |
| ----------------------- | ------------------------------------------------------------ |
| `default.title` | Displays high-level status information. |
| `default.message` | Provides a formatted summary of firing and resolved alerts. |
| `teams.default.message` | Similar to `default.message`, formatted for Microsoft Teams. |

### HTML in notification templates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ groups:
# <string, required> which query should be used for the condition
condition: A
# <list, required> list of query objects that should be executed on each
# evaluation - should be obtained trough the API
# evaluation - should be obtained through the API
data:
- refId: A
datasourceUid: '__expr__'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ You cannot edit resources provisioned via Terraform from the UI. This ensures th

**Note:**

You can re-use the same templates across many contact points. In the example above, a shared template ie embedded using the statement `{{ template “Alert Instance Template” . }}`
You can reuse the same templates across many contact points. In the example above, a shared template ie embedded using the statement `{{ template “Alert Instance Template” . }}`

This fragment can then be managed separately in Terraform:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The following table contains a list of calculations you can perform in Grafana.
| :----------------- | :-------------------------------------------------------- |
| All nulls | True when all values are null |
| All values | Array with all values |
| All unique values | Array with all unique alues |
| All unique values | Array with all unique values |
| All zeros | True when all values are 0 |
| Change count | Number of times the field's value changes |
| Count | Number of values in a field |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ aliases:
- ../panels/working-with-panels/format-standard-fields/
keywords:
- panel
- dasboard
- dashboard
- standard
- option
menuTitle: Configure standard options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ Output:

The extra labels can now be used in the field display name provide more complete field names.

If you want to extract config from one query and appply it to another you should use the config from query results transformation.
If you want to extract config from one query and apply it to another you should use the config from query results transformation.

#### Example

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/release-notes/release-notes-9-1-0-beta1.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ The following metrics have been converted to histograms:
- grafana_plugin_request_duration_milliseconds
- grafana_alerting_rule_evaluation_duration_seconds Issue [#50420](https://github.com/grafana/grafana/issues/50420)

In Elasticsearch versions 7.x, to specify the interval-value we used the `interval` property. In Grafana 9.1.0 we switched to use the `fixed_interval` property. This makes it to be the same as in Elasticsearch versions 8.x, also this provides a more consistent experience, `fixed_interval` is a better match to Grafana's time invervals. For most situations this will not cause any visible change to query results. Issue [#50297](https://github.com/grafana/grafana/issues/50297)
In Elasticsearch versions 7.x, to specify the interval-value we used the `interval` property. In Grafana 9.1.0 we switched to use the `fixed_interval` property. This makes it to be the same as in Elasticsearch versions 8.x, also this provides a more consistent experience, `fixed_interval` is a better match to Grafana's time intervals. For most situations this will not cause any visible change to query results. Issue [#50297](https://github.com/grafana/grafana/issues/50297)

### Grafana now reserves alert labels prefixed with `grafana_`

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/setup-grafana/configure-grafana/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ If you want to change the `oauth_skip_org_role_update_sync` setting to `false`,

`skip_org_role_sync` default value is `false`.

With `skip_org_role_sync` set to `false`, the users' organization and role is reset on every new login, based on the external provider's role. See provider specifities in the tables below.
With `skip_org_role_sync` set to `false`, the users' organization and role is reset on every new login, based on the external provider's role. See provider specifics in the tables below.

With `skip_org_role_sync` set to `true`, when a user logs in for the first time, Grafana sets the organization role based on the value specified in `auto_assign_org_role` and forces the organization to `auto_assign_org_id` when specified, otherwise it falls back to OrgID `1`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Some stable features are enabled by default. You can disable a stable feature by
| `disableAngular` | Dynamic flag to disable angular at runtime. The preferred method is to set `angular_support_enabled` to `false` in the [security] settings, which allows you to change the state at runtime. |
| `accessControlOnCall` | Access control primitives for OnCall |
| `alertingNoNormalState` | Stop maintaining state of alerts that are not firing |
| `disableElasticsearchBackendExploreQuery` | Disable executing of Elasticsearch Explore queries trough backend |
| `disableElasticsearchBackendExploreQuery` | Disable executing of Elasticsearch Explore queries through backend |
| `renderAuthJWT` | Uses JWT-based auth for rendering instead of relying on remote cache |

## Alpha feature toggles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ If `auto_sign_up` is enabled, then the `sub` claim is used as the "external Auth

## Iframe Embedding

If you want to embed Grafana in an iframe while maintaning user identity and role checks,
If you want to embed Grafana in an iframe while maintaining user identity and role checks,
you can use JWT authentication to authenticate the iframe.

> **Note**: For Grafana Cloud, or scenarios where verifying viewer identity is not required,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ the correct teams.

Okta groups can be referenced by group names, like `Admins` or `Editors`.

To learn more about Team Sync, refer to [Confgure Team Sync]({{< relref "../../configure-team-sync" >}}).
To learn more about Team Sync, refer to [Configure Team Sync]({{< relref "../../configure-team-sync" >}}).
2 changes: 1 addition & 1 deletion docs/sources/setup-grafana/set-up-https.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ This section shows you how to use `openssl` tooling to generate all necessary fi
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:Virginia
Locality Name (eg, city) []:Richmond
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organization Name (eg, company) [Internet Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:subdomain.mysite.com
Email Address []:[email protected]
Expand Down
20 changes: 7 additions & 13 deletions docs/sources/tutorials/integrate-hubot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ Grafana 2.0 shipped with a great feature that enables it to render any graph or

No matter what data source you are using, the PNG image of the Graph will look the same as it does in your browser.

This guide will show you how to install and configure the [Hubot-Grafana](https://github.com/stephenyeargin/hubot-grafana) plugin. This plugin allows you to tell hubot to render any dashboard or graph right from a channel in Slack, Hipchat or Basecamp. The bot will respond with an image of the graph and a link that will take you to the graph.

> _Amazon S3 Required_: The hubot-grafana script will upload the rendered graphs to Amazon S3. This
> is so Hipchat and Slack can show them reliably (they require the image to be publicly available).
This guide shows you how to install and configure the [Hubot-Grafana](https://github.com/stephenyeargin/hubot-grafana) plugin. This plugin allows you to tell Hubot to render any dashboard or graph right from a channel in Slack, Basecamp, or any other supported Hubot adapter. The bot will respond with an image of the graph and a link that will take you to the graph.

{{< figure src="/static/img/docs/tutorials/hubot_grafana.png" max-width="800px" >}}

Expand All @@ -32,7 +29,7 @@ This guide will show you how to install and configure the [Hubot-Grafana](https:

Hubot is very easy to install and host. If you do not already have a bot up and running please read the official [Getting Started With Hubot](https://hubot.github.com/docs/) guide.

## Install Hubot-Grafana script
## Install the Hubot-Grafana script

In your Hubot project repo install the Grafana plugin using `npm`:

Expand All @@ -48,18 +45,15 @@ Edit the file external-scripts.json, and add hubot-grafana to the list of plugin

## Configure

The `hubot-grafana` plugin requires a number of environment variables to be set in order to work properly.
The Hubot-Grafana plugin requires two environment variables to be set in order to work properly.

```bash
export HUBOT_GRAFANA_HOST=https://play.grafana.org
export HUBOT_GRAFANA_API_KEY=abcd01234deadbeef01234
export HUBOT_GRAFANA_S3_BUCKET=mybucket
export HUBOT_GRAFANA_S3_ACCESS_KEY_ID=ABCDEF123456XYZ
export HUBOT_GRAFANA_S3_SECRET_ACCESS_KEY=aBcD01234dEaDbEef01234
export HUBOT_GRAFANA_S3_PREFIX=graphs
export HUBOT_GRAFANA_S3_REGION=us-standard
```

There are [additional environment variables](https://github.com/stephenyeargin/hubot-grafana?tab=readme-ov-file#general-settings) that you can set to control the appearance of the graphs.

### Grafana server side rendering

The hubot plugin will take advantage of the Grafana server side rendering feature that can render any panel on the server using phantomjs. Grafana ships with a phantomjs binary (Linux only).
Expand All @@ -72,9 +66,9 @@ To verify that this feature works try the `Direct link to rendered image` link i

You need to set the environment variable `HUBOT_GRAFANA_API_KEY` to a Grafana API Key. You can add these from the API Keys page which you find in the Organization dropdown.

### Amazon S3
### Image uploading

The `S3` options are optional but for the images to work properly in services like Slack and Hipchat they need to publicly available. By specifying the `S3` options the hubot-grafana script will publish the rendered panel to `S3` and it will use that URL when it posts to Slack or Hipchat.
There are several approaches to uploading the rendered graphs. If you are using Slack, Rocket.Chat, or Telegram, the adapter's native uploader will take care of sending it through their respective API. If your Hubot is hosted on a platform that doesn't support uploads (such as IRC), you can use the [built-in S3 uploader](https://github.com/stephenyeargin/hubot-grafana/wiki/Amazon-S3-Image-Hosting). Note if you configure S3, it will not use the adapter's upload features.

## Hubot commands

Expand Down

0 comments on commit ef2bcdc

Please sign in to comment.