Send to the Grafana Cloud OTLP endpoint
You can send telemetry data from an instrumented application directly to the Grafana Cloud OTLP endpoint for local development or for the purpose of assessing Application Observability.
By default, Application Observability uses a default data source which you can use outside of Application Observability to build further dashboards. You can change the data source from the Application Observability configuration page.
You can learn more about how to send data to the Grafana Cloud OTLP endpoint as well as format considerations such as data storage choices and ingestion limits.
Before you begin
- Instrument your application with OpenTelemetry SDKs
- Create a free Grafana Account or use an existing account
Configure your application
Applications instrumented for OpenTelemetry determine where to send telemetry data from application and connection configuration set through environment variables.
Set application environment variables
Customize the following shell script template for your application:
export OTEL_SERVICE_NAME=
export OTEL_RESOURCE_ATTRIBUTES=deployment.environment=,service.namespace=,service.version=,service.instance.id=
Add each value after the equals and remove any optional fields you don’t use.
Variable and field | Description | Example value |
---|---|---|
OTEL_SERVICE_NAME | Required unique service identifier | ads , cart |
OTEL_RESOURCE_ATTRIBUTES | Optional unique deployment environment identifier | staging , production |
OTEL_RESOURCE_ATTRIBUTES | Optional identifier to group multiple services under | android , shop |
OTEL_RESOURCE_ATTRIBUTES | Optional service version | 1.0.0 ,1.2.0 beta 3 |
OTEL_RESOURCE_ATTRIBUTES | Optional unique instance id, e.g the Pod name. Default auto-generated UUID |
Get connection environment variables
Sign in to Grafana Cloud, Launch a stack, and navigate to the OpenTelemetry configuration:
Generate a new API token and close the dialog box without copying the token. Copy the environment variables and add them to your shell script.
Note
If you use Python, replace “Basic " in your shell script with “Basic%20”.
Test your observability
Navigate to Application Observability in Grafana Cloud, and enable metrics generation for your data sources, and after 5 minutes once Application Observability has generated metrics you can see your services.
Alternatively, verify that the agent sent your data by exploring your traces and logs in Tempo and Loki.