Skip to content
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

bug: Unable to see more than 200 logs in Generator Task Logs #5912

Open
BeArchiTek opened this issue Mar 3, 2025 · 5 comments
Open

bug: Unable to see more than 200 logs in Generator Task Logs #5912

BeArchiTek opened this issue Mar 3, 2025 · 5 comments
Assignees
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release state/need-triage This issue needs to be triaged type/bug Something isn't working as expected

Comments

@BeArchiTek
Copy link
Contributor

Component

Frontend UI

Infrahub version

1.1.7

Current Behavior

When running a Generator, you can create logs and see them in the UI using the logger function.
If there is more than 200 logs, a part of it will be in another "page", but there is no options to see those.

Expected Behavior

I am able to navigate and see all the logs

Steps to Reproduce

Use the demo schema
Update any of the generator of demo-edge to add the log loop below in the generate function

        log = logging.getLogger("infrahub.tasks")

        for i in range(205):
            log.info(f"Demo log entry {i + 1}")

Additional Information

No response

@BeArchiTek BeArchiTek added the type/bug Something isn't working as expected label Mar 3, 2025
@exalate-issue-sync exalate-issue-sync bot added the state/need-triage This issue needs to be triaged label Mar 3, 2025
@dgarros dgarros added the group/backend Issue related to the backend (API Server, Git Agent) label Mar 4, 2025
@dgarros
Copy link
Collaborator

dgarros commented Mar 4, 2025

Would be good to check if the logs are present in Prefect in or not ?
Most-likely we need to implement some pagination when we retrieve the logs

@ogenstad
Copy link
Contributor

ogenstad commented Mar 4, 2025

Assuming this is the InfrahubTask query the backend should already do this. Isn't this a frontend issue?

@exalate-issue-sync exalate-issue-sync bot added the priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release label Mar 5, 2025
@wvandeun
Copy link
Contributor

wvandeun commented Mar 5, 2025

The prefect flow show the proper log entries:

Image

The InfrahubTask graphql query only returns 200 TaskLog nodes

Image

@ogenstad
Copy link
Contributor

ogenstad commented Mar 5, 2025

Reposting info from Slack. The cut at 200 comes from an environment variable within Prefect.

                "default_limit": {
                    "default": 200,
                    "description": "The default limit applied to queries that can return multiple objects, such as `POST /flow_runs/filter`.",
                    "supported_environment_variables": [
                        "PREFECT_SERVER_API_DEFAULT_LIMIT",
                        "PREFECT_API_DEFAULT_LIMIT"
                    ],
                    "title": "Default Limit",
                    "type": "integer"
                },
@router.post("/filter", response_class=ORJSONResponse)
async def read_flow_runs(
    sort: schemas.sorting.FlowRunSort = Body(schemas.sorting.FlowRunSort.ID_DESC),
    limit: int = dependencies.LimitBody(),
    offset: int = Body(0, ge=0),
    flows: Optional[schemas.filters.FlowFilter] = None,
    flow_runs: Optional[schemas.filters.FlowRunFilter] = None,
    task_runs: Optional[schemas.filters.TaskRunFilter] = None,
    deployments: Optional[schemas.filters.DeploymentFilter] = None,
    work_pools: Optional[schemas.filters.WorkPoolFilter] = None,
    work_pool_queues: Optional[schemas.filters.WorkQueueFilter] = None,
    db: PrefectDBInterface = Depends(provide_database_interface),
) -> List[schemas.responses.FlowRunResponse]:

While we can consider some form of warning for that I wonder if this initially should be resolved within the frontend by using pagination.

@dgarros
Copy link
Collaborator

dgarros commented Mar 5, 2025

While we can consider some form of warning for that I wonder if this initially should be resolved within the frontend by using pagination.

Yes that would be ideal but I don't think the backend is exposing the right API for it right now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) priority/2 This issue stalls work on the project or its dependents, it's a blocker for a release state/need-triage This issue needs to be triaged type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

5 participants