X7ROOT File Manager
Current Path:
/opt/hc_python/lib/python3.12/site-packages/sentry_sdk
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
/
📁
..
📄
__init__.py
(1.38 KB)
📁
__pycache__
📄
_compat.py
(3.04 KB)
📄
_init_implementation.py
(2.5 KB)
📄
_log_batcher.py
(5.37 KB)
📄
_lru_cache.py
(1.2 KB)
📄
_metrics_batcher.py
(4.92 KB)
📄
_queue.py
(10.99 KB)
📄
_types.py
(10.18 KB)
📄
_werkzeug.py
(3.65 KB)
📁
ai
📄
api.py
(14.92 KB)
📄
attachments.py
(3.04 KB)
📄
client.py
(41.11 KB)
📄
consts.py
(52.47 KB)
📁
crons
📄
debug.py
(1019 B)
📄
envelope.py
(10.23 KB)
📄
feature_flags.py
(2.18 KB)
📄
hub.py
(25.14 KB)
📁
integrations
📄
logger.py
(2.73 KB)
📄
metrics.py
(2 KB)
📄
monitor.py
(3.55 KB)
📁
profiler
📄
py.typed
(0 B)
📄
scope.py
(63.89 KB)
📄
scrubber.py
(5.92 KB)
📄
serializer.py
(13.22 KB)
📄
session.py
(5.46 KB)
📄
sessions.py
(8.96 KB)
📄
spotlight.py
(8.47 KB)
📄
tracing.py
(50.53 KB)
📄
tracing_utils.py
(39.59 KB)
📄
transport.py
(31.13 KB)
📄
types.py
(1.24 KB)
📄
utils.py
(62.4 KB)
📄
worker.py
(4.36 KB)
Editing: metrics.py
""" NOTE: This file contains experimental code that may be changed or removed at any time without prior notice. """ import time from typing import Any, Optional, TYPE_CHECKING, Union import sentry_sdk from sentry_sdk.utils import safe_repr if TYPE_CHECKING: from sentry_sdk._types import Metric, MetricType def _capture_metric( name, # type: str metric_type, # type: MetricType value, # type: float unit=None, # type: Optional[str] attributes=None, # type: Optional[dict[str, Any]] ): # type: (...) -> None client = sentry_sdk.get_client() attrs = {} # type: dict[str, Union[str, bool, float, int]] if attributes: for k, v in attributes.items(): attrs[k] = ( v if ( isinstance(v, str) or isinstance(v, int) or isinstance(v, bool) or isinstance(v, float) ) else safe_repr(v) ) metric = { "timestamp": time.time(), "trace_id": None, "span_id": None, "name": name, "type": metric_type, "value": float(value), "unit": unit, "attributes": attrs, } # type: Metric client._capture_metric(metric) def count( name, # type: str value, # type: float unit=None, # type: Optional[str] attributes=None, # type: Optional[dict[str, Any]] ): # type: (...) -> None _capture_metric(name, "counter", value, unit, attributes) def gauge( name, # type: str value, # type: float unit=None, # type: Optional[str] attributes=None, # type: Optional[dict[str, Any]] ): # type: (...) -> None _capture_metric(name, "gauge", value, unit, attributes) def distribution( name, # type: str value, # type: float unit=None, # type: Optional[str] attributes=None, # type: Optional[dict[str, Any]] ): # type: (...) -> None _capture_metric(name, "distribution", value, unit, attributes)
Upload File
Create Folder