File tree 2 files changed +15
-5
lines changed
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import {
25
25
ObservableUpDownCounter ,
26
26
BatchObservableCallback ,
27
27
Observable ,
28
- Attributes ,
29
28
Gauge ,
30
29
} from '@opentelemetry/api' ;
31
30
import {
@@ -52,10 +51,7 @@ export class Meter implements IMeter {
52
51
/**
53
52
* Create a {@link Gauge} instrument.
54
53
*/
55
- createGauge < AttributesTypes extends Attributes = Attributes > (
56
- name : string ,
57
- options ?: MetricOptions
58
- ) : Gauge < AttributesTypes > {
54
+ createGauge ( name : string , options ?: MetricOptions ) : Gauge {
59
55
const descriptor = createInstrumentDescriptor (
60
56
name ,
61
57
InstrumentType . GAUGE ,
Original file line number Diff line number Diff line change 13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
+ import { Context , MetricAttributes } from '@opentelemetry/api' ;
16
17
17
18
export type CommonReaderOptions = {
18
19
timeoutMillis ?: number ;
@@ -23,3 +24,16 @@ export type CollectionOptions = CommonReaderOptions;
23
24
export type ShutdownOptions = CommonReaderOptions ;
24
25
25
26
export type ForceFlushOptions = CommonReaderOptions ;
27
+
28
+ /**
29
+ * This is intentionally not using the API's type as it's only available from @opentelemetry/api 1.9.0 and up.
30
+ * In SDK 2.0 we'll be able to bump the minimum API version and remove this workaround.
31
+ */
32
+ export interface Gauge <
33
+ AttributesTypes extends MetricAttributes = MetricAttributes ,
34
+ > {
35
+ /**
36
+ * Records a measurement. Value of the measurement must not be negative.
37
+ */
38
+ record ( value : number , attributes ?: AttributesTypes , context ?: Context ) : void ;
39
+ }
You can’t perform that action at this time.
0 commit comments