post-deploy bug fixes

This commit is contained in:
Barbara Miller 2024-09-13 17:01:35 -07:00
parent 551d1868d1
commit 4a60ff3367
2 changed files with 10 additions and 4 deletions

View File

@ -297,7 +297,7 @@ def brozzle_page(argv=None):
window_height=args.window_height,
window_width=args.window_width,
stealth=args.stealth,
metrics_port=args.metrics_port,
metrics_port=int(args.metrics_port),
registry_url=args.registry_url,
env=args.env,
)
@ -540,7 +540,7 @@ def brozzler_worker(argv=None):
)
arg_parser.add_argument(
"--metrics_port",
dest=metrics_port,
dest="metrics_port",
default=8888,
help="Prometheus metrics port",
)
@ -612,7 +612,7 @@ def brozzler_worker(argv=None):
skip_visit_hashtags=args.skip_visit_hashtags,
skip_youtube_dl=args.skip_youtube_dl,
stealth=args.stealth,
metrics_port=args.metrics_port,
metrics_port=int(args.metrics_port),
registry_url=args.registry_url,
env=args.env,
)

View File

@ -42,12 +42,18 @@ def register_prom_metrics(
if registry_url is None:
return
env_for_prom = None
if env == "qa":
env_for_prom = Env.qa
elif env == "prod":
env_for_prom = Env.prod
config = ClientConfig(server_url_base=registry_url)
client = Client(config)
target = format_self_target(scrape_port=metrics_port)
registration = Registration(
target=target,
env=env,
env=env_for_prom,
scheme=Scheme.http,
)
client.keep_registered_threaded(registration)