Skip to content

json logs: use python-json-logger#675

Merged
boddumanohar merged 2 commits intodevfrom
issue-109
Mar 23, 2026
Merged

json logs: use python-json-logger#675
boddumanohar merged 2 commits intodevfrom
issue-109

Conversation

@boddumanohar
Copy link
Member

@boddumanohar boddumanohar commented Mar 19, 2026

python-json-logger hooks into the standard library's logging package so all the existing getLogger(name) continue to work just fine.

This is controlled by VELA_LOG_JSON environment variable. By default JSON logging is enabled.

sample output:

{"timestamp": "2026-03-20T14:29:13+0000", "level": "INFO", "logger": "uvicorn.access", "message": "10.244.2.1:42880 - "GET /health HTTP/1.1" 200"}
{"timestamp": "2026-03-20T14:29:18+0000", "level": "INFO", "logger": "uvicorn.access", "message": "10.244.2.1:49488 - "GET /health HTTP/1.1" 200"}
{"timestamp": "2026-03-20T14:29:21+0000", "level": "INFO", "logger": "uvicorn.access", "message": "10.244.2.1:49502 - "GET /health HTTP/1.1" 200"}
{"timestamp": "2026-03-20T14:29:23+0000", "level": "INFO", "logger": "uvicorn.access", "message": "10.244.2.1:49508 - "GET /health HTTP/1.1" 200"}
{"timestamp": "2026-03-20T14:29:25+0000", "level": "INFO", "logger": "simplyblock.vela.api.resources", "message": "Found 1 branches"}
{"timestamp": "2026-03-20T14:29:25+0000", "level": "INFO", "logger": "httpx", "message": "HTTP Request: GET http://192.168.10.66/api/v2/clusters/0c296ee1-b91e-4ecd-8cf9-201a0d555f39/storage-pools/ "HTTP/1.1 200 OK""}
{"timestamp": "2026-03-20T14:29:25+0000", "level": "INFO", "logger": "httpx", "message": "HTTP Request: GET http://192.168.10.66/api/v2/clusters/0c296ee1-b91e-4ecd-8cf9-201a0d555f39/storage-pools/5f3bcaba-208b-4147-b3fa-bc44bc9d2db8/volumes/e21ef5b0-f97d-4a04-a3b8-b3c8b3d4f169/iostats "HTTP/1.1 200 OK""}

Base automatically changed from dev to main March 19, 2026 14:34
@boddumanohar boddumanohar changed the base branch from main to dev March 20, 2026 12:03
@boddumanohar boddumanohar marked this pull request as ready for review March 20, 2026 12:04
Copy link
Collaborator

@mxsrc mxsrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this requires adaption of the loki/vector/grafana configuration?

@boddumanohar
Copy link
Member Author

Thanks, missed it. Have updated the vector-config.yaml to fix the parsing as per the new JSON logs.

@boddumanohar
Copy link
Member Author

showing parsed logs in the PR branch deployment's Grafana

Screenshot 2026-03-23 at 19 18 34

Copy link
Collaborator

@mxsrc mxsrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@boddumanohar boddumanohar merged commit 08c7b5a into dev Mar 23, 2026
8 checks passed
@boddumanohar boddumanohar deleted the issue-109 branch March 23, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants