Skip to content

Logs fail to report after django startup #31

@quinnmil

Description

@quinnmil

Observed that while logs appear to send as expected in a django application, only the initial batch of startup logs do so, while all others (any logs stemming from request handlers) seem to be silently dropped and fail to report to our otel reporting endpoint.

I have been through the ringer trying to identity the source of this issue, but don't have anything concrete. I know that v1.0.0 (previous release) does not have this problem, but something about the latest batch of changed included in the latest release is causing this strange behavior.

I am quite confident that the culprit was introduced in #24.
This PR introduced an initialization lock, and removed a try/except/finally block. It wasn't a great PR (authored by yours truly) and at the time I choose to delay actually tagging a release until I gave the problem another look. Well.. we got busy and that never happened, so it was released as part of the v1.0.2 tag last week.

I have created so many local branches to try and nail down what exactly the issue is here, but am yet unable. I have added a ton of debug logging to the handler itself (using print statements to avoid any more recursion) and can confirm the otel_handler.emit is called just where we'd expect.

If anything, I may propose we just release a new tag which essentially rolls back all of #24 but keeps that scout_transaction_id rename. Problem here is that would be effectively a breaking change, as django users will need use use env variables for configuration.

However, as it stands now, the currently released version seems effectively broken, at least for django. So we should do something soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions