8000 Add NoopClient to segment.go to allow running without telemetry in case of errors · Issue #4085 · crc-org/crc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add NoopClient to segment.go to allow running without telemetry in case of errors #4085

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

Closed
redbeam opened this issue Mar 26, 2024 · 3 comments
Assignees

Comments

@redbeam
Copy link
Contributor
redbeam commented Mar 26, 2024

Discussed in #4023

Currently, any error in the initialization of segment client prevents the program to run. Since it only deals with telemetry collection, it should not block other, more important parts of the program.

I propose implementing a "mock" segment client (NoopClient) that will be returned if the initialization of the real segment client fails. This way, the execution of the command is not interrupted by any error in telemetry. If this happens, the mock client will return a warning stating that telemetry will not be available in current session and its methods will do nothing.

@redbeam redbeam self-assigned this Mar 26, 2024
@gbraad
Copy link
Contributor
gbraad commented Mar 27, 2024

its methods will do nothing

logging?

@gbraad gbraad moved this to Work In Progress in Project planning: crc Mar 27, 2024
@redbeam
Copy link
Contributor Author
redbeam commented Mar 27, 2024

Yes, the methods can log their "inactivity". But I'm not sure if every call needs to do that. Maybe only the first would be enough.

@gbraad
Copy link
Contributor
gbraad commented Mar 28, 2024

It depends on the state:

We might want to understand the NoopClient received the call and continues to execute the regular method. Just to be sure, we have full traceability when an error occurs. Logs are rotated anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants
0