gRPC
Send distributed traces to Last9 from a Golang gRPC using OpenTelemetry
gRPC is a high-performance, open-source universal RPC framework. This comprehensive guide will help you instrument your gRPC application with OpenTelemetry and smoothly send the traces to a Last9 cluster. You can also check out the example application on GitHub↗.
Pre-requisites
- You have a gRPC application. For this document, we will use a simple gRPC server and client application. You can use any gRPC application and follow the same steps.
- You have signed up for Last9, created a cluster, and obtained the following OTLP credentials from the Integrations page:
endpoint
auth_header
Install OpenTelemetry packages
To install the required packages, run the following command:
Setup the OpenTelemetry SDK
To setup the OpenTelemetry SDK, you need to add the following code to your application:
Instrument the gRPC server application
To instrument the gRPC server application, you need to add the following code to your application:
Instrument the gRPC client application
To instrument the gRPC client application, you need to add the following code to your application:
Run the application
Set the endpoint
and auth_header
environment variables with the values you obtained from the Integrations page.
Run the server application:
Run the client application:
View traces in Last9
After running the gRPC apps, you can visualize the traces in Last9’s APM dashboard.
Troubleshooting
Please get in touch with us on Discord or Email if you have any questions.