mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-23 17:16:33 +00:00
Exclude non-Supervisor Server Error codes from Sentry reporting (#5718)
* Exclude non-Supervisor Server Error codes from Sentry reporting Exclude status codes 502 Bad Gateway and 503 Service Unavailable from Sentry aiohttp integration. These are returned by Supervisor itself when acting as a proxy for Home Assistant Core. These aren't errors of Supervisor. * ruff check
This commit is contained in:
parent
f8bab20728
commit
1355ef192d
@ -5,6 +5,7 @@ from functools import partial
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from aiohttp.web_exceptions import HTTPBadGateway, HTTPServiceUnavailable
|
||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
from sentry_sdk.integrations.aiohttp import AioHttpIntegration
|
from sentry_sdk.integrations.aiohttp import AioHttpIntegration
|
||||||
from sentry_sdk.integrations.asyncio import AsyncioIntegration
|
from sentry_sdk.integrations.asyncio import AsyncioIntegration
|
||||||
@ -33,7 +34,15 @@ def init_sentry(coresys: CoreSys) -> None:
|
|||||||
auto_enabling_integrations=False,
|
auto_enabling_integrations=False,
|
||||||
default_integrations=False,
|
default_integrations=False,
|
||||||
integrations=[
|
integrations=[
|
||||||
AioHttpIntegration(),
|
AioHttpIntegration(
|
||||||
|
failed_request_status_codes=frozenset(range(500, 600))
|
||||||
|
- set(
|
||||||
|
{
|
||||||
|
HTTPBadGateway.status_code,
|
||||||
|
HTTPServiceUnavailable.status_code,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
AsyncioIntegration(),
|
AsyncioIntegration(),
|
||||||
ExcepthookIntegration(),
|
ExcepthookIntegration(),
|
||||||
DedupeIntegration(),
|
DedupeIntegration(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user