Skip to content

Live Logging #711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 23, 2025
Merged

Live Logging #711

merged 9 commits into from
Jul 23, 2025

Conversation

luv-bansal
Copy link
Contributor

@luv-bansal luv-bansal commented Jul 21, 2025

Pull Request Overview

This PR implements live logging functionality for model runner operations to improve observability. The changes add structured logging that tracks request timing, status codes, and request IDs for better monitoring of model prediction, generation, and streaming operations.

  • Adds timing measurements and structured logging to all three main runner methods (predict, generate, stream)
  • Logs request IDs, endpoints, response statuses, and execution durations in a consistent format
  • Uses HTTP-style status codes (200 OK, 207 MIXED, 500 FAIL) for better readability

Uploading Screenshot 2025-07-22 at 3.02.42 PM.png…

@luv-bansal luv-bansal requested a review from Copilot July 21, 2025 09:41
Copilot

This comment was marked as outdated.

@luv-bansal luv-bansal requested a review from Copilot July 22, 2025 10:02
Copilot

This comment was marked as outdated.

@luv-bansal luv-bansal requested a review from Copilot July 22, 2025 11:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements live logging functionality for model runner operations to improve observability and monitoring. The changes add structured timing measurements and status logging to track request performance across different model operation types.

  • Adds comprehensive logging with timing, status codes, and request IDs to predict, generate, and stream operations
  • Implements HTTP-style status code mapping (200 OK, 207 MIXED, 500 FAIL) for better readability
  • Updates a test fixture configuration value from 1.33 to 1.3

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
clarifai/runners/models/model_runner.py Adds live logging with timing measurements and structured status reporting to all three runner methods
tests/workflow/fixtures/single_branch_with_custom_cropper_model.yml Updates margin parameter from 1.33 to 1.3 in test fixture

Copy link
Contributor

@mogith-pn mogith-pn left a comment

Choose a reason for hiding this comment

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

Made suggestions on handling the status string codes. We can follow same for generate and stream.

@luv-bansal luv-bansal requested a review from mogith-pn July 22, 2025 13:44
Copy link

Code Coverage

Package Line Rate Health
clarifai 43%
clarifai.cli 42%
clarifai.cli.templates 28%
clarifai.client 69%
clarifai.client.auth 66%
clarifai.constants 100%
clarifai.datasets 100%
clarifai.datasets.export 80%
clarifai.datasets.upload 75%
clarifai.datasets.upload.loaders 37%
clarifai.models 100%
clarifai.modules 0%
clarifai.rag 72%
clarifai.runners 11%
clarifai.runners.models 59%
clarifai.runners.pipeline_steps 45%
clarifai.runners.pipelines 85%
clarifai.runners.utils 62%
clarifai.runners.utils.data_types 72%
clarifai.schema 100%
clarifai.urls 60%
clarifai.utils 57%
clarifai.utils.evaluation 67%
clarifai.workflows 95%
Summary 62% (7397 / 11884)

Minimum allowed line rate is 50%

Copy link
Contributor

@mogith-pn mogith-pn left a comment

Choose a reason for hiding this comment

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

LGTM

@luv-bansal luv-bansal merged commit 133c469 into master Jul 23, 2025
12 checks passed
@luv-bansal luv-bansal deleted the live-logging branch July 23, 2025 11:58
@luv-bansal luv-bansal mentioned this pull request Jul 23, 2025
srikanthbachala20 pushed a commit that referenced this pull request Jul 29, 2025
* Live Logging

* Live logging and patch signature in local-runner

* Fix patching model signature

* Improve logging

* Remove patch signatures

* fix edge case

* fix test

* handle edge case

* status in constant file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants