Skip to content

Commit

Permalink
grpc_check: Fix timeout default value (#1601)
Browse files Browse the repository at this point in the history
* fix timeout default value

* sync config

* bump version

* update changelog

* bump version in readme

* Update grpc_check/CHANGELOG.md

Co-authored-by: Florent Clarret <[email protected]>

Co-authored-by: Florent Clarret <[email protected]>
  • Loading branch information
keisku and FlorentClarret authored Nov 10, 2022
1 parent d3b32bd commit 6b4c793
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 16 deletions.
3 changes: 3 additions & 0 deletions grpc_check/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# CHANGELOG - gRPC Check

## 1.0.2 / 2022-11-09
[Fixed] Fix timeout default value. See [#1601](https://github.com/DataDog/integrations-extras/pull/1601).

## 1.0.1 / 2022-08-02
4 changes: 2 additions & 2 deletions grpc_check/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Follow the instructions below to install and configure this check for an Agent r
To install the grpc_check check on your host:

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

#### Dockerfile
Expand All @@ -24,7 +24,7 @@ Build the Agent image with this Dockerfile.

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

Expand Down
2 changes: 1 addition & 1 deletion grpc_check/datadog_checks/grpc_check/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.1"
__version__ = "1.0.2"
2 changes: 1 addition & 1 deletion grpc_check/datadog_checks/grpc_check/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self, name, init_config, instances):
super(GrpcCheck, self).__init__(name, init_config, instances)
self.grpc_server_address = self.instance.get("grpc_server_address", "")
self.grpc_server_service = self.instance.get("grpc_server_service", "")
self.timeout = self.instance.get("timeout", 0) / 1000
self.timeout = self.instance.get("timeout", 1000) / 1000
self.rpc_header = self.instance.get("rpc_header", [])
self.client_cert = self.instance.get("client_cert", "")
self.client_key = self.instance.get("client_key", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ init_config:
#
# service: <SERVICE>

## Every instance is scheduled independent of the others.
## Every instance is scheduled independently of the others.
#
instances:

Expand Down
11 changes: 0 additions & 11 deletions grpc_check/tests/test_grpc_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def create_secure_grpc_server(expected_status=health_pb2.HealthCheckResponse.SER
def test_insecure_server_is_serving(dd_run_check, aggregator):
instance = {
"grpc_server_address": "localhost:50051",
"timeout": 1000,
"grpc_server_service": "grpc.test",
"tags": ["tag_key1:value1", "tag_key2:value2"],
}
Expand Down Expand Up @@ -88,7 +87,6 @@ def test_insecure_server_is_serving(dd_run_check, aggregator):
def test_insecure_server_is_not_serving(dd_run_check, aggregator):
instance = {
"grpc_server_address": "localhost:50051",
"timeout": 1000,
"grpc_server_service": "grpc.test",
"tags": ["tag_key1:value1", "tag_key2:value2"],
}
Expand Down Expand Up @@ -138,7 +136,6 @@ def test_insecure_server_is_not_serving(dd_run_check, aggregator):
def test_insecure_server_is_unknown(dd_run_check, aggregator):
instance = {
"grpc_server_address": "localhost:50051",
"timeout": 1000,
"grpc_server_service": "grpc.test",
"tags": ["tag_key1:value1", "tag_key2:value2"],
}
Expand Down Expand Up @@ -188,7 +185,6 @@ def test_insecure_server_is_unknown(dd_run_check, aggregator):
def test_unavailable(dd_run_check, aggregator):
instance = {
"grpc_server_address": "localhost:80",
"timeout": 1000,
"grpc_server_service": "grpc.test",
"tags": ["tag_key1:value1", "tag_key2:value2"],
}
Expand Down Expand Up @@ -288,7 +284,6 @@ def test_timeout(dd_run_check, aggregator):
def test_not_found(dd_run_check, aggregator):
instance = {
"grpc_server_address": "localhost:50051",
"timeout": 1000,
"grpc_server_service": "not_found",
"tags": ["tag_key1:value1", "tag_key2:value2"],
}
Expand Down Expand Up @@ -338,7 +333,6 @@ def test_not_found(dd_run_check, aggregator):
def test_secure_server_is_serving(dd_run_check, aggregator):
instance = {
"grpc_server_address": "localhost:50052",
"timeout": 1000,
"grpc_server_service": "grpc.test",
"tags": ["tag_key1:value1", "tag_key2:value2"],
"ca_cert": "tests/fixtures/ca.pem",
Expand Down Expand Up @@ -391,7 +385,6 @@ def test_secure_server_is_serving(dd_run_check, aggregator):
def test_secure_server_is_not_serving(dd_run_check, aggregator):
instance = {
"grpc_server_address": "localhost:50052",
"timeout": 1000,
"grpc_server_service": "grpc.test",
"tags": ["tag_key1:value1", "tag_key2:value2"],
"ca_cert": "tests/fixtures/ca.pem",
Expand Down Expand Up @@ -444,7 +437,6 @@ def test_secure_server_is_not_serving(dd_run_check, aggregator):
def test_secure_server_is_unknown(dd_run_check, aggregator):
instance = {
"grpc_server_address": "localhost:50052",
"timeout": 1000,
"grpc_server_service": "grpc.test",
"tags": ["tag_key1:value1", "tag_key2:value2"],
"ca_cert": "tests/fixtures/ca.pem",
Expand Down Expand Up @@ -497,7 +489,6 @@ def test_secure_server_is_unknown(dd_run_check, aggregator):
def test_ca_cert_missing():
instance = {
"grpc_server_address": "localhost:50052",
"timeout": 1000,
"grpc_server_service": "grpc.test",
"tags": ["tag_key1:value1", "tag_key2:value2"],
# missing ca_cert
Expand All @@ -514,7 +505,6 @@ def test_ca_cert_missing():
def test_client_cert_missing():
instance = {
"grpc_server_address": "localhost:50052",
"timeout": 1000,
"grpc_server_service": "grpc.test",
"tags": ["tag_key1:value1", "tag_key2:value2"],
"ca_cert": "tests/fixtures/ca.pem",
Expand All @@ -531,7 +521,6 @@ def test_client_cert_missing():
def test_client_key_missing():
instance = {
"grpc_server_address": "localhost:50052",
"timeout": 1000,
"grpc_server_service": "grpc.test",
"tags": ["tag_key1:value1", "tag_key2:value2"],
"ca_cert": "tests/fixtures/ca.pem",
Expand Down

0 comments on commit 6b4c793

Please sign in to comment.