Set up a tenant in your Grafana Enterprise Traces cluster
Create a Grafana Enterprise Traces (GET) tenant:
-
Within Grafana Enterprise, navigate to Grafana Enterprise Traces > Tenants.
-
Click on Create new tenant.
-
Choose a name for this tenant. For demonstration purposes, use the name
dev-tenant
. -
Select the cluster.
-
Click Create tenant.
Create an access policy
Create a data source access policy and token, which are used by Grafana Enterprise itself to access the traces in the tenant named dev-tenant
:
-
Navigate to Grafana Enterprise Traces > Access policies.
-
Click Create new access policy.
-
Choose a name for the policy. For demonstration purposes, use
dev-read-write-policy
. -
Enable the scope traces:read and traces:write, to create an access policy that grants access for both reading and writing trace data.
-
Select the tenant
dev-tenant
. -
Click on Create.
-
From the newly created access policy, click + Add token.
-
Name the token
dev-token
, and click on Create. -
In the next window, copy the token.
You can add the following example of a remote-write configuration to your Grafana Agent configuration files:
remote_write:
- endpoint: <get-gateway-host>:<http_listen_port>
insecure: true
basic_auth:
username: dev-tenant
password: ZGV2LXJlYWQtd3JpdGVyLXBvbGljeS1kZW1vLXRva2VuOjY/ezduMTVhJDQvPGMvLzQ1SzgsJjFbMQ==
Setup remote-write to your tenant
To enable writes to your cluster, add the above remote-write configuration snippet to the configuration file of an existing Grafana Agent. If you do not have an existing traces collector, refer to Getting started with Grafana Agent.
An example agent configuration would be:
server:
http_listen_port: 12345
traces:
configs:
- name: default
receivers:
jaeger:
protocols:
grpc: # listens on the default jaeger grpc port: 14250
thrift_binary: # 6832
thrift_compact: # 6831
thrift_http: # 14268
remote_write:
- endpoint: <get-gateway-host>:<http_listen_port>
insecure: true # only add this if TLS is not required
basic_auth:
username: dev-tenant
password: ZGV2LXJlYWQtd3JpdGVyLXBvbGljeS1kZW1vLXRva2VuOjY/ezduMTVhJDQvPGMvLzQ1SzgsJjFbMQ==
batch:
timeout: 5s
Set up your tenant as a Grafana datasource
Following that we can use this access policy and token to create a new datasource in Grafana:
-
Navigate to Configuration ≫ Data Sources.
-
Click on Add new data source.
-
Select Tempo.
-
Set the URL to
http://<get-gateway-host>:<http_listen_port>/<http_api_prefix>
, filling in the path to your gateway and the configured HTTP API prefix. -
Enable Basic Auth and use User
dev-tenant
and as Password the token from your clipboard. -
Click Save & Test. You should see a message that says “Data source is working.” If you see an error that says “Data source is not working: failed to get trace with id: 0”, check your Grafana version. If your Grafana version is < 8.2.2, this is a bug in Grafana itself and the error can be ignored. The underlying data source will still work as expected. Upgrade your Grafana to 8.2.2 or later to get the fix for the error message.
Visualize your data
Once you have created a datasource you should now be able to visualize your traces in the Grafana Explore page.
Related Enterprise Traces resources
Distributed tracing with Grafana: From Tempo OSS to Enterprise
Learn about our open source tracing database, Tempo, a scalable way to store and query distributed traces generated by any open source tracing protocol.
Get started with distributed tracing with Grafana Tempo and Grafana Enterprise Traces
In this ObservabilityCON session, find out the latest features in the open source tracing project and the new addition to Grafana Enterprise Stack.
Correlate your metrics, logs, and traces with Grafana Stack
Show how Grafana’s opinionated stack will allow you to correlate your metrics, logs, and traces, all under one roof.