|
1 | 1 | import dataclasses |
2 | 2 | from _typeshed import Incomplete |
3 | 3 | from abc import ABC |
| 4 | +from opentelemetry.context import Context |
4 | 5 | from opentelemetry.metrics import CallbackT as CallbackT, Counter, Histogram, Instrument, Meter, MeterProvider, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter, _Gauge |
5 | 6 | from opentelemetry.util.types import Attributes |
6 | 7 | from threading import Lock |
@@ -45,17 +46,17 @@ class _ProxyAsynchronousInstrument(_ProxyInstrument[InstrumentT], ABC): |
45 | 46 | def __init__(self, instrument: InstrumentT, name: str, callbacks: Sequence[CallbackT] | None, unit: str, description: str) -> None: ... |
46 | 47 |
|
47 | 48 | class _ProxyCounter(_ProxyInstrument[Counter], Counter): |
48 | | - def add(self, amount: int | float, attributes: Attributes | None = None) -> None: ... |
| 49 | + def add(self, amount: int | float, attributes: Attributes | None = None, context: Context | None = None) -> None: ... |
49 | 50 |
|
50 | 51 | class _ProxyHistogram(_ProxyInstrument[Histogram], Histogram): |
51 | | - def record(self, amount: int | float, attributes: Attributes | None = None) -> None: ... |
| 52 | + def record(self, amount: int | float, attributes: Attributes | None = None, context: Context | None = None) -> None: ... |
52 | 53 |
|
53 | 54 | class _ProxyObservableCounter(_ProxyAsynchronousInstrument[ObservableCounter], ObservableCounter): ... |
54 | 55 | class _ProxyObservableGauge(_ProxyAsynchronousInstrument[ObservableGauge], ObservableGauge): ... |
55 | 56 | class _ProxyObservableUpDownCounter(_ProxyAsynchronousInstrument[ObservableUpDownCounter], ObservableUpDownCounter): ... |
56 | 57 |
|
57 | 58 | class _ProxyUpDownCounter(_ProxyInstrument[UpDownCounter], UpDownCounter): |
58 | | - def add(self, amount: int | float, attributes: Attributes | None = None) -> None: ... |
| 59 | + def add(self, amount: int | float, attributes: Attributes | None = None, context: Context | None = None) -> None: ... |
59 | 60 |
|
60 | 61 | class _ProxyGauge(_ProxyInstrument[Gauge], Gauge): |
61 | | - def set(self, amount: int | float, attributes: Attributes | None = None) -> None: ... |
| 62 | + def set(self, amount: int | float, attributes: Attributes | None = None, context: Context | None = None) -> None: ... |
0 commit comments