Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RethinkDB integration #5715

Merged
merged 165 commits into from
Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from 125 commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
afb654a
Add project skeleton
Feb 12, 2020
324b473
Add initial type hints
Feb 12, 2020
78e79e1
Add rethinkdb to test-all-checks.yml
Feb 12, 2020
2f34ca9
Add short description
Feb 12, 2020
1791c1f
Rename check class: Rethinkdb -> RethinkDB
Feb 12, 2020
a86ff28
Add dependency on rethinkdb (Python driver)
Feb 12, 2020
fbd6ff2
Update signature used to instantiate check
Feb 12, 2020
0f6a392
Use Python 3.8 instead of 3.7 for Tox
Feb 12, 2020
3ae1865
Setup Docker Compose
Feb 12, 2020
9d9a6e5
Add E2E test
Feb 12, 2020
72e9130
Submit service check
Feb 12, 2020
699b073
Allow viewing admin UI on localhost
Feb 12, 2020
79c5d69
🔥🐍2️⃣
Feb 12, 2020
cc5a2e1
Simplify Python 2 import fix
Feb 12, 2020
678ed57
Refactor submission of service check
Feb 12, 2020
2f481a7
Collect cluster and server statistics
Feb 13, 2020
a1a65b5
Document more TODOs
Feb 13, 2020
25ce3f0
Update jobs and current issues metrics listings
Feb 13, 2020
1db5428
Refactor collection of default metrics
Feb 13, 2020
9079a9a
Add more nodes to cluster in Compose setup
Feb 14, 2020
2c8cbc7
Turn rates into gauges
Feb 14, 2020
a32961a
Add logging to stats collection funcs
Feb 14, 2020
9ade5d3
Check server tags, submit server tag in service check
Feb 14, 2020
592766c
Make host and port instance-configurable, improve service check status
Feb 14, 2020
46c28b6
Add config unit tests
Feb 14, 2020
a1f7d7e
Test service check failure modes, add more logging
Feb 14, 2020
106b737
Fix mypy Config type detection
Feb 14, 2020
55524aa
Setup test data, fix and test table metrics
Feb 14, 2020
58bb8b8
Simplify usage of of eq_join
Feb 14, 2020
95af7c7
Collect first replica metric
Feb 14, 2020
b49c4a7
Update disk metric names
Feb 17, 2020
97dce7d
Add the rest of replica stats metrics
Feb 17, 2020
2934e0a
Drop index todo
Feb 17, 2020
4a568e6
Add table status metrics
Feb 17, 2020
4d32e58
Add server status metrics
Feb 17, 2020
61a6c6f
Fix timestamp on py2
Feb 17, 2020
6a36445
Add system job metrics, refactor assertions
Feb 17, 2020
f63d2d1
Add comments about cluster setup
Feb 17, 2020
9912022
Drop complicated integration setup in favor of jobs metrics unit tests
Feb 17, 2020
e69c6c3
Test unknown job types, simplify MockConnectionInstance
Feb 17, 2020
2580123
Cleanup, fix e2e test
Feb 17, 2020
e0098d4
Use a more realistic client_port
Feb 17, 2020
01018a0
Add default metrics flags
Feb 18, 2020
4debc73
Refactor service check submission, re-raise check errors for Agent-si…
Feb 18, 2020
64b7238
Switch from rethinkdb.r.[...] to r.[...]
Feb 18, 2020
77acd89
Merge branch 'master' into florimondmanca/rethinkdb
Feb 19, 2020
3d480dd
Drop 'default_metrics' option
Feb 20, 2020
0f2b93a
Rename _default_metrics module to _metrics
Feb 20, 2020
7202dd7
Merge branch 'master' into florimondmanca/rethinkdb
Feb 24, 2020
dc558db
Drop query jobs metrics
Feb 24, 2020
f45660e
Submit table status gauges as service checks
Feb 24, 2020
1599f67
Submit replica state as a tag instead of metrics
Feb 24, 2020
d172f7b
Handle disconnected replica server -- needs unit tests
Feb 24, 2020
3a1b9d8
Merge branch 'master' into florimondmanca/rethinkdb
Feb 27, 2020
56479b3
Refactor submission of service check
Feb 27, 2020
cd6a107
Lint
Feb 27, 2020
e34aee9
Add more debug logs
Feb 27, 2020
31cdbe5
Improve robustness to disconnected servers
Feb 27, 2020
1b0916e
Improve robustness of disconnect tests
Feb 27, 2020
80de531
Nit: standardize imports
Feb 27, 2020
86f342c
Add more debug logs
Feb 27, 2020
e1b01f4
Ensure connection is closed after check
Feb 27, 2020
5504f48
Get rid of 'r' imports, improve encapsulation of Config
Feb 27, 2020
fc76435
Rename test file, add missing copyright notice
Feb 27, 2020
9e7525c
Cleanup rethinkdb.py
Feb 27, 2020
0da808f
Lint
Feb 28, 2020
1181b75
Fix docstrings
Feb 28, 2020
45ca24a
Add config totals metrics
Feb 28, 2020
3d07c6c
Add version metadata
Feb 28, 2020
412e743
Add basic auth support, simplify cluster setup
Feb 28, 2020
9e3c654
Add --disallow-untyped-defs mypy option
Feb 28, 2020
157efd4
Inject port for all 3 servers in Compose file
Feb 28, 2020
c9a0085
Setup driver TLS on server1, prepare test
Feb 28, 2020
9912ed1
Implement TLS client cert support
Mar 2, 2020
b900c48
Introduce Connection interface
Mar 2, 2020
f792bc7
Collect and submit current issues metrics
Mar 2, 2020
03e82b9
Polish
Mar 2, 2020
b89c4ed
Write up README
Mar 2, 2020
3734e97
Lint
Mar 2, 2020
083eb95
Add config spec
Mar 2, 2020
d2cf6a1
Fill service_checks.json
Mar 2, 2020
e4f6d70
Polish manifest.json
Mar 2, 2020
2a06e6d
Merge branch 'master' into florimondmanca/rethinkdb
Mar 2, 2020
10c014e
Update service check tags and service_checks.json
Mar 3, 2020
542531f
Handle malformed version strings, improve test coverage
Mar 3, 2020
0f8b997
Add py.typed
Mar 3, 2020
1a59087
Merge branch 'master' into florimondmanca/rethinkdb
Mar 4, 2020
c2db56a
Cleanup
Mar 4, 2020
5df6a56
Stick to non-private internal module names
Mar 4, 2020
6be71f0
Merge branch 'master' into florimondmanca/rethinkdb
Mar 4, 2020
0534f21
Move assertions to module, fix e2e test
Mar 4, 2020
b8246a0
Rename 'user' option to 'username', clarify purpose of admin test
Mar 5, 2020
d087d42
Merge branch 'master' into florimondmanca/rethinkdb
Mar 5, 2020
62cee74
Honor enable_metadata_collection config option
Mar 5, 2020
a4fb134
Rename tests/_types.py -> tests/types.py
Mar 5, 2020
57be056
Reorganization test utils
Mar 5, 2020
e058f59
Parametrize log_patterns by server constants
Mar 5, 2020
5b1b69c
Generate metadata.csv
Mar 5, 2020
81ae697
Fix wrong type of stats monotonic_count metrics
Mar 5, 2020
c123be5
Assert type of metrics
Mar 5, 2020
6d44871
Fix E2E
Mar 5, 2020
172f6d1
Merge branch 'master' into florimondmanca/rethinkdb
Mar 5, 2020
4acd070
Merge branch 'master' into florimondmanca/rethinkdb
Mar 6, 2020
6e63922
Improvement robustness of test cluster setup
Mar 6, 2020
d526ec5
Drop dependency on mypy latest - for now
Mar 6, 2020
9a90b39
Merge branch 'master' into florimondmanca/rethinkdb
Mar 9, 2020
ca5c299
Address docs review
Mar 9, 2020
f90797c
Merge branch 'master' into florimondmanca/rethinkdb
Mar 13, 2020
91cc306
Move any `Config` smarts to a `Backend` interface, update tests
Mar 13, 2020
467e126
Wait for all server log patterns
Mar 13, 2020
e819a7d
Merge branch 'master' into florimondmanca/rethinkdb
Mar 16, 2020
54a50f5
Update note about `tty: true`
Mar 16, 2020
e23a2a4
Address feedback from @ofek
Mar 16, 2020
b4a1c92
Tag current issues metrics by `issue_type`
Mar 16, 2020
8701bca
Add support for custom tags
Mar 17, 2020
865420f
Derive image and version from env
Mar 17, 2020
43b580f
Tweak coverage
Mar 18, 2020
0fb3f79
Cleanup, address feedback, more motivation docs
Mar 18, 2020
e60c27d
TEMP: refactor metric collection
Mar 18, 2020
26e7dc9
Simplify backends into a single class
Mar 19, 2020
c64e1e5
Simplify connection into a single class
Mar 19, 2020
0f18673
Merge branch 'master' into florimondmanca/rethinkdb
Mar 19, 2020
114b1f5
Drop if/else switch on metric type
Mar 19, 2020
4b81322
Always submit the same tags regardless of connect service check status
Mar 19, 2020
f123755
Dry up access to the system database
Mar 19, 2020
617a33f
Clarify why job metrics are hard to test in integration/e2e
Mar 19, 2020
63a2ddc
Fix typo
Mar 19, 2020
ef58fac
Revert "TEMP: refactor metric collection"
Mar 19, 2020
f7d4c1c
Drop Connection class
Mar 19, 2020
fc047d5
Drop exceptions module
Mar 19, 2020
9973b5a
Fix unclear phrasing
Mar 19, 2020
f056285
Get rid of Backend and QueryManager
Mar 19, 2020
a83cd97
Align metric names on JSON structure
Mar 19, 2020
130fc74
Introduce and use `DocumentQuery`
Mar 19, 2020
69686d2
Pass check logger through
Mar 19, 2020
177065e
Update metadata.csv
Mar 19, 2020
173658e
Fix typo in `to_timestamp` util
Mar 19, 2020
92ad5bd
Add unit tests for `document_db` helpers
Mar 19, 2020
0ccb9ce
Address feedback (part 1)
Mar 19, 2020
444df24
Let long-lived query jobs pass through
Mar 20, 2020
2d61475
Drop unused Config repr
Mar 20, 2020
862b5ab
Tweak version collection
Mar 20, 2020
dc1a237
Test on 2.3 and latest
Mar 20, 2020
5b4e2e9
Update README with 2.3-compatible instructions, fix service check names
Mar 20, 2020
efb97f7
Nits
Mar 20, 2020
5e7fc9f
Address feedback
Mar 20, 2020
f7a8f62
Merge branch 'master' into florimondmanca/rethinkdb
Mar 24, 2020
edf3da5
Store service_check_tags as a tuple
Mar 24, 2020
6d58c6c
Resolve flaky cluster setup on RethinkDB 2.3
Mar 24, 2020
66b0dbc
Add proxy check test, fix version handling for proxy
Mar 24, 2020
4e7f320
Refactor version metadata tests
Mar 24, 2020
d2b56a8
Factorize integration tests
Mar 24, 2020
27edb01
Merge branch 'master' into florimondmanca/rethinkdb
Mar 24, 2020
0008149
Merge branch 'master' into florimondmanca/rethinkdb
Mar 25, 2020
97db598
Add password sanitization
Mar 25, 2020
3b65f86
Address feedback
Mar 25, 2020
01e7fae
Merge branch 'master' into florimondmanca/rethinkdb
Mar 26, 2020
b472756
Refactor passing of logger to queries
Mar 26, 2020
f03beb0
Drop query duration metric
Mar 26, 2020
b9d3e92
Address feedback
Mar 26, 2020
7d962c7
Drop detailed jobs metrics in favor of jobs summary
Mar 26, 2020
f478cbd
Update metadata.csv
Mar 26, 2020
a146b41
Fix E2E
Mar 26, 2020
bd4746d
Merge branch 'master' into florimondmanca/rethinkdb
Mar 27, 2020
8eee355
Fix metric_to_check
Mar 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .azure-pipelines/templates/test-all-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ jobs:
- checkName: redisdb
displayName: Redis
os: linux
- checkName: rethinkdb
displayName: RethinkDB
os: linux
- checkName: riak
displayName: Riak
os: linux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ redis==3.3.11
requests==2.22.0
requests-kerberos==0.12.0
requests_ntlm==1.1.0
rethinkdb==2.4.4
scandir==1.8
securesystemslib[crypto,pynacl]==0.14.2
selectors34==1.2.0; sys_platform == 'win32' and python_version < '3.4'
Expand Down
13 changes: 13 additions & 0 deletions datadog_checks_dev/datadog_checks/dev/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
from contextlib import contextmanager
from typing import Iterator

from six import string_types
from six.moves.urllib.parse import urlparse
Expand Down Expand Up @@ -246,3 +247,15 @@ def _read_example_logs_config(check_root):
return option['example']

raise ValueError('No logs example found')


@contextmanager
def temporarily_stop_service(service, compose_file, check=True):
# type: (str, str, bool) -> Iterator[None]
run_command(['docker-compose', '-f', compose_file, 'stop', service], capture=False, check=check)
try:
yield
except Exception:
raise
else:
florimondmanca marked this conversation as resolved.
Show resolved Hide resolved
run_command(['docker-compose', '-f', compose_file, 'start', service], capture=False, check=check)
2 changes: 2 additions & 0 deletions rethinkdb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# CHANGELOG - RethinkDB

10 changes: 10 additions & 0 deletions rethinkdb/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
graft datadog_checks
graft tests

include MANIFEST.in
include README.md
include requirements.in
include requirements-dev.txt
include manifest.json

global-exclude *.py[cod] __pycache__
77 changes: 77 additions & 0 deletions rethinkdb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Agent Check: RethinkDB

## Overview

[RethinkDB][1] is a distributed documented-oriented NoSQL database, with first class support for realtime change feeds.

This check monitors a RethinkDB cluster through the Datadog Agent and collects metrics about performance, data availability, cluster configuration, and more.

## 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][2] for guidance on applying these instructions.

### Installation

The RethinkDB check is included in the [Datadog Agent][3] package. No additional installation is needed on your server.

### Configuration

1. Add a `datadog-agent` user with read-only permissions on the `rethinkdb` database. Use the following ReQL commands, referring to [Permissions and user accounts][4] for details:

```python
r.db('rethinkdb').table('users').insert({'id': 'datadog-agent', 'password': '<PASSWORD>'})
r.db('rethinkdb').grant('datadog-agent', {'read': True})
```

2. Edit the `rethinkdb.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory][5]. See the [sample rethinkdb.d/conf.yaml][6] for all available configuration options.

```yaml
init_config:

instances:
- host: localhost
port: 28015
user: datadog-agent
password: "<PASSWORD>"
```

3. [Restart the Agent][7].

**Note**: this integration collects metrics from all servers in the cluster, so you only need a single Agent.

### Validation

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

## Data Collected

### Metrics

See [metadata.csv][9] for a list of metrics provided by this check.

### Service Checks

- `rethinkdb.can_connect`: Returns `CRITICAL` if the Agent cannot reach the configured RethinkDB server, `OK` otherwise.
- `rethinkdb.table_status.ready_for_outdated_reads`: Returns `OK` if all shards of a table are ready to accept outdated read queries, `WARNING` otherwise.
- `rethinkdb.table_status.ready_for_reads`: Returns `OK` if all shards of a table are ready to accept read queries, `WARNING` otherwise.
- `rethinkdb.table_status.ready_for_writes`: Returns `OK` if all shards of a table are ready to accept write queries, `WARNING` otherwise.
- `rethinkdb.table_status.all_replicas_ready`: Returns `OK` if all replicas are ready for reads and writes, `WARNING` otherwise (e.g. if backfills are in progress).

### Events

RethinkDB does not include any events.

## Troubleshooting

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

[1]: https://rethinkdb.com/
[2]: https://docs.datadoghq.com/agent/autodiscovery/integrations
[3]: https://docs.datadoghq.com/agent
[4]: https://rethinkdb.com/docs/permissions-and-accounts/
[5]: https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory
[6]: https://github.com/DataDog/integrations-core/blob/master/rethinkdb/datadog_checks/rethinkdb/data/conf.yaml.example
[7]: https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent
[8]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information
[9]: https://github.com/DataDog/integrations-core/blob/master/rethinkdb/metadata.csv
[10]: https://docs.datadoghq.com/help
47 changes: 47 additions & 0 deletions rethinkdb/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: RethinkDB

files:
- name: rethinkdb.yaml

options:
- template: init_config
options:
- template: init_config/default

- template: instances
options:
- name: host
required: false
florimondmanca marked this conversation as resolved.
Show resolved Hide resolved
description: Host of the RethinkDB server.
value:
example: localhost
type: string

- name: port
required: false
florimondmanca marked this conversation as resolved.
Show resolved Hide resolved
description: Driver port of the RethinkDB server.
value:
example: 28015
type: integer

- name: username
required: false
florimondmanca marked this conversation as resolved.
Show resolved Hide resolved
description: The user account to connect as.
value:
type: string

- name: password
required: false
florimondmanca marked this conversation as resolved.
Show resolved Hide resolved
description: The password for the user account to connect as.
value:
type: string

- name: tls_ca_cert
required: false
florimondmanca marked this conversation as resolved.
Show resolved Hide resolved
description: |
Path to a TLS client certificate to use when connecting to the RethinkDB server.
See also: https://rethinkdb.com/docs/security/#using-tls
value:
type: string

- template: instances/default
77 changes: 77 additions & 0 deletions rethinkdb/assets/service_checks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[
{
"agent_version": "6.19.0",
"integration": "RethinkDB",
"groups": [
"host",
"port"
],
"check": "rethinkdb.can_connect",
"statuses": [
"ok",
"critical"
],
"name": "Can Connect",
"description": "Returns `CRITICAL` if the Agent is unable to reach the configured RethinkDB server, `OK` otherwise."
},
{
"agent_version": "6.19.0",
"integration": "RethinkDB",
"groups": [
"database",
"table"
],
"check": "rethinkdb.table_status.ready_for_outdated_reads",
"statuses": [
"ok",
"warning"
],
"name": "Table Ready For Outdated Reads",
"description": "Returns `OK` if all shards of a table are ready to accept outdated read queries, `WARNING` otherwise."
},
{
"agent_version": "6.19.0",
"integration": "RethinkDB",
"groups": [
"database",
"table"
],
"check": "rethinkdb.table_status.ready_for_reads",
"statuses": [
"ok",
"warning"
],
"name": "Table Ready For Reads",
"description": "Returns `OK` if all shards of a table are ready to accept read queries, `WARNING` otherwise."
},
{
"agent_version": "6.19.0",
"integration": "RethinkDB",
"groups": [
"database",
"table"
],
"check": "rethinkdb.table_status.ready_for_writes",
"statuses": [
"ok",
"warning"
],
"name": "Table Ready For Writes",
"description": "Returns `OK` if all shards of a table are ready to accept write queries, `WARNING` otherwise."
},
{
"agent_version": "6.19.0",
"integration": "RethinkDB",
"groups": [
"database",
"table"
],
"check": "rethinkdb.table_status.all_replicas_ready",
"statuses": [
"ok",
"warning"
],
"name": "Table All Replicas Ready",
"description": "Returns `OK` if all replicas are ready for reads and writes, `WARNING` otherwise (e.g. if backfills are in progress)."
}
]
4 changes: 4 additions & 0 deletions rethinkdb/datadog_checks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
4 changes: 4 additions & 0 deletions rethinkdb/datadog_checks/rethinkdb/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
__version__ = '0.0.1'
7 changes: 7 additions & 0 deletions rethinkdb/datadog_checks/rethinkdb/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from .__about__ import __version__
from .check import RethinkDBCheck

__all__ = ['__version__', 'RethinkDBCheck']
85 changes: 85 additions & 0 deletions rethinkdb/datadog_checks/rethinkdb/backends.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from typing import Callable, Iterator, Sequence

import rethinkdb

from .config import Config
from .connections import Connection
from .exceptions import CouldNotConnect
from .metrics.config import collect_config_totals
from .metrics.current_issues import collect_current_issues
from .metrics.statistics import (
collect_cluster_statistics,
collect_replica_statistics,
collect_server_statistics,
collect_table_statistics,
)
from .metrics.statuses import collect_server_status, collect_table_status
from .metrics.system_jobs import collect_system_jobs
from .queries import QueryEngine
from .types import Metric
from .version import parse_version


class Backend(object):
florimondmanca marked this conversation as resolved.
Show resolved Hide resolved
"""
An interface for high-level operations performed during a RethinkDB check.

Abstracts away any interfaces specific to the `rethinkdb` client library, while providing a default
implementation that uses that library.
"""

def __init__(self):
# type: () -> None
# NOTE: the name 'r' may look off-putting at first, but it was chosen for consistency with the officially
# advertised ReQL usage. For example, see: https://rethinkdb.com/docs/guide/python/
self._r = rethinkdb.r
self._query_engine = QueryEngine(r=self._r)
self._collect_funcs = (
collect_config_totals,
collect_cluster_statistics,
collect_server_statistics,
collect_table_statistics,
collect_replica_statistics,
collect_server_status,
collect_table_status,
collect_system_jobs,
collect_current_issues,
) # type: Sequence[Callable[[QueryEngine, Connection], Iterator[Metric]]]

def connect(self, config):
# type: (Config) -> Connection
"""
Establish a connection with the configured RethinkDB server.
"""
try:
conn = self._r.connect(
host=config.host,
port=config.port,
user=config.user,
password=config.password,
ssl={'ca_certs': config.tls_ca_cert} if config.tls_ca_cert is not None else None,
)
except rethinkdb.errors.ReqlDriverError as exc:
raise CouldNotConnect(exc)

return Connection(conn)

def collect_metrics(self, conn):
# type: (Connection) -> Iterator[Metric]
"""
Collect metrics from the RethinkDB cluster we are connected to.
"""
for collect in self._collect_funcs:
for metric in collect(self._query_engine, conn):
yield metric

def collect_connected_server_version(self, conn):
# type: (Connection) -> str
"""
Return the version of RethinkDB run by the server at the other end of the connection, in SemVer format.
"""
version_string = self._query_engine.query_connected_server_version_string(conn)
return parse_version(version_string)
Loading