@codefresh-io/cf-telemetry 2.0.0-alpha.24 → 2.0.0-alpha.26
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.
- package/dist/metrics/prometheus/config.js +1 -1
- package/dist/metrics/prometheus/config.js.map +1 -1
- package/dist/metrics/prometheus/helpers.d.ts +8 -0
- package/dist/metrics/prometheus/helpers.js +13 -0
- package/dist/metrics/prometheus/helpers.js.map +1 -0
- package/dist/metrics/prometheus/public.d.ts +1 -0
- package/dist/metrics/prometheus/public.js +24 -1
- package/dist/metrics/prometheus/public.js.map +1 -1
- package/dist/otel/public.d.ts +1 -1
- package/dist/otel/public.js +4 -24
- package/dist/otel/public.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ const getContentType = () => {
|
|
|
8
8
|
openmetrics: prom_client_1.Registry.OPENMETRICS_CONTENT_TYPE,
|
|
9
9
|
};
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
-
const contentType = process.env['CF_TELEMETRY_PROMETHEUS_CONTENT_TYPE'] ??
|
|
11
|
+
const contentType = process.env['CF_TELEMETRY_PROMETHEUS_CONTENT_TYPE'] ?? 'openmetrics';
|
|
12
12
|
const knownTypes = Object.keys(ContentType);
|
|
13
13
|
if (!knownTypes.includes(contentType)) {
|
|
14
14
|
throw new Error(`Invalid value in CF_TELEMETRY_PROMETHEUS_CONTENT_TYPE: "${contentType}". Allowed values: "${knownTypes.join('|')}"`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/metrics/prometheus/config.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AAEvC,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,MAAM,WAAW,GAAG;QAClB,UAAU,EAAE,sBAAQ,CAAC,uBAAuB;QAC5C,WAAW,EAAE,sBAAQ,CAAC,wBAAwB;KACtC,CAAC;IACX,8DAA8D;IAC9D,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/metrics/prometheus/config.ts"],"names":[],"mappings":";;;AAAA,6CAAuC;AAEvC,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,MAAM,WAAW,GAAG;QAClB,UAAU,EAAE,sBAAQ,CAAC,uBAAuB;QAC5C,WAAW,EAAE,sBAAQ,CAAC,wBAAwB;KACtC,CAAC;IACX,8DAA8D;IAC9D,MAAM,WAAW,GAA8B,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAS,IAAI,aAAa,CAAC;IAC5H,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,2DAA2D,WAAW,uBAAuB,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxI,CAAC;IACD,OAAO,WAAW,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,KAAK,MAAM;IACjE,2BAA2B,EAAE,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,KAAK,MAAM;IACrG,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,IAAI,SAAS;IAC9D,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,IAAI,MAAM,EAAE,EAAE,CAAC;IAChF,WAAW,EAAE,cAAc,EAAE;IAC7B,aAAa,EAAE,EAAE;CACT,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExemplarLabels = void 0;
|
|
4
|
+
const sdk_node_1 = require("@opentelemetry/sdk-node");
|
|
5
|
+
/**
|
|
6
|
+
* Get exemplar labels for Prometheus metrics with enabled exemplars.
|
|
7
|
+
*/
|
|
8
|
+
const getExemplarLabels = () => {
|
|
9
|
+
const { spanId, traceId } = sdk_node_1.api.trace.getActiveSpan()?.spanContext() ?? {};
|
|
10
|
+
return { spanId, traceId };
|
|
11
|
+
};
|
|
12
|
+
exports.getExemplarLabels = getExemplarLabels;
|
|
13
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/metrics/prometheus/helpers.ts"],"names":[],"mappings":";;;AAAA,sDAA8C;AAO9C;;GAEG;AACI,MAAM,iBAAiB,GAAG,GAAmB,EAAE;IACpD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,cAAG,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAC3E,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC,CAAC;AAHW,QAAA,iBAAiB,qBAG5B"}
|
|
@@ -2,3 +2,4 @@ export * from 'prom-client';
|
|
|
2
2
|
export { register } from './client';
|
|
3
3
|
export { Counter, Gauge, Histogram, Summary, } from './metrics';
|
|
4
4
|
export type { CounterConfiguration, GaugeConfiguration, HistogramConfiguration, MetricConfiguration, Metric, SummaryConfiguration, } from './metrics';
|
|
5
|
+
export * as helpers from './helpers';
|
|
@@ -11,11 +11,33 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
11
11
|
if (k2 === undefined) k2 = k;
|
|
12
12
|
o[k2] = m[k];
|
|
13
13
|
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
14
19
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
20
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
21
|
};
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
17
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.Summary = exports.Histogram = exports.Gauge = exports.Counter = exports.register = void 0;
|
|
40
|
+
exports.helpers = exports.Summary = exports.Histogram = exports.Gauge = exports.Counter = exports.register = void 0;
|
|
19
41
|
__exportStar(require("prom-client"), exports);
|
|
20
42
|
var client_1 = require("./client");
|
|
21
43
|
Object.defineProperty(exports, "register", { enumerable: true, get: function () { return client_1.register; } });
|
|
@@ -24,4 +46,5 @@ Object.defineProperty(exports, "Counter", { enumerable: true, get: function () {
|
|
|
24
46
|
Object.defineProperty(exports, "Gauge", { enumerable: true, get: function () { return metrics_1.Gauge; } });
|
|
25
47
|
Object.defineProperty(exports, "Histogram", { enumerable: true, get: function () { return metrics_1.Histogram; } });
|
|
26
48
|
Object.defineProperty(exports, "Summary", { enumerable: true, get: function () { return metrics_1.Summary; } });
|
|
49
|
+
exports.helpers = __importStar(require("./helpers"));
|
|
27
50
|
//# sourceMappingURL=public.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/metrics/prometheus/public.ts"],"names":[],"mappings":";AAAA,wBAAwB
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/metrics/prometheus/public.ts"],"names":[],"mappings":";AAAA,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAExB,8CAA4B;AAC5B,mCAAoC;AAA3B,kGAAA,QAAQ,OAAA;AACjB,qCAKmB;AAJjB,kGAAA,OAAO,OAAA;AACP,gGAAA,KAAK,OAAA;AACL,oGAAA,SAAS,OAAA;AACT,kGAAA,OAAO,OAAA;AAUT,qDAAqC"}
|
package/dist/otel/public.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export *
|
|
1
|
+
export * from '@opentelemetry/sdk-node';
|
package/dist/otel/public.js
CHANGED
|
@@ -11,29 +11,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
11
11
|
if (k2 === undefined) k2 = k;
|
|
12
12
|
o[k2] = m[k];
|
|
13
13
|
}));
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
36
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports
|
|
38
|
-
exports.api = __importStar(require("@opentelemetry/api"));
|
|
18
|
+
__exportStar(require("@opentelemetry/sdk-node"), exports);
|
|
39
19
|
//# sourceMappingURL=public.js.map
|
package/dist/otel/public.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/otel/public.ts"],"names":[],"mappings":";AAAA,wBAAwB
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/otel/public.ts"],"names":[],"mappings":";AAAA,wBAAwB;;;;;;;;;;;;;;;;AAExB,0DAAwC"}
|