Prometheus support

This commit is contained in:
Piero Toffanin 2022-12-26 16:10:43 -05:00
parent 753a33e7c5
commit 9f243fd6be
7 changed files with 120 additions and 7 deletions

View file

@ -147,6 +147,18 @@ def get_args():
parser.add_argument(
"--update-models", default=DEFARGS['UPDATE_MODELS'], action="store_true", help="Update language models at startup"
)
parser.add_argument(
"--metrics",
default=DEFARGS['METRICS'],
action="store_true",
help="Enable the /metrics endpoint for exporting Prometheus usage metrics",
)
parser.add_argument(
"--metrics-auth-token",
default=DEFARGS['METRICS_AUTH_TOKEN'],
type=str,
help="Protect the /metrics endpoint by allowing only clients that have a valid Authorization Bearer token (%(default)s)",
)
return parser.parse_args()