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 -- Initialisation Google Instrument because of other Google dependencies #62

Closed
cvarrei opened this issue Jul 17, 2024 · 1 comment · Fixed by #63
Closed

Bug -- Initialisation Google Instrument because of other Google dependencies #62

cvarrei opened this issue Jul 17, 2024 · 1 comment · Fixed by #63

Comments

@cvarrei
Copy link
Contributor

cvarrei commented Jul 17, 2024

By using another implementation of Ecologits than Google's in my project, because one of my dependencies from another library is ‘google-auth’, my environment contains a ‘google’ module but without the generative-ai aspect. It tries to initialise the Google instrumentor, but (rightly) fails. I did a few tests, using the specific generative Google module (google-generativeai) modifying this :

def init_google_instrumentor() -> None:
    if importlib.util.find_spec("google") is not None:
        from ecologits.tracers.google_tracer import GoogleInstrumentor

to:

def init_google_instrumentor() -> None:
    if importlib.util.find_spec("google-generativeai") is not None:
        from ecologits.tracers.google_tracer import GoogleInstrumentor

This fixes the bug, but it may need to be tested to ensure that it doesn't affect the correct functioning of the Google tracer.

@adrienbanse adrienbanse linked a pull request Jul 17, 2024 that will close this issue
@adrienbanse
Copy link
Member

Thanks @cvarrei!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants