autometrics-dev / autometrics-py

Easily add metrics to your code that actually help you spot and debug issues in production. Built on Prometheus and OpenTelemetry.
https://autometrics.dev
Apache License 2.0
214 stars 7 forks source link

Stdout output for OpenTelemetry Exporter #104

Closed Nlea closed 9 months ago

Nlea commented 9 months ago

I use the autometrics-py version 0.9 and like to setup the Otel Exporter. The only output I see in my console is a warning that seems to come from the underlying Otel Exporter saying: Overriding of current MeterProvider is not allowed

I have tried out two different setups for calling init:

  1. running the exact example from the repo: https://github.com/autometrics-dev/autometrics-py/blob/main/examples/export_metrics/otlp-http.py
  2. In my FastAPI SetUp
    @app.on_event("startup")
    def initOtelExporter():
    init(
    exporter={
        "type": "otlp-proto-http",
        "endpoint": "http://otel-collector:4318",
        "push_interval": 1000,
    },
    service_name="otlp-exporter",   
    )

The printed output stays the same in both scenarios.

Nlea commented 9 months ago

is fixed by installing the package from the source.