3
0
mirror of https://github.com/grafana/grafana.git synced 2025-02-25 18:55:37 -06:00

SupportBundles: Add support bundle documentation ()

* add support bundle page

* Update docs/sources/troubleshooting/support-bundles/index.md

* Update docs/sources/troubleshooting/support-bundles/index.md

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* copy edit

* Update docs/sources/troubleshooting/support-bundles/index.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

---------

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
This commit is contained in:
Jo 2023-02-07 10:39:47 +01:00 committed by GitHub
parent 3a8f2bb726
commit f6d856f082
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 143 additions and 2 deletions
contribute/backend
docs/sources/troubleshooting
_index.md
support-bundles

View File

@ -0,0 +1,82 @@
# Support bundles
Support bundles are a way to collect all the information needed to debug a problem.
They are generated from the support bundle menu in the UI under the Help section.
The support bundle is an archive that contains one file per collector selected by
the user.
Collectors are functions in the backend that collect information about the service they are running in.
Services can register collectors during their initialization.
## Adding a new support bundle collector
To add a new support bundle collector, you need to follow these steps,
we'll use the usage stats service as an example:
1. Import the support bundles registry in the service's `ProvideService` function:
```go
type UsageStats struct {
...
}
func ProvideService(
...
bundleRegistry supportbundles.Service, // Bundle registry
) (*UsageStats, error)
```
2. `make gen-go` will then be able to wire the registry to the service.
3. Implement the collector
```go
func (uss *UsageStats) supportBundleCollector() supportbundles.Collector {
return supportbundles.Collector{
UID: "usage-stats", // unique ID for the collector
DisplayName: "Usage statistics", // display name for the collector in the UI
Description: "Usage statistics of the Grafana instance", // description for the collector in the UI
IncludedByDefault: false, // whether the collector is included by default in the support bundle and can't be deselected. Most times you want this to be false.
Default: false, // whether the collector is selected by default in the support bundle. User can still deselect it.
// Function that will actually collect the file during the support bundle generation.
Fn: func(ctx context.Context) (*supportbundles.SupportItem, error) {
// Add your service's logic to collect the information you need
// In this example we are collecting the usage stats and marshalling them to JSON
// This helps us get information about the usage of the Grafana instance
report, err := uss.GetUsageReport(context.Background())
if err != nil {
return nil, err
}
data, err := json.Marshal(report)
if err != nil {
return nil, err
}
return &supportbundles.SupportItem{
// filename of the file in the archive
// can be any extension. (most common is .json and .md)
Filename: "usage-stats.json",
FileBytes: data, // []byte of the file
}, nil
},
}
}
```
4. Register the collector in the service's `ProvideService` function:
```go
func ProvideService(
...
) (*UsageStats, error) {
s := &UsageStats{
// ...
}
bundleRegistry.RegisterSupportItemCollector(s.supportBundleCollector())
return s, nil
}
```

View File

@ -27,6 +27,12 @@ For more information, refer to [Enable debug logging in Grafana CLI]({{< relref
If you have an issue with your Dashboard panel, you can send us debug information. For more information, refer to [Send a panel to Grafana Labs support]({{< relref "./send-panel-to-grafana-support/" >}}).
## Troubleshoot with support bundles
If you have an issue with your Grafana instance, you can generate an archive containing information concerning the state and the configuration of the instance.
To send us a bundle for advanced support, refer to [Send a support bundle to Grafana Labs support]({{< relref "./support-bundles/" >}}).
## Troubleshoot transformations
Order of transformations matters. If the final data output from multiple transformations looks wrong, try changing the transformation order. Each transformation transforms data returned by the previous transformation, not the original raw data.
@ -47,5 +53,4 @@ sudo yum install urw-fonts
## FAQs
Check out the [FAQ section](https://community.grafana.com/c/howto/faq) on the Grafana Community page for answers to frequently
asked questions.
Check out the [FAQ section](https://community.grafana.com/c/howto/faq) on the Grafana Community page for answers to frequently asked questions.

View File

@ -0,0 +1,54 @@
---
description: Learn how to send a support bundle to Grafana Labs support for troubleshooting
keywords:
- grafana
- troubleshooting
- support
- bundles
title: Send a support bundle to Grafana Labs support
menutitle: Send a support bundle to support
weight: 200
---
# Send a support bundle to Grafana Labs support
When you encounter problems with your Grafana instance, you can send us a support bundle that contains information about your Grafana instance, including:
- Grafana version
- Installed plugins
- Grafana configuration
- Deployed database information and migrations
## Available support bundle components
A support bundle can include any of the following components:
- **Usage statistics**: Usage statistic for the Grafana instance
- **User information**: A list of users of the Grafana instance
- **Database and Migration information**: Database information and migration log
- **Plugin information**: Plugin information for the Grafana instance
- **Basic information**: Basic information about the Grafana instance (version, memory usage, and so on)
- **Settings**: Settings for the Grafana instance
- **SAML**: Healthcheck connection and metadata for SAML (only displayed if SAML is enabled)
## Steps
To generate a support bundle and send the support bundle to Grafana Labs via a support ticket:
1. Click the Help icon.
1. Click **Support Bundles**.
![Support bundle panel](/static/img/docs/troubleshooting/support-bundle.png)
1. Click **New Support Bundle**.
1. Select the components that you want to include in the support bundle.
1. Click **Create**.
1. After the support bundle is ready, click **Download**.
Grafana downloads the support bundle to an archive (tar.gz) file.
1. Attach the archive (tar.gz) file to a support ticket that you send to Grafana Labs Technical Support.