@codefresh-io/cf-telemetry 2.3.0-alpha.1 → 2.3.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,8 @@
1
- import type { Attributes, Meter } from '@opentelemetry/api';
2
- export declare class InfoGauge<A extends Attributes> {
1
+ import { Attributes, Meter } from '@opentelemetry/api';
2
+ type Name<Prefix extends string = 'codefresh'> = Prefix extends '' ? `${string}_info` : `${Prefix}_${string}_info`;
3
+ export declare class InfoGauge<A extends Attributes, Prefix extends string = 'codefresh'> {
3
4
  #private;
4
- constructor(meter: Meter, ...gaugeParams: Parameters<Meter['createGauge']>);
5
- set(attributes: A): void;
5
+ constructor(meter: Meter, name: Name<Prefix>, description: string);
6
+ set(attributes: Partial<A>): void;
6
7
  }
8
+ export {};
@@ -1,11 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InfoGauge = void 0;
4
+ const api_1 = require("@opentelemetry/api");
4
5
  class InfoGauge {
5
6
  #gauge;
6
7
  #lastAttributes = null;
7
- constructor(meter, ...gaugeParams) {
8
- this.#gauge = meter.createGauge(...gaugeParams);
8
+ constructor(meter, name, description) {
9
+ this.#gauge = meter.createGauge(name, {
10
+ description,
11
+ valueType: api_1.ValueType.INT,
12
+ unit: '', // No unit for info gauges
13
+ });
9
14
  }
10
15
  set(attributes) {
11
16
  if (this.#lastAttributes) {
@@ -1 +1 @@
1
- {"version":3,"file":"info-gauge.js","sourceRoot":"","sources":["../../../src/otel/cf/info-gauge.ts"],"names":[],"mappings":";;;AAEA,MAAa,SAAS;IACpB,MAAM,CAAW;IACjB,eAAe,GAAa,IAAI,CAAC;IAEjC,YAAY,KAAY,EAAE,GAAG,WAA6C;QACxE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,CAAC;IAClD,CAAC;IAED,GAAG,CAAC,UAAa;QACf,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC9C,CAAC;QACD,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC,eAAe,EAAE,GAAG,UAAU,EAAE,CAAC;QACpE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;QACxC,IAAI,CAAC,eAAe,KAAK,gBAAgB,CAAC;IAC5C,CAAC;CACF;AAhBD,8BAgBC"}
1
+ {"version":3,"file":"info-gauge.js","sourceRoot":"","sources":["../../../src/otel/cf/info-gauge.ts"],"names":[],"mappings":";;;AAAA,4CAAyE;AAMzE,MAAa,SAAS;IACpB,MAAM,CAAW;IACjB,eAAe,GAAa,IAAI,CAAC;IAEjC,YAAY,KAAY,EAAE,IAAkB,EAAE,WAAmB;QAC/D,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE;YACpC,WAAW;YACX,SAAS,EAAE,eAAS,CAAC,GAAG;YACxB,IAAI,EAAE,EAAE,EAAE,0BAA0B;SACrC,CAAC,CAAC;IACL,CAAC;IAED,GAAG,CAAC,UAAsB;QACxB,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC9C,CAAC;QACD,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC,eAAe,EAAE,GAAG,UAAU,EAAE,CAAC;QACpE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,gBAAqB,CAAC,CAAC;QAC7C,IAAI,CAAC,eAAe,KAAK,gBAAqB,CAAC;IACjD,CAAC;CACF;AApBD,8BAoBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefresh-io/cf-telemetry",
3
- "version": "2.3.0-alpha.1",
3
+ "version": "2.3.0-alpha.2",
4
4
  "exports": {
5
5
  "./init": {
6
6
  "import": "./dist/init.mjs",