Skip to content

Commit

Permalink
Docs: YugabyteDB changes to monitoring and host info retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
perdelt committed Dec 19, 2024
1 parent c58b640 commit 18a84dd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 34 deletions.
20 changes: 5 additions & 15 deletions benchbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ def get_worker_pods(self):
"""
Returns a list of all pod names of workers for the current SUT.
Default is component name is 'worker' for a bexhoma managed DBMS.
This is used for example to find the pods of the workers in order to get the host infos (CPU, RAM, node name, ...).
YugabyteDB: This is yb-tserver-0, -1 etc.
:return: list of endpoints
Expand All @@ -361,8 +362,9 @@ def get_worker_pods(self):
def create_monitoring(self, app='', component='monitoring', experiment='', configuration=''):
"""
Generate a name for the monitoring component.
This is used in a pattern for promql.
Basically this is `{app}-{component}-{configuration}-{experiment}-{client}`.
For YugabyteDB, the service to be monitored is named like 'yb-tserver-'.
For YugabyteDB, the service of the SUT to be monitored is named like 'yb-tserver-'.
:param app: app the component belongs to
:param component: Component, for example sut or monitoring
Expand All @@ -382,6 +384,7 @@ def get_worker_endpoints(self):
These are IPs of cAdvisor instances.
The endpoint list is to be filled in a config of an instance of Prometheus.
By default, the workers can be found by the name of their component (worker-0 etc).
This is neccessary, when we have sidecar containers attached to workers of a distributed dbms.
:return: list of endpoints
"""
Expand All @@ -396,26 +399,13 @@ def get_worker_endpoints(self):
self.logger.debug("yugabytedb.get_worker_endpoints({})".format(endpoints))
return endpoints
config.get_worker_endpoints = types.MethodType(get_worker_endpoints, config)
def get_worker_endpoints_tmp(self):
"""
Returns all endpoints of a headless service that monitors nodes of a distributed DBMS.
These are IPs of cAdvisor instances.
The endpoint list is to be filled in a config of an instance of Prometheus.
For YugabyteDB the service is fixed to be 'bexhoma-service-monitoring-default' and does not depend on the experiment.
:return: list of endpoints
"""
endpoints = self.experiment.cluster.get_service_endpoints(service_name="bexhoma-service-monitoring-default")
self.logger.debug("yugabytedb.get_worker_endpoints_tmp({})".format(endpoints))
return endpoints
#config.get_worker_endpoints = types.MethodType(get_worker_endpoints, config)
def set_metric_of_config(self, metric, host, gpuid):
"""
Returns a promql query.
Parameters in this query are substituted, so that prometheus finds the correct metric.
Example: In 'sum(irate(container_cpu_usage_seconds_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}}[1m]))'
configuration and experiment are placeholders and will be replaced by concrete values.
Here: We do not have a SUT that is specific to the experiment or configuration.
YugabyteDB: We do not have a SUT that is specific to the experiment or configuration. The pod names follow a pattern like yb-tserver and there is no container name.
:param metric: Parametrized promql query
:param host: Name of the host the metrics should be collected from
Expand Down
3 changes: 3 additions & 0 deletions bexhoma/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ def start_maintaining(self, app='', component='maintaining', experiment='', conf
def create_monitoring(self, app='', component='monitoring', experiment='', configuration=''):
"""
Generate a name for the monitoring component.
This is used in a pattern for promql.
Basically this is `{app}-{component}-{configuration}-{experiment}-{client}`
:param app: app the component belongs to
Expand Down Expand Up @@ -3042,6 +3043,7 @@ def get_worker_pods(self):
"""
Returns a list of all pod names of workers for the current SUT.
Default is component name is 'worker' for a bexhoma managed DBMS.
This is used for example to find the pods of the workers in order to get the host infos (CPU, RAM, node name, ...).
:return: list of endpoints
"""
Expand All @@ -3054,6 +3056,7 @@ def get_worker_endpoints(self):
These are IPs of cAdvisor instances.
The endpoint list is to be filled in a config of an instance of Prometheus.
By default, the workers can be found by the name of their component (worker-0 etc).
This is neccessary, when we have sidecar containers attached to workers of a distributed dbms.
:return: list of endpoints
"""
Expand Down
9 changes: 5 additions & 4 deletions docs/Example-YugaByteDB.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,11 @@ In `ycsb.py` there is a section about YugabyteDB.

Watch for
* `config.sut_service_name`: Fixed name for the service of the SUT (="yb-tserver-service")
* `config.sut_container_name`: Fixed name for the container of the SUT (="yb-tserver")
* `config.create_monitoring()`: Method to create names for monitored components (for SUT = "yb-tserver-")
* `config.get_worker_endpoints()`: ?
* `config.set_metric_of_config()`: Method to create promql queries from templates (pod like "yb-tserver", no container name)
* `config.sut_container_name`: Fixed name for the container of the SUT (="")
* `config.get_worker_pods()`: Method to find the pods of worker nodes (['yb-tserver-0', 'yb-tserver-1', 'yb-tserver-2']). This allows getting host infos like CPU, RAM, node name, ...
* `config.create_monitoring()`: Method to create names for monitored components (for SUT = "yb-tserver-"). This avoids the SUT dummy contributing to the monitoring.
* `config.get_worker_endpoints()`: This is neccessary, when we have sidecar containers attached to workers of a distributed dbms. Monitoring needs to find these containers.
* `config.set_metric_of_config()`: Method to create promql queries from templates (pod like "yb-tserver", no container name, for our SUT)



Expand Down
20 changes: 5 additions & 15 deletions ycsb.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ def get_worker_pods(self):
"""
Returns a list of all pod names of workers for the current SUT.
Default is component name is 'worker' for a bexhoma managed DBMS.
This is used for example to find the pods of the workers in order to get the host infos (CPU, RAM, node name, ...).
YugabyteDB: This is yb-tserver-0, -1 etc.
:return: list of endpoints
Expand All @@ -381,8 +382,9 @@ def get_worker_pods(self):
def create_monitoring(self, app='', component='monitoring', experiment='', configuration=''):
"""
Generate a name for the monitoring component.
This is used in a pattern for promql.
Basically this is `{app}-{component}-{configuration}-{experiment}-{client}`.
For YugabyteDB, the service to be monitored is named like 'yb-tserver-'.
For YugabyteDB, the service of the SUT to be monitored is named like 'yb-tserver-'.
:param app: app the component belongs to
:param component: Component, for example sut or monitoring
Expand All @@ -402,6 +404,7 @@ def get_worker_endpoints(self):
These are IPs of cAdvisor instances.
The endpoint list is to be filled in a config of an instance of Prometheus.
By default, the workers can be found by the name of their component (worker-0 etc).
This is neccessary, when we have sidecar containers attached to workers of a distributed dbms.
:return: list of endpoints
"""
Expand All @@ -416,26 +419,13 @@ def get_worker_endpoints(self):
self.logger.debug("yugabytedb.get_worker_endpoints({})".format(endpoints))
return endpoints
config.get_worker_endpoints = types.MethodType(get_worker_endpoints, config)
def get_worker_endpoints_tmp(self):
"""
Returns all endpoints of a headless service that monitors nodes of a distributed DBMS.
These are IPs of cAdvisor instances.
The endpoint list is to be filled in a config of an instance of Prometheus.
For YugabyteDB the service is fixed to be 'bexhoma-service-monitoring-default' and does not depend on the experiment.
:return: list of endpoints
"""
endpoints = self.experiment.cluster.get_service_endpoints(service_name="bexhoma-service-monitoring-default")
self.logger.debug("yugabytedb.get_worker_endpoints_tmp({})".format(endpoints))
return endpoints
#config.get_worker_endpoints = types.MethodType(get_worker_endpoints, config)
def set_metric_of_config(self, metric, host, gpuid):
"""
Returns a promql query.
Parameters in this query are substituted, so that prometheus finds the correct metric.
Example: In 'sum(irate(container_cpu_usage_seconds_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}}[1m]))'
configuration and experiment are placeholders and will be replaced by concrete values.
Here: We do not have a SUT that is specific to the experiment or configuration.
YugabyteDB: We do not have a SUT that is specific to the experiment or configuration. The pod names follow a pattern like yb-tserver and there is no container name.
:param metric: Parametrized promql query
:param host: Name of the host the metrics should be collected from
Expand Down

0 comments on commit 18a84dd

Please sign in to comment.