@codefresh-io/cf-telemetry 3.0.0 → 3.0.1
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,5 +1,5 @@
|
|
|
1
1
|
import { Attributes as A, Meter } from '@opentelemetry/api';
|
|
2
|
-
type Name<Prefix extends string = 'codefresh'> = Prefix extends '' ? `${string}
|
|
2
|
+
type Name<Prefix extends string = 'codefresh'> = Prefix extends '' ? `${string}.info` : `${Prefix}.${string}.info`;
|
|
3
3
|
/**
|
|
4
4
|
* InfoGauge is a specialized gauge for recording information metrics.
|
|
5
5
|
* It records a value of 1 for the current state and 0 for the previous state,
|
|
@@ -21,7 +21,7 @@ type Name<Prefix extends string = 'codefresh'> = Prefix extends '' ? `${string}_
|
|
|
21
21
|
* const meter = otel.cf.getMeter();
|
|
22
22
|
* const buildInfoGauge = new otel.cf.InfoGauge<ClassicBuildInfo>(
|
|
23
23
|
* meter,
|
|
24
|
-
* '
|
|
24
|
+
* 'codefresh.classic.build.info',
|
|
25
25
|
* 'Codefresh classic build info',
|
|
26
26
|
* ['build_id'],
|
|
27
27
|
* );
|
|
@@ -31,24 +31,24 @@ type Name<Prefix extends string = 'codefresh'> = Prefix extends '' ? `${string}_
|
|
|
31
31
|
* build_status: 'running',
|
|
32
32
|
* });
|
|
33
33
|
* // Results in the following state:
|
|
34
|
-
* //
|
|
34
|
+
* // codefresh.classic.build.info{ build_id: '111', build_status: 'running' } = 1
|
|
35
35
|
*
|
|
36
36
|
* buildInfoGauge.set({
|
|
37
37
|
* build_id: '111',
|
|
38
38
|
* build_status: 'success',
|
|
39
39
|
* });
|
|
40
40
|
* // Results in the following state:
|
|
41
|
-
* //
|
|
42
|
-
* //
|
|
41
|
+
* // codefresh.classic.build.info{ build_id: '111', build_status: 'running' } = 0
|
|
42
|
+
* // codefresh.classic.build.info{ build_id: '111', build_status: 'success' } = 1
|
|
43
43
|
*
|
|
44
44
|
* buildInfoGauge.set({
|
|
45
45
|
* build_id: '222',
|
|
46
46
|
* build_status: 'running',
|
|
47
47
|
* });
|
|
48
48
|
* // Results in the following state:
|
|
49
|
-
* //
|
|
50
|
-
* //
|
|
51
|
-
* //
|
|
49
|
+
* // codefresh.classic.build.info{ build_id: '111', build_status: 'running' } = 0
|
|
50
|
+
* // codefresh.classic.build.info{ build_id: '111', build_status: 'success' } = 1
|
|
51
|
+
* // codefresh.classic.build.info{ build_id: '222', build_status: 'running' } = 1
|
|
52
52
|
*/
|
|
53
53
|
export declare class InfoGauge<Attributes extends A, Prefix extends string = 'codefresh'> {
|
|
54
54
|
#private;
|
|
@@ -59,7 +59,7 @@ export declare class InfoGauge<Attributes extends A, Prefix extends string = 'co
|
|
|
59
59
|
* @param description the description of the gauge, used for documentation purposes.
|
|
60
60
|
* @param immutableAttributes an array of attribute keys that should be treated as immutable
|
|
61
61
|
* and will be used to identify unique series.
|
|
62
|
-
* For example, `
|
|
62
|
+
* For example, `codefresh.classic.build.info{ build_id, build_status }` will have
|
|
63
63
|
* immutable attribute `build_id`: this attribute is immutable and accurately characterizes
|
|
64
64
|
* a unique series for which the value of `build_status` can change over time.
|
|
65
65
|
*/
|
|
@@ -23,7 +23,7 @@ const api_1 = require("@opentelemetry/api");
|
|
|
23
23
|
* const meter = otel.cf.getMeter();
|
|
24
24
|
* const buildInfoGauge = new otel.cf.InfoGauge<ClassicBuildInfo>(
|
|
25
25
|
* meter,
|
|
26
|
-
* '
|
|
26
|
+
* 'codefresh.classic.build.info',
|
|
27
27
|
* 'Codefresh classic build info',
|
|
28
28
|
* ['build_id'],
|
|
29
29
|
* );
|
|
@@ -33,24 +33,24 @@ const api_1 = require("@opentelemetry/api");
|
|
|
33
33
|
* build_status: 'running',
|
|
34
34
|
* });
|
|
35
35
|
* // Results in the following state:
|
|
36
|
-
* //
|
|
36
|
+
* // codefresh.classic.build.info{ build_id: '111', build_status: 'running' } = 1
|
|
37
37
|
*
|
|
38
38
|
* buildInfoGauge.set({
|
|
39
39
|
* build_id: '111',
|
|
40
40
|
* build_status: 'success',
|
|
41
41
|
* });
|
|
42
42
|
* // Results in the following state:
|
|
43
|
-
* //
|
|
44
|
-
* //
|
|
43
|
+
* // codefresh.classic.build.info{ build_id: '111', build_status: 'running' } = 0
|
|
44
|
+
* // codefresh.classic.build.info{ build_id: '111', build_status: 'success' } = 1
|
|
45
45
|
*
|
|
46
46
|
* buildInfoGauge.set({
|
|
47
47
|
* build_id: '222',
|
|
48
48
|
* build_status: 'running',
|
|
49
49
|
* });
|
|
50
50
|
* // Results in the following state:
|
|
51
|
-
* //
|
|
52
|
-
* //
|
|
53
|
-
* //
|
|
51
|
+
* // codefresh.classic.build.info{ build_id: '111', build_status: 'running' } = 0
|
|
52
|
+
* // codefresh.classic.build.info{ build_id: '111', build_status: 'success' } = 1
|
|
53
|
+
* // codefresh.classic.build.info{ build_id: '222', build_status: 'running' } = 1
|
|
54
54
|
*/
|
|
55
55
|
class InfoGauge {
|
|
56
56
|
#gauge;
|
|
@@ -63,7 +63,7 @@ class InfoGauge {
|
|
|
63
63
|
* @param description the description of the gauge, used for documentation purposes.
|
|
64
64
|
* @param immutableAttributes an array of attribute keys that should be treated as immutable
|
|
65
65
|
* and will be used to identify unique series.
|
|
66
|
-
* For example, `
|
|
66
|
+
* For example, `codefresh.classic.build.info{ build_id, build_status }` will have
|
|
67
67
|
* immutable attribute `build_id`: this attribute is immutable and accurately characterizes
|
|
68
68
|
* a unique series for which the value of `build_status` can change over time.
|
|
69
69
|
*/
|