Monitor Your GRPC APIs With Datadog Synthetic Monitoring | Datadog

Monitor your gRPC APIs with Datadog Synthetic Monitoring

Author Thomas Sobolik

Published: 4月 7, 2022

gRPC is an open source Remote Procedure Call (RPC) framework developed by Google and released in 2016. Although gRPC is still relatively new, large organizations are adopting it in increasing numbers to build APIs to connect complex microservice meshes that use disparate languages and frameworks. gRPC-based APIs can process requests up to seven times faster than REST APIs, and they also allow customers to easily implement SSL authentication, load balancing, and tracing via plug-in libraries.

Datadog Synthetic Monitoring now enables you to create and manage gRPC health checks to continually monitor the availability of your gRPC services and ensure that your APIs are able to handle requests. Like other Datadog Synthetic tests, gRPC health checks include a wide range of configuration options that can be customized to fit your team’s needs. In this post, we’ll discuss how you can create gRPC health checks within the Datadog platform and monitor their results from the Synthetic Monitoring view.

How does gRPC work?

In an RPC architecture, the client application can call a method on a networked service as if it were a local object in the same address space. This function invocation is known as the Remote Procedure Call, or RPC. gRPC implements an RPC architecture in which RPCs contain data payloads serialized in protocol buffers, rather than in JSON files (as is the case in the REST API framework). Whereas JSON files are human-readable, protocol buffer serialization encodes the data in binary, facilitating faster processing and a broader range of compatible data types.

Configure gRPC health checks

Datadog Synthetic Monitoring enables you to create and manage gRPC health checks that can proactively validate whether or not a service is available to receive RPCs. Once you’ve selected “gRPC health check” on the test creation view, simply specify the host and port, service name, environment, and locations where you’d like the test to run. You can run all Datadog Synthetic tests, including gRPC health checks, in private locations, which makes it easy to monitor your applications’ internal services. You can also include variable data that is necessary for the health check to execute (e.g., authentication credentials) and define the result of a successful check by asserting the expected response time and status code.

Create gRPC health checks in Datadog.

Like other Synthetic tests, gRPC health checks can be run on demand, on a regular schedule, or from within your CI/CD pipelines via Synthetic Monitoring’s integrations with Jenkins and Github Actions. If a health check fails in the pipeline, you can optionally block the deployment and automatically trigger a rollback in order to keep problematic code changes from reaching production.

Finally, you can use Datadog’s robust alerting capabilities to notify your teams when a gRPC health check is unhealthy for a certain period of time or in a certain number of locations. You can also include additional context and variable data, such as hostname, in the alert message, which ensures on-call engineers have enough information to begin their investigation.

Monitor your gRPC health checks in Datadog

The Synthetic Monitoring main view includes a list of all the Synthetic tests shared by your organization, including gRPC health checks. You can query, sort, and filter this list by test type, as well as keywords and tags, to quickly find the ones you care about. For example, you can filter by error status to surface failed checks for troubleshooting, or sort by uptime to view which checks are failing the most often.

Filter to see all gRPC health checks.

You can click on any gRPC health check to access more granular details that can help you spot performance trends and begin to hypothesize about why the test is failing. For instance, uptime graphs allow you to see at a glance how a health check’s status differs between locations, which enables you to determine if any regional server outages are at play. You can also drill into individual test runs to view a breakdown of network timings and verify that the response message and headers are consistent with your expectations.

View details about individual gRPC health check runs.

For additional context around a health check’s result, you can view a full trace of the inter-service function calls leading up to the RPC request. Errorful spans are highlighted in red, which makes it easy to examine any errors that may have contributed to the failure. Relevant stacktraces, infrastructure metrics, and logs are included in the same view, allowing you to easily access all the information you need to begin troubleshooting.

Get started with gRPC health checks

Datadog’s gRPC health checks, which are now available for all Synthetic Monitoring customers, enable teams to continually monitor the availability and performance of their gRPC endpoints in order to detect and resolve issues as quickly as possible. See our documentation for more information on how to start creating these tests today. If you’re not yet using Datadog to monitor your applications and infrastructure, get started with a .