Skip to content

Commit

Permalink
INFRA-7537 Update prometheus_client, pika. Add additional buckets (#4)
Browse files Browse the repository at this point in the history
Update prometheus_client, pika. Add additional buckets
  • Loading branch information
dpronkin authored May 10, 2019
1 parent 50cc3b4 commit 727171d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7.2-alpine
FROM python:3.7.3-alpine
LABEL maintainer="d.pronkin@anchorfree.com"
WORKDIR /usr/src/app
COPY requirements.txt ./
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
prometheus_client==0.5.0
pika==0.13.0
prometheus_client==0.6.0
pika==0.13.1
smart-getenv==1.1.0
5 changes: 3 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def main(): # pylint: disable=R0914
"routing_key": getenv('RMQ_ROUTING_KEY', default='', type=str),
"expire_timeout_ms": getenv('RMQ_EXPIRE_TIMEOUT', default=5000, type=int),
"publisher_interval": getenv('RMQ_PUBLISHER_INTERVAL', default=0.5, type=float),
"exporter_port": getenv('EXPORTER_PORT', default=9100, type=int)
"exporter_port": getenv('EXPORTER_PORT', default=9100, type=int),
"add_bucket_values": getenv('ADD_BUCKET_VALUES', default=[], type=list)
}

config["multipassport"] = pika.PlainCredentials(config["rmq_user"], config["rmq_password"])
Expand All @@ -147,7 +148,7 @@ def main(): # pylint: disable=R0914
p_publisher.start()

rmq_monitoring_event_time_ms = Histogram('rmq_monitoring_event_time_ms', '', ['action'],
buckets=[le**2 for le in range(1, 18)])
buckets=[le**2 for le in range(1, 18)] + config["add_bucket_values"])

start_http_server(config["exporter_port"])

Expand Down

0 comments on commit 727171d

Please sign in to comment.