Skip to content

Commit

Permalink
New integration for gRPC Health Check (#1381)
Browse files Browse the repository at this point in the history
* support gRPC Check

* ddev validate ci --fix

* update CODEOWNERS

* fix based on ddev validate all

* rename func and remove unused arg

* fix links in readme

* remove unnecessary part in readme

* remove python2 support

* fix conftest.py

* update fixtures to increase expiry

* upload grpc-logo.png

* fix a link in readme

* update codecov order

* fix a link in readme

* re-run cfssl

* rename GrpcCheckCheck to GrpcCheck

* reformat

* replace - with _

* Revert "replace - with _"

This reverts commit 219198e.

* Update manifest.json

* use self to get grpc_server_address

* change log level to debug when healthy

* copy .codecov.yaml from master and add grpc to it

* remove auto_conf.yaml

* update metadata

* update README

* update README

* Update grpc_check/manifest.json

* Update grpc_check/manifest.json

Co-authored-by: Ofek Lev <[email protected]>
Co-authored-by: Sarah Witt <[email protected]>
  • Loading branch information
3 people authored Sep 15, 2022
1 parent 185c1b6 commit 865b49b
Show file tree
Hide file tree
Showing 47 changed files with 2,032 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .azure-pipelines/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ jobs:
- checkName: gnatsd_streaming
displayName: Gnatsd Streaming
os: linux
- checkName: grpc_check
displayName: gRPC Check
os: linux
- checkName: jfrog_platform
displayName: JFrog Platform
os: linux
Expand Down
9 changes: 9 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ coverage:
target: 75
flags:
- gnatsd_streaming
gRPC_Check:
target: 75
flags:
- grpc_check
JFrog_Platform:
target: 75
flags:
Expand Down Expand Up @@ -324,6 +328,11 @@ flags:
paths:
- gnatsd_streaming/datadog_checks/gnatsd_streaming
- gnatsd_streaming/tests
grpc_check:
carryforward: true
paths:
- grpc_check/datadog_checks/grpc_check
- grpc_check/tests
jfrog_platform:
carryforward: true
paths:
Expand Down
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
/gnatsd/ @stephenprater @jaredhoyt [email protected]
/gnatsd_streaming/ @stephenprater @jaredhoyt [email protected]
/gremlin/ [email protected]
/grpc_check/ @keisku
/harness_cloud_cost_management/ @akashbdj [email protected]
/hasura_cloud/ @ShraddhaAg @shahidhk [email protected]
/hbase_master/ @everpeace
Expand Down Expand Up @@ -268,6 +269,9 @@
/gremlin/*metadata.csv [email protected] @DataDog/documentation
/gremlin/manifest.json [email protected] @DataDog/documentation
/gremlin/README.md [email protected] @DataDog/documentation
/grpc_check/*metadata.csv @keisku @DataDog/documentation
/grpc_check/manifest.json @keisku @DataDog/documentation
/grpc_check/README.md @keisku @DataDog/documentation
/hasura_cloud/*metadata.csv @ShraddhaAg @shahidhk [email protected] @DataDog/documentation
/hasura_cloud/manifest.json @ShraddhaAg @shahidhk [email protected] @DataDog/documentation
/hasura_cloud/README.md @ShraddhaAg @shahidhk [email protected] @DataDog/documentation
Expand Down
3 changes: 3 additions & 0 deletions grpc_check/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# CHANGELOG - gRPC Check

## 1.0.0 / 2022-08-02
70 changes: 70 additions & 0 deletions grpc_check/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Agent Check: grpc_check

## Overview

This check monitors endpoints implementing [gRPC Health Checking Protocol][1] through the Datadog Agent.

## Setup

Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the [Autodiscovery Integration Templates][3] for guidance on applying these instructions.

### Installation

#### Host

To install the grpc_check check on your host:

```bash
sudo -u dd-agent datadog-agent integration install -t datadog-grpc-check==1.0.0
```

#### Dockerfile

Build the Agent image with this Dockerfile.

```Dockerfile
FROM datadog/agent:7
RUN agent integration install -r -t datadog-grpc-check==1.0.0 \
&& /opt/datadog-agent/embedded/bin/pip3 install grpcio grpcio-health-checking
```

### Configuration

1. Edit the `grpc_check.d/conf.yaml` file, in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your grpc_check performance data. See the [sample grpc_check.d/conf.yaml][4] for all available configuration options.

2. [Restart the Agent][5].

### Validation

[Run the Agent's status subcommand][6] and look for `grpc_check` under the Checks section.

## Data Collected

### Metrics

See [metadata.csv][7] for a list of metrics provided by this integration.

### Events

The grpc_check integration does not include any events.

### Service Checks

The grpc_check integration does not include any service checks.

See [service_checks.json][8] for a list of service checks provided by this integration.

## Troubleshooting

Need help? Contact [Datadog support][9].

[1]: https://github.com/grpc/grpc/blob/master/doc/health-checking.md
[2]: https://app.datadoghq.com/account/settings#agent
[3]: https://docs.datadoghq.com/agent/kubernetes/integrations/
[4]: https://github.com/DataDog/integrations-extras/blob/master/grpc_check/datadog_checks/check/data/conf.yaml.example
[5]: https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent
[6]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information
[7]: https://github.com/DataDog/integrations-extras/blob/master/grpc_check/metadata.csv
[8]: https://github.com/DataDog/integrations-extras/blob/master/grpc_check/assets/service_checks.json
[9]: [email protected]
[10]: https://docs.datadoghq.com/developers/integrations/new_check_howto/#developer-toolkit
56 changes: 56 additions & 0 deletions grpc_check/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: gRPC Check
files:
- name: grpc_check.yaml
options:
- template: init_config
options:
- template: init_config/default
- template: instances
options:
- name: grpc_server_address
required: true
description: tcp host:port to connect
value:
type: string
example: <HOST>:<PORT>
- name: grpc_server_service
required: false
description: service name to check
value:
type: string
- name: timeout
required: false
description: duration of time in milliseconds to allow for the RPC.
value:
type: integer
example: 1000
display_default: 1000
- name: rpc_header
required: false
description: "additional RPC headers in name: value format."
value:
type: array
items:
type: string
example:
- 'rpc-header-1: value1'
- 'rpc-header-2: value2'
- name: ca_cert
required: false
description: CA cert.
value:
type: string
example: /path/to/ca.pem
- name: client_cert
required: false
description: client certificate used for client identification and auth.
value:
type: string
example: /path/to/client.pem
- name: client_key
required: false
description: client certificate key.
value:
type: string
example: /path/to/client-key.pem
- template: instances/default
Empty file.
20 changes: 20 additions & 0 deletions grpc_check/assets/service_checks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"agent_version": "7.0.0",
"integration": "gRPC Check",
"check": "grpc.healthy",
"statuses": [
"ok",
"critical"
],
"groups": [
"host",
"instance",
"grpc_server_service",
"grpc_server_address",
"status_code"
],
"name": "gRPC",
"description": "Returns CRITICAL if the gRPC server is unhealthy. Returns OK if the gRPC server is healthy."
}
]
1 change: 1 addition & 0 deletions grpc_check/datadog_checks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
1 change: 1 addition & 0 deletions grpc_check/datadog_checks/grpc_check/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0.0"
4 changes: 4 additions & 0 deletions grpc_check/datadog_checks/grpc_check/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .__about__ import __version__
from .check import GrpcCheck

__all__ = ["__version__", "GrpcCheck"]
Loading

0 comments on commit 865b49b

Please sign in to comment.