File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,22 @@ def raise_error(message, code: int = 400):
3232 return jsonify ({"error" : message }), code
3333
3434
35+ def extract_message_type_from_paylaod ():
36+ data = request .get_json (silent = True ) or {}
37+ edxl_json = data .get ("edxl" )
38+ message_content = extract_message_content (edxl_json )
39+ return extract_message_type_from_message_content (message_content )
40+
41+
3542@app .route ("/convert" , methods = ["POST" ])
3643@metrics .do_not_track ()
3744@metrics .histogram (
3845 "conversion_duration_seconds" ,
3946 "The number of seconds it took to the /convert endpoint to answer" ,
40- labels = {"status" : lambda r : r .status_code },
47+ labels = {
48+ "status" : lambda r : r .status_code ,
49+ "message_type" : extract_message_type_from_paylaod ,
50+ },
4151)
4252def convert ():
4353 if not request .is_json :
You can’t perform that action at this time.
0 commit comments