mirror of
https://github.com/langgenius/dify.git
synced 2026-01-14 06:07:33 +08:00
Some checks are pending
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions
60 lines
1.7 KiB
Python
60 lines
1.7 KiB
Python
from pydantic import Field
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class OTelConfig(BaseSettings):
|
|
"""
|
|
OpenTelemetry configuration settings
|
|
"""
|
|
|
|
ENABLE_OTEL: bool = Field(
|
|
description="Whether to enable OpenTelemetry",
|
|
default=False,
|
|
)
|
|
|
|
OTLP_TRACE_ENDPOINT: str = Field(
|
|
description="OTLP trace endpoint",
|
|
default="",
|
|
)
|
|
|
|
OTLP_METRIC_ENDPOINT: str = Field(
|
|
description="OTLP metric endpoint",
|
|
default="",
|
|
)
|
|
|
|
OTLP_BASE_ENDPOINT: str = Field(
|
|
description="OTLP base endpoint",
|
|
default="http://localhost:4318",
|
|
)
|
|
|
|
OTLP_API_KEY: str = Field(
|
|
description="OTLP API key",
|
|
default="",
|
|
)
|
|
|
|
OTEL_EXPORTER_TYPE: str = Field(
|
|
description="OTEL exporter type",
|
|
default="otlp",
|
|
)
|
|
|
|
OTEL_EXPORTER_OTLP_PROTOCOL: str = Field(
|
|
description="OTLP exporter protocol ('grpc' or 'http')",
|
|
default="http",
|
|
)
|
|
|
|
OTEL_SAMPLING_RATE: float = Field(default=0.1, description="Sampling rate for traces (0.0 to 1.0)")
|
|
|
|
OTEL_BATCH_EXPORT_SCHEDULE_DELAY: int = Field(
|
|
default=5000, description="Batch export schedule delay in milliseconds"
|
|
)
|
|
|
|
OTEL_MAX_QUEUE_SIZE: int = Field(default=2048, description="Maximum queue size for the batch span processor")
|
|
|
|
OTEL_MAX_EXPORT_BATCH_SIZE: int = Field(default=512, description="Maximum export batch size")
|
|
|
|
OTEL_METRIC_EXPORT_INTERVAL: int = Field(default=60000, description="Metric export interval in milliseconds")
|
|
|
|
OTEL_BATCH_EXPORT_TIMEOUT: int = Field(default=10000, description="Batch export timeout in milliseconds")
|
|
|
|
OTEL_METRIC_EXPORT_TIMEOUT: int = Field(default=30000, description="Metric export timeout in milliseconds")
|