mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-06-03 21:30:19 +00:00
Prometheus support
This commit is contained in:
parent
753a33e7c5
commit
9f243fd6be
7 changed files with 120 additions and 7 deletions
12
app/main.py
12
app/main.py
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue