Skip to content

Python - Allow auto installation in k8s clusters #82

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
1 task done
estolfo opened this issue Jun 27, 2024 · 6 comments
Closed
1 task done

Python - Allow auto installation in k8s clusters #82

estolfo opened this issue Jun 27, 2024 · 6 comments
Assignees

Comments

@estolfo
Copy link
Contributor

estolfo commented Jun 27, 2024

Some work should go upstream, here are the relevant issues:

Tasks

Preview Give feedback
  1. basic-distro
@xrmx
Copy link
Member

xrmx commented Jul 26, 2024

PR for cleanup the k8s operator handling of used OTLP protocol https://github.com/open-telemetry/opentelemetry-operator/pull/3165

@xrmx
Copy link
Member

xrmx commented Aug 28, 2024

Wondering if running django as python -m django runserver instead of python manage.py runserver would make a difference as per https://docs.python.org/3/library/sys.html#sys.path we should get the current working directory in sys.path if we call our script that way. The question is that sys.path is relevant for django.

@AlexanderWert AlexanderWert changed the title Allow auto installation in k8s clusters Python - Allow auto installation in k8s clusters Sep 5, 2024
@xrmx
Copy link
Member

xrmx commented Sep 23, 2024

Built a custom docker image for the k8s operator and it's evident that for Python this won't be a silver bullet. Problem is that a lot of libraries depends on C extensions that are platform dependant.

For example psutil (from system metrics instrumentation) built on an alpine distro but run into an ubuntu container will fail because of:

ImportError: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory

and this import (File "/otel-auto-instrumentation-python/elasticotel/distro/__init__.py", line 25, in <module>\nfrom opentelemetry.instrumentation.system_metrics import () comes from our distro so it should be fixed.

grpc aswell:

ImportError: cannot import name 'cygrpc' from 'grpc._cython' (/otel-auto-instrumentation-python/grpc/_cython/__init__.py)

From a different path though:

  File "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 39, in initialize
    _load_instrumentors(distro)
  File "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 91, in _load_instrumentors
    raise exc
  File "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 87, in _load_instrumentors
    distro.load_instrumentor(entry_point, skip_dep_check=True)

At the moment a failure of an instrumentor makes the whole process fail and in this scenario (or even generally?) it's not want we want.

@xrmx
Copy link
Member

xrmx commented Sep 26, 2024

So at the moment we are building one image based on the Python 3.12 chainguard image (glibc based). In order to cover more environments we should probably increase the matrix of the images we build with more python versions and/or with musl based base images.

@xrmx
Copy link
Member

xrmx commented Oct 8, 2024

A few otel operator related PRs to improve things:

  • one to set a default for logs exporting if one decide to enable them https://github.com/open-telemetry/opentelemetry-operator/pull/3330
  • one to handle musl based containers, if accepted we can work out of the box https://github.com/open-telemetry/opentelemetry-operator/pull/3332
  • the docs one documenting the issue with binary wheels https://github.com/open-telemetry/opentelemetry.io/pull/5338

Sorry, something went wrong.

@xrmx
Copy link
Member

xrmx commented Oct 14, 2024

Closing this and using #158 for the first round of followup improvements

@xrmx xrmx closed this as completed Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants