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

autoinstrumentation-python can't use prometheus exporter #3122

Closed
halleystar opened this issue Jul 12, 2024 · 1 comment · Fixed by #3138
Closed

autoinstrumentation-python can't use prometheus exporter #3122

halleystar opened this issue Jul 12, 2024 · 1 comment · Fixed by #3138
Labels

Comments

@halleystar
Copy link
Contributor

halleystar commented Jul 12, 2024

Component(s)

auto-instrumentation

What happened?

Description

autoinstrumentation-python can't use prometheus exporter

Steps to Reproduce

this is my auto auto-instrumentation.yaml
image

Expected Result

autoinstrumentation-python can use prometheus exporter

Actual Result

autoinstrumentation-python can't use prometheus exporter

Kubernetes Version

1.30

Operator version

0.103.0

Collector version

ignore

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

Log output

Defaulted container "flask-change" out of: flask-change, opentelemetry-auto-instrumentation-python (init)
Configuration of configurator failed
Traceback (most recent call last):
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 102, in _import_config_components
    next(
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 113, in _load_configurators
    entry_point.load()().configure(auto_instrumentation_version=__version__)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 439, in configure
    self._configure(**kwargs)
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 455, in _configure
    _initialize_components(**kwargs)
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 373, in _initialize_components
    span_exporters, metric_exporters, log_exporters = _import_exporters(
                                                      ^^^^^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 282, in _import_exporters
    ) in _import_config_components(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 119, in _import_config_components
    raise RuntimeError(
RuntimeError: Requested component 'prometheus' not found in entry point 'opentelemetry_metrics_exporter'
Failed to auto initialize opentelemetry
Traceback (most recent call last):
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 102, in _import_config_components
    next(
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 38, in initialize
    _load_configurators()
  File "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 124, in _load_configurators
    raise exc
  File "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 113, in _load_configurators
    entry_point.load()().configure(auto_instrumentation_version=__version__)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 439, in configure
    self._configure(**kwargs)
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 455, in _configure
    _initialize_components(**kwargs)
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 373, in _initialize_components
    span_exporters, metric_exporters, log_exporters = _import_exporters(
                                                      ^^^^^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 282, in _import_exporters
    ) in _import_config_components(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/otel-auto-instrumentation-python/opentelemetry/sdk/_configuration/__init__.py", line 119, in _import_config_components
    raise RuntimeError(
RuntimeError: Requested component 'prometheus' not found in entry point 'opentelemetry_metrics_exporter'
 * Serving Flask app 'main'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:5000
 * Running on http://10.244.0.28:5000

Additional context

I investigate there lack opentelemetry-exporter-prometheus==0.46b0. I can make a pr to fix this.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment