@nestjs/observe 0.3.13 → 0.3.14

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.
@@ -164,6 +164,19 @@ export declare class ObserveAgentWorker implements OnModuleInit, OnApplicationSh
164
164
  /** The worker's messages, errors, and the restart when it dies. */
165
165
  private watchWorker;
166
166
  handleMessage(msg: string): void;
167
+ /** Whether this process has said the collector accepted its first batch. */
168
+ private reportedConnection;
169
+ /**
170
+ * Says once, at the default level, that a batch got through.
171
+ *
172
+ * Without it a working setup and a silent one look the same: the startup
173
+ * line fires before anything is sent, and success is otherwise logged only
174
+ * under `debug`. Keyed off the degraded verdict because the worker posts it
175
+ * on every 200 and on nothing else. The first batch is usually runtime
176
+ * metrics alone, sent before the app has served anything - so the line says
177
+ * requests and jobs follow traffic, which a laptop run may never have.
178
+ */
179
+ private reportFirstAcceptedBatch;
167
180
  /**
168
181
  * What the last reply said the collector does with spans.
169
182
  *
@@ -77,6 +77,7 @@ const SCAFFOLD_APP_KEY = "YOUR_APP_KEY";
77
77
  const SCAFFOLD_APP_SECRET = "YOUR_APP_SECRET";
78
78
  const DEMO_URL = "https://www.observe-demo.nestjs.com/dashboard";
79
79
  const SIGN_UP_URL = "https://observe.nestjs.com";
80
+ const DASHBOARD_URL = `${SIGN_UP_URL}/dashboard`;
80
81
  let ObserveAgentWorker = ObserveAgentWorker_1 = class ObserveAgentWorker {
81
82
  observeAgentSharedBuffer;
82
83
  options;
@@ -566,6 +567,7 @@ let ObserveAgentWorker = ObserveAgentWorker_1 = class ObserveAgentWorker {
566
567
  }
567
568
  const mode = parseDegradedMessage(msg);
568
569
  if (mode !== null) {
570
+ this.reportFirstAcceptedBatch();
569
571
  this.applyIngestMode(mode, parseOveragePauseReason(msg));
570
572
  return;
571
573
  }
@@ -577,6 +579,27 @@ let ObserveAgentWorker = ObserveAgentWorker_1 = class ObserveAgentWorker {
577
579
  this.logger.debug(msg);
578
580
  }
579
581
  }
582
+ /** Whether this process has said the collector accepted its first batch. */
583
+ reportedConnection = false;
584
+ /**
585
+ * Says once, at the default level, that a batch got through.
586
+ *
587
+ * Without it a working setup and a silent one look the same: the startup
588
+ * line fires before anything is sent, and success is otherwise logged only
589
+ * under `debug`. Keyed off the degraded verdict because the worker posts it
590
+ * on every 200 and on nothing else. The first batch is usually runtime
591
+ * metrics alone, sent before the app has served anything - so the line says
592
+ * requests and jobs follow traffic, which a laptop run may never have.
593
+ */
594
+ reportFirstAcceptedBatch() {
595
+ if (this.reportedConnection) {
596
+ return;
597
+ }
598
+ this.reportedConnection = true;
599
+ this.logger.log(this.isHostedCollector
600
+ ? `Observe is connected: the collector accepted this app's first batch. Requests and jobs appear at ${DASHBOARD_URL} as soon as the app serves them.`
601
+ : `Observe is connected: ${this.endpoint} accepted this app's first batch.`);
602
+ }
580
603
  /**
581
604
  * What the last reply said the collector does with spans.
582
605
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/observe",
3
- "version": "0.3.13",
3
+ "version": "0.3.14",
4
4
  "description": "Observability and APM agent for NestJS - traces, runtime metrics and custom metrics",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "homepage": "https://observe.nestjs.com",