File tree 6 files changed +15
-4
lines changed
6 files changed +15
-4
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.0.82
2
+
3
+ * Expose Prometheus metrics at /metrics
4
+
1
5
## 0.0.81
2
6
3
7
* Update ` strategy ` parameter to allow ` ' ` and ` " ` as input surrounding the value.
Original file line number Diff line number Diff line change 2
2
from fastapi .datastructures import FormData
3
3
from fastapi .responses import JSONResponse
4
4
from fastapi .security import APIKeyHeader
5
+ from prometheus_client import make_asgi_app
5
6
import logging
6
7
import os
7
8
13
14
app = FastAPI (
14
15
title = "Unstructured Pipeline API" ,
15
16
summary = "Partition documents with the Unstructured library" ,
16
- version = "0.0.81 " ,
17
+ version = "0.0.82 " ,
17
18
docs_url = "/general/docs" ,
18
19
openapi_url = "/general/openapi.json" ,
19
20
servers = [
31
32
openapi_tags = [{"name" : "general" }],
32
33
)
33
34
35
+ metrics_app = make_asgi_app ()
36
+ app .mount ("/metrics" , metrics_app )
37
+
34
38
# Note(austin) - This logger just dumps exceptions
35
39
# We'd rather handle those below, so disable this in deployments
36
40
uvicorn_logger = logging .getLogger ("uvicorn.error" )
Original file line number Diff line number Diff line change @@ -653,7 +653,7 @@ def return_content_type(filename: str):
653
653
654
654
655
655
@router .get ("/general/v0/general" , include_in_schema = False )
656
- @router .get ("/general/v0.0.81 /general" , include_in_schema = False )
656
+ @router .get ("/general/v0.0.82 /general" , include_in_schema = False )
657
657
async def handle_invalid_get_request ():
658
658
raise HTTPException (
659
659
status_code = status .HTTP_405_METHOD_NOT_ALLOWED , detail = "Only POST requests are supported."
@@ -668,7 +668,7 @@ async def handle_invalid_get_request():
668
668
description = "Description" ,
669
669
operation_id = "partition_parameters" ,
670
670
)
671
- @router .post ("/general/v0.0.81 /general" , include_in_schema = False )
671
+ @router .post ("/general/v0.0.82 /general" , include_in_schema = False )
672
672
def general_partition (
673
673
request : Request ,
674
674
# cannot use annotated type here because of a bug described here:
Original file line number Diff line number Diff line change 1
1
name : general
2
- version : 0.0.81
2
+ version : 0.0.82
Original file line number Diff line number Diff line change @@ -16,3 +16,4 @@ backoff
16
16
pypdf
17
17
pycryptodome
18
18
psutil
19
+ prometheus_client
Original file line number Diff line number Diff line change @@ -244,6 +244,8 @@ pillow==10.4.0
244
244
# unstructured-pytesseract
245
245
portalocker==2.10.1
246
246
# via iopath
247
+ prometheus-client==0.21.0
248
+ # via -r requirements/base.in
247
249
proto-plus==1.24.0
248
250
# via
249
251
# google-api-core
You can’t perform that action at this time.
0 commit comments