fix: sentry config float type err (#5416)

This commit is contained in:
takatost 2024-06-20 11:28:52 +08:00 committed by GitHub
parent 940c2faea1
commit a51ec2094f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
from typing import Optional from typing import Optional
from pydantic import BaseModel, Field, PositiveFloat from pydantic import BaseModel, Field, NonNegativeFloat
class SentryConfigs(BaseModel): class SentryConfigs(BaseModel):
@ -12,12 +12,12 @@ class SentryConfigs(BaseModel):
default=None, default=None,
) )
SENTRY_TRACES_SAMPLE_RATE: PositiveFloat = Field( SENTRY_TRACES_SAMPLE_RATE: NonNegativeFloat = Field(
description='Sentry trace sample rate', description='Sentry trace sample rate',
default=1.0, default=1.0,
) )
SENTRY_PROFILES_SAMPLE_RATE: PositiveFloat = Field( SENTRY_PROFILES_SAMPLE_RATE: NonNegativeFloat = Field(
description='Sentry profiles sample rate', description='Sentry profiles sample rate',
default=1.0, default=1.0,
) )