snok / asgi-correlation-id

Request ID propagation for ASGI apps
MIT License
413 stars 32 forks source link

default_value no longer allowed in filter configuration #72

Closed jslvtr closed 1 year ago

jslvtr commented 1 year ago

Hello!

The docs suggest having a filter configuration like this:

'filters': {  # correlation ID filter must be added here to make the %(correlation_id)s formatter work
    'correlation_id': {
        '()': 'asgi_correlation_id.CorrelationIdFilter',
        'uuid_length': 8 if not settings.ENVIRONMENT == 'local' else 32,
        'default_value': '-',
    },
}

But I've found that including default_value results in an error. Removing it makes it work. I can't see default_value listed as a parameter in the CorrelationIdFilter. Maybe it's been removed, and the documentation should be updated? Or did I misunderstand something?

Thanks!

tlinhart commented 1 year ago

What package version you have installed? The support for filter default value was added just recently, in version 4.1.0.

jslvtr commented 1 year ago

Ah! That makes sense, I've got 4.0.0. /e not sure why, I just did a pip install and it went with 4.0.0. All good now though! Thank you!

Kind regards, Jose On 24 Feb 2023 at 16:26 +0000, Tomáš Linhart @.***>, wrote:

What package version you have installed? The support for filter default value was added just recently, in version 4.1.0. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

sondrelg commented 1 year ago

Heh, unexpected race condition :sweat_smile:

jslvtr commented 1 year ago

Oh, I see it was released 20 min ago 😂