Skip to content

(excluded_urls) 'str' object has no attribute 'url_disabled' in OpenTelemetryMiddleware #3562

Open
@CarlosRCDev

Description

@CarlosRCDev

Describe your environment

OS: Red Hat Enterprise Linux Server release 7.8
Python version: Python 3.12.1
SDK version: 1.34.0
API version: 1.33.1
opentelemetry.instrumentation.asgi version: 0.54b1

What happened?

If set value "excluded_urls" in OpenTelemetryMiddleware, class fails: 'str' object has no attribute 'url_disabled'.
I'am using Quart, but i think the problem is here:
lib/python3.12/site-packages/opentelemetry/instrumentation/asgi/init.py -> Line 684

if self.excluded_urls and self.excluded_urls.url_disabled(url):
    return await self.app(scope, receive, send)

Steps to Reproduce

OpenTelemetryMiddleware(
        app.asgi_app,
        excluded_urls="ping,v2/api-docs"
    )

Expected Result

no errors and filter by comma-separated text

Actual Result

OpenTelemetryMiddleware, class fails: 'str' object has no attribute 'url_disabled'.

Additional context

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions