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

Fire-and-forget logging mode #6933

Open
teh-cmc opened this issue Jul 18, 2024 · 3 comments
Open

Fire-and-forget logging mode #6933

teh-cmc opened this issue Jul 18, 2024 · 3 comments
Labels
🪵 Log & send APIs Affects the user-facing API for all languages user-request This is a pressing issue for one of our users
Milestone

Comments

@teh-cmc
Copy link
Member

teh-cmc commented Jul 18, 2024

It is pretty common to want to log data in a fire-and-forget kind of way, e.g. drop data if there is no viewer listening in when using connect().

Surprisingly (to me, at least?), we do not seem to offer any way of doing this at the moment. Data always gets buffered either a the RecordingStream layer or in one the Sinks, there's just no way to drop it.

@teh-cmc teh-cmc added user-request This is a pressing issue for one of our users 🪵 Log & send APIs Affects the user-facing API for all languages labels Jul 18, 2024
@rgolovanov
Copy link
Contributor

@teh-cmc could you clarify a bit the problem? when does it occur?

According to API documentation:

        /// flush_timeout_sec:
        /// The minimum time the SDK will wait during a flush before potentially
        /// dropping data if progress is not being made. Passing a negative value indicates no
        /// timeout, and can cause a call to `flush` to block indefinitely.
        ///
        /// This function returns immediately.
        Error connect(std::string_view tcp_addr = "127.0.0.1:9876", float flush_timeout_sec = 2.0)
            const;

the flush_timeout_sec should handle problems with connect and drop all accumulated buffer if the viewer wasn't connected within specified time limit.

@teh-cmc teh-cmc added this to the 0.19 milestone Aug 8, 2024
@teh-cmc
Copy link
Member Author

teh-cmc commented Aug 8, 2024

flush_timeout_sec = 0 should indeed work, but it simply didn't the last time I tried it.

Either there's a bug in its implementation, or there is something else entirely that is also buffering data.

@DevonMorris
Copy link

Any updates on when you think this will land? We still periodically struggle with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪵 Log & send APIs Affects the user-facing API for all languages user-request This is a pressing issue for one of our users
Projects
None yet
Development

No branches or pull requests

4 participants