PATH:
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
sentry_sdk
import time from typing import TYPE_CHECKING, Any, Optional import sentry_sdk from sentry_sdk.utils import format_attribute if TYPE_CHECKING: from sentry_sdk._types import Attributes, Metric, MetricType def _capture_metric( name: str, metric_type: "MetricType", value: float, unit: "Optional[str]" = None, attributes: "Optional[Attributes]" = None, ) -> None: attrs: "Attributes" = {} if attributes: for k, v in attributes.items(): attrs[k] = format_attribute(v) metric: "Metric" = { "timestamp": time.time(), "trace_id": None, "span_id": None, "name": name, "type": metric_type, "value": float(value), "unit": unit, "attributes": attrs, } sentry_sdk.get_current_scope()._capture_metric(metric) def count( name: str, value: float, unit: "Optional[str]" = None, attributes: "Optional[dict[str, Any]]" = None, ) -> None: _capture_metric(name, "counter", value, unit, attributes) def gauge( name: str, value: float, unit: "Optional[str]" = None, attributes: "Optional[dict[str, Any]]" = None, ) -> None: _capture_metric(name, "gauge", value, unit, attributes) def distribution( name: str, value: float, unit: "Optional[str]" = None, attributes: "Optional[dict[str, Any]]" = None, ) -> None: _capture_metric(name, "distribution", value, unit, attributes)
[-] _compat.py
[edit]
[-] spotlight.py
[edit]
[-] monitor.py
[edit]
[-] sessions.py
[edit]
[-] client.py
[edit]
[-] metrics.py
[edit]
[+]
ai
[-] worker.py
[edit]
[-] serializer.py
[edit]
[-] _werkzeug.py
[edit]
[-] _batcher.py
[edit]
[-] envelope.py
[edit]
[-] _metrics_batcher.py
[edit]
[+]
crons
[-] _log_batcher.py
[edit]
[+]
__pycache__
[-] traces.py
[edit]
[-] _queue.py
[edit]
[-] py.typed
[edit]
[+]
..
[-] attachments.py
[edit]
[-] scope.py
[edit]
[+]
profiler
[-] session.py
[edit]
[-] transport.py
[edit]
[-] feature_flags.py
[edit]
[+]
integrations
[-] types.py
[edit]
[-] logger.py
[edit]
[-] api.py
[edit]
[-] consts.py
[edit]
[-] tracing.py
[edit]
[-] _span_batcher.py
[edit]
[-] debug.py
[edit]
[-] tracing_utils.py
[edit]
[-] utils.py
[edit]
[-] __init__.py
[edit]
[-] _init_implementation.py
[edit]
[-] _types.py
[edit]
[-] _lru_cache.py
[edit]
[-] hub.py
[edit]
[-] scrubber.py
[edit]