2022-05-26 10:06:25 -05:00
---
aliases:
2022-12-09 10:36:04 -06:00
- ../../troubleshooting/diagnostics/
- ../enable-diagnostics/
Explicitly set all front matter labels in the source files (#71548)
* Set every page to have defaults of 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/enterprise-licensing pages to have 'Enterprise' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/recorded-queries pages to have labels cloud,enterprise
* Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/stats-and-license pages to have labels cloud,enterprise
* Set alerting pages to have labels cloud,enterprise,oss
* Set breaking-changes pages to have labels cloud,enterprise,oss
* Set dashboards pages to have labels cloud,enterprise,oss
* Set datasources pages to have labels cloud,enterprise,oss
* Set explore pages to have labels cloud,enterprise,oss
* Set fundamentals pages to have labels cloud,enterprise,oss
* Set introduction/grafana-cloud pages to have labels cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix introduction pages products
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set panels-visualizations pages to have labels cloud,enterprise,oss
* Set release-notes pages to have labels cloud,enterprise,oss
* Set search pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set troubleshooting pages to have labels cloud,enterprise,oss
* Set whatsnew pages to have labels cloud,enterprise,oss
* Apply updated labels from review
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 03:10:12 -05:00
description: Learn how to configure tracing so that you can troubleshoot Grafana.
labels:
products:
- enterprise
- oss
2022-06-28 12:13:45 -05:00
menuTitle: Configure tracing
2022-12-09 10:36:04 -06:00
title: Configure tracing to troubleshoot Grafana
2022-06-28 12:13:45 -05:00
weight: 200
2022-05-26 10:06:25 -05:00
---
2020-08-11 08:56:06 -05:00
2022-06-28 12:13:45 -05:00
# Configure tracing to troubleshoot Grafana
2020-08-11 08:56:06 -05:00
2023-04-27 10:55:48 -05:00
You can set up the `grafana-server` process to enable certain diagnostics when it starts. This can be useful
2021-08-06 08:52:36 -05:00
when investigating certain performance problems. It's _not_ recommended to have these enabled by default.
2020-08-11 08:56:06 -05:00
## Turn on profiling
2023-04-27 10:55:48 -05:00
The `grafana-server` can be started with the command-line option `-profile` to enable profiling, `-profile-addr` to override the default HTTP address (`localhost`), and
2021-08-18 06:28:39 -05:00
`-profile-port` to override the default HTTP port (`6060`) where the `pprof` debugging endpoints are available. For example:
2020-08-11 08:56:06 -05:00
```bash
2023-04-26 13:18:03 -05:00
./grafana server -profile -profile-addr=0.0.0.0 -profile-port=8080
2020-08-11 08:56:06 -05:00
```
Note that `pprof` debugging endpoints are served on a different port than the Grafana HTTP server.
You can configure or override profiling settings using environment variables:
```bash
export GF_DIAGNOSTICS_PROFILING_ENABLED=true
2021-08-18 06:28:39 -05:00
export GF_DIAGNOSTICS_PROFILING_ADDR=0.0.0.0
2020-08-11 08:56:06 -05:00
export GF_DIAGNOSTICS_PROFILING_PORT=8080
```
Refer to [Go command pprof ](https://golang.org/cmd/pprof/ ) for more information about how to collect and analyze profiling data.
## Use tracing
The `grafana-server` can be started with the arguments `-tracing` to enable tracing and `-tracing-file` to override the default trace file (`trace.out`) where trace result is written to. For example:
```bash
2023-04-26 13:18:03 -05:00
./grafana server -tracing -tracing-file=/tmp/trace.out
2020-08-11 08:56:06 -05:00
```
You can configure or override profiling settings using environment variables:
```bash
export GF_DIAGNOSTICS_TRACING_ENABLED=true
export GF_DIAGNOSTICS_TRACING_FILE=/tmp/trace.out
```
View the trace in a web browser (Go required to be installed):
```bash
go tool trace < trace file >
2019/11/24 22:20:42 Parsing trace...
2019/11/24 22:20:42 Splitting trace...
2019/11/24 22:20:42 Opening browser. Trace viewer is listening on http://127.0.0.1:39735
```
2021-08-19 06:43:41 -05:00
For more information about how to analyze trace files, refer to [Go command trace ](https://golang.org/cmd/trace/ ).