Skip to content

Commit

Permalink
[Metric] Refactor Frontend-exporter (#413)
Browse files Browse the repository at this point in the history
* Fix dict unpacking lint error

* Format Code

* Update yapf

* Update yapf and reformat code

* Check yapf version in shell script

* Change `echo` to `cat`

* Add python version check; almost ready

* Format code with python version 2.7.12

* Separate frontend-exporter as depolyment outside query-frontend

1. Move it to deployment
2. Because it's no longer in the same pod as query-frontend, we
now need to directly call against query-frontend service.
3. Update fronte_end_exporter image to accept ports.
4. Update docker metric for corresponding change

* Remove k8s part

* Format code

* Address Comment
  • Loading branch information
simon-mo authored and dcrankshaw committed Feb 21, 2018
1 parent e6eebdc commit 62f8a9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion clipper_admin/clipper_admin/docker/docker_metric_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
from ..exceptions import ClipperException
from ..version import __version__
from ..container_manager import CLIPPER_INTERNAL_QUERY_PORT

PROM_VERSION = "v2.1.0"

Expand Down Expand Up @@ -43,7 +44,8 @@ def run_query_frontend_metric_image(name, docker_client, query_name,
:return: None
"""

query_frontend_metric_cmd = "--query_frontend_name {}".format(query_name)
query_frontend_metric_cmd = "--query_frontend_name {}:{}".format(
query_name, CLIPPER_INTERNAL_QUERY_PORT)
query_frontend_metric_labels = common_labels.copy()

docker_client.containers.run(
Expand Down
2 changes: 1 addition & 1 deletion monitoring/front_end_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

query_frontend_id = args.query_frontend_name

ADDRESS = 'http://{}:1337/metrics'.format(query_frontend_id)
ADDRESS = 'http://{}/metrics'.format(query_frontend_id)


def load_metric():
Expand Down

0 comments on commit 62f8a9d

Please sign in to comment.