Skip to content

Commit

Permalink
chore: resolve otel version from import
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaakola-aiven committed Dec 20, 2024
1 parent d945983 commit a8214a7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/karapace/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,22 @@ class KarapaceTags(BaseModel):
app: str = "Karapace"


OTEL_VERSION = ""
try:
from opentelemetry import version as otel_version

OTEL_VERSION = otel_version.__version__
except:
pass


class KarapaceTelemetry(BaseModel):
otel_endpoint_url: str | None = None
resource_service_name: str = "karapace"
resource_service_instance_id: str = "karapace"
resource_telemetry_sdk_name: str = "opentelemetry"
resource_telemetry_sdk_language: str = "python"
resource_telemetry_sdk_version: str = "1.27.0"
resource_telemetry_sdk_version: str = OTEL_VERSION


class Config(BaseSettings):
Expand Down

0 comments on commit a8214a7

Please sign in to comment.