Collect metrics for chat_archiver on port 8008

pull/314/head
Mike Lang 2 years ago
parent 7dfb7b2544
commit 8e314eea94

@ -380,7 +380,7 @@ def merge_batch_files(path, batch_time):
os.remove(batch_file) os.remove(batch_file)
def main(channel, nick, oauth_token_path, base_dir='/mnt', name=None, merge_interval=60): def main(channel, nick, oauth_token_path, base_dir='/mnt', name=None, merge_interval=60, metrics_port=8008):
with open(oauth_token_path) as f: with open(oauth_token_path) as f:
oauth_token = f.read() oauth_token = f.read()
# To ensure uniqueness even if multiple instances are running on the same host, # To ensure uniqueness even if multiple instances are running on the same host,
@ -399,6 +399,8 @@ def main(channel, nick, oauth_token_path, base_dir='/mnt', name=None, merge_inte
stopping=stopping stopping=stopping
) )
prom.start_http_server(metrics_port)
logging.info("Starting") logging.info("Starting")
for index in count(): for index in count():
# To ensure uniqueness between clients, include a client number # To ensure uniqueness between clients, include a client number

@ -67,6 +67,7 @@
sheetsync: 8005, sheetsync: 8005,
segment_coverage: 8006, segment_coverage: 8006,
playlist_manager: 8007, playlist_manager: 8007,
chat_archiver: 8008,
nginx: 80, nginx: 80,
nginx_ssl: 443, nginx_ssl: 443,
postgres: 5432, postgres: 5432,
@ -407,6 +408,7 @@
sheetsync: 8005, sheetsync: 8005,
segment_coverage: 8006, segment_coverage: 8006,
playlist_manager: 8007, playlist_manager: 8007,
chat_archiver: 8008,
}, },
image: $.get_image("nginx"), image: $.get_image("nginx"),
restart: "on-failure", restart: "on-failure",
@ -457,6 +459,8 @@
restart: "always", restart: "always",
command: [$.chat_archiver.channel, $.chat_archiver.user, "/token", "--name", $.localhost], command: [$.chat_archiver.channel, $.chat_archiver.user, "/token", "--name", $.localhost],
volumes: ["%s:/mnt" % $.segments_path, "%s:/token" % $.chat_archiver.token_path], volumes: ["%s:/mnt" % $.segments_path, "%s:/token" % $.chat_archiver.token_path],
[if "chat_archiver" in $.ports then "ports"]: ["%s:8008" % $.ports.chat_archiver],
environment: $.env,
}, },
}, },

Loading…
Cancel
Save