@toa.io/extensions.telemetry 1.0.0-alpha.298 → 1.0.0-alpha.300

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/extensions.telemetry",
3
- "version": "1.0.0-alpha.298",
3
+ "version": "1.0.0-alpha.300",
4
4
  "type": "module",
5
5
  "description": "Toa Telemetry extension",
6
6
  "author": "temich <tema.gurtovoy@gmail.com>",
@@ -29,9 +29,9 @@
29
29
  "transpile": "tsc"
30
30
  },
31
31
  "dependencies": {
32
- "@toa.io/definitions": "1.0.0-alpha.298",
32
+ "@toa.io/definitions": "1.0.0-alpha.300",
33
33
  "@toa.io/generic": "1.0.0-alpha.292",
34
34
  "openspan": "1.0.0-alpha.293"
35
35
  },
36
- "gitHead": "334fad8726adfa7507462c33b509ce7db9db853f"
36
+ "gitHead": "f91131a9aeb29aa271f177c4055ddcf0cda8c75e"
37
37
  }
@@ -1,10 +1,21 @@
1
- import type { Connector, Locator } from '@toa.io/core';
1
+ import type { Locator } from '@toa.io/core';
2
2
  import type { extensions } from '@toa.io/core/types';
3
+ type Resident = extensions.Resident;
3
4
  export declare class Factory implements extensions.Factory {
4
5
  private readonly logsOptions;
5
6
  private readonly ready;
6
7
  constructor();
7
8
  aspect(locator: Locator): extensions.Aspect[];
8
- manage(composition: Connector): Connector;
9
+ /**
10
+ * The probe answers for the process, so it is the process it belongs to — and not whichever
11
+ * composition happens to be nearest, which in a service is the one nested inside it. That is
12
+ * why the explorer reported ready when the components it hosts connected rather than when
13
+ * the explorer did, and why the gateway carries a probe of its own to work around it.
14
+ *
15
+ * It binds before the process is built and answers `503` until `complete()`, which is the
16
+ * phase the `connect` this used to patch was standing in for.
17
+ */
18
+ resident(): Resident | null;
9
19
  private createLogs;
10
20
  }
21
+ export {};
@@ -27,19 +27,17 @@ export class Factory {
27
27
  const span = new Span(locator);
28
28
  return [logs, span];
29
29
  }
30
- manage(composition) {
31
- if (this.ready === null)
32
- return composition;
33
- const ready = this.ready;
34
- // the composition manages the probe server lifecycle (listen on connect, close on disconnect)
35
- composition.depends(ready);
36
- const connect = composition.connect.bind(composition);
37
- // readiness is a post-connect phase, not expressible as a dependency
38
- composition.connect = async () => {
39
- await connect();
40
- await ready.complete();
41
- };
42
- return composition;
30
+ /**
31
+ * The probe answers for the process, so it is the process it belongs to — and not whichever
32
+ * composition happens to be nearest, which in a service is the one nested inside it. That is
33
+ * why the explorer reported ready when the components it hosts connected rather than when
34
+ * the explorer did, and why the gateway carries a probe of its own to work around it.
35
+ *
36
+ * It binds before the process is built and answers `503` until `complete()`, which is the
37
+ * phase the `connect` this used to patch was standing in for.
38
+ */
39
+ resident() {
40
+ return this.ready;
43
41
  }
44
42
  createLogs(locator) {
45
43
  const overEnv = environment.get(`${LOGS_PREFIX}_${locator.uppercase}`);
@@ -1 +1 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../source/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAA;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAMlC,MAAM,OAAO,OAAO;IACD,WAAW,CAAa;IACxB,KAAK,CAAc;IAEpC;QACE,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QAC5C,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAA;QAEnE,IA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