Sentry integration uses sentry_sdk package under the hood.
To bootstrap Sentry, you must provide at least:
sentry_dsn- tells sentry-sdk where to send the events.
Additional parameters can also be supplied through the settings object:
sentry_traces_sample_rate- in the range of 0.0 to 1.0, the percentage chance a given transaction will be sentsentry_sample_rate- in the range of 0.0 to 1.0, the sample rate for error eventssentry_max_breadcrumbs- the total amount of breadcrumbssentry_max_value_length- the max event payload lengthsentry_attach_stacktrace- if True, stack traces are automatically attached to all messages loggedsentry_integrations- list of integrations to enablesentry_tags- key/value string pairs that are both indexed and searchablesentry_additional_params** - additional params, which will be passed tosentry_sdk.init`
Read more about sentry_sdk params here.
To bootstrap Prometheus, you must provide at least:
prometheus_metrics_path.
Additional parameters:
prometheus_metrics_include_in_schema.
Prometheus's integration for Litestar requires prometheus_client package.
Additional parameters for Litestar integration:
prometheus_additional_params- passed tolitestar.plugins.prometheus.PrometheusConfig.
Prometheus's integration for FastStream requires prometheus_client package.
To bootstrap Prometheus for FastStream, you must provide additionally:
prometheus_middleware_cls.
Prometheus's integration for FastAPI uses prometheus_fastapi_instrumentator package.
Additional parameters for FastAPI integration:
prometheus_instrumentator_params- passed toprometheus_fastapi_instrumentator.Instrumentatorprometheus_instrument_params- passed tomethod Instrumentator(...).instrumentprometheus_expose_params- passed tomethod Instrumentator(...).expose.
To bootstrap Opentelemetry, you must provide at least:
opentelemetry_endpoint.
Additional parameters:
opentelemetry_service_name- if provided, will be passed to theResourceinstead ofservice_name.opentelemetry_container_name- will be passed to theResource.opentelemetry_endpoint- will be passed toOTLPSpanExporteras endpoint.opentelemetry_namespace- will be passed to theResource.opentelemetry_insecure- is opentelemetry connection secure.opentelemetry_instrumentors- a list of extra instrumentors.opentelemetry_log_traces- traces will be logged to stdout.opentelemetry_generate_health_check_spans- generate spans for health check handlers ifTrue.
Additional parameters for Litestar and FastAPI:
opentelemetry_excluded_urls- by default, heath checks and metrics paths will be excluded.
For FastStream you must provide additionally:
opentelemetry_middleware_cls
To bootstrap Structlog, you must set service_debug to False
Additional parameters:
logging_log_levellogging_flush_levellogging_buffer_capacitylogging_extra_processorslogging_unset_handlers.
To bootstrap CORS headers, you must provide cors_allowed_origins or cors_allowed_origin_regex.
Additional params:
cors_allowed_methodscors_allowed_headerscors_exposed_headerscors_allowed_credentialscors_max_age
To bootstrap swagger, you have the following parameters:
swagger_static_path- path for offline docs staticswagger_pathswagger_offline_docs- option to turn on offline docs.
For Litestar swagger_path is required to bootstrap swagger instrument.
To bootstrap Health checks, you must provide set health_checks_enabled to True.
Additional params:
health_checks_pathhealth_checks_include_in_schema