Skip to content

Commit

Permalink
refactor(telemetry): move shutdown helper to internal
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Mar 30, 2023
1 parent b99575d commit e6e4c8e
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@endo/far": "^0.2.14",
"@endo/marshal": "^0.8.1",
"@endo/promise-kit": "^0.2.52",
"anylogger": "^0.21.0",
"jessie.js": "^0.3.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global process */
import process from 'node:process';
import anylogger from 'anylogger';

const console = anylogger('shutdown');
Expand Down
2 changes: 1 addition & 1 deletion packages/solo/src/pipe-entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { makePromiseKit } from '@endo/promise-kit';

import '@agoric/cosmic-swingset/src/anylogger-agoric.js';
import { connectToFakeChain } from '@agoric/cosmic-swingset/src/sim-chain.js';
import { makeShutdown } from '@agoric/telemetry/src/shutdown.js';
import { makeShutdown } from '@agoric/internal/src/node/shutdown.js';

const { registerShutdown } = makeShutdown(false);
registerShutdown(() => process.exit());
Expand Down
2 changes: 1 addition & 1 deletion packages/solo/src/pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path';
import { makePromiseKit } from '@endo/promise-kit';
import { parse, stringify } from '@endo/marshal';

import { makeShutdown } from '@agoric/telemetry/src/shutdown.js';
import { makeShutdown } from '@agoric/internal/src/node/shutdown.js';

const filename = new URL(import.meta.url).pathname;
const dirname = path.dirname(filename);
Expand Down
2 changes: 1 addition & 1 deletion packages/solo/src/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
} from '@agoric/swingset-vat';
import { openSwingStore } from '@agoric/swing-store';
import { makeWithQueue } from '@agoric/internal/src/queue.js';
import { makeShutdown } from '@agoric/telemetry/src/shutdown.js';
import { makeShutdown } from '@agoric/internal/src/node/shutdown.js';
import {
makeDefaultMeterProvider,
getTelemetryProviders,
Expand Down
2 changes: 1 addition & 1 deletion packages/telemetry/src/otel-trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {

import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { Resource } from '@opentelemetry/resources';
import { makeShutdown } from '@agoric/internal/src/node/shutdown.js';

import { getResourceAttributes } from './index.js';
import { makeSlogToOtelKit } from './slog-to-otel.js';
import { makeShutdown } from './shutdown.js';

// These numbers are chosen to attempt to export all spans.
export const SPAN_MAX_QUEUE_SIZE = 100_000;
Expand Down
2 changes: 1 addition & 1 deletion packages/telemetry/src/slog-sender-pipe-entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '@endo/init';

import { makeAggregateError } from '@agoric/internal';
import anylogger from 'anylogger';
import { makeShutdown } from './shutdown.js';
import { makeShutdown } from '@agoric/internal/src/node/shutdown.js';

import { makeSlogSender } from './make-slog-sender.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/telemetry/src/slog-sender-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import anylogger from 'anylogger';

import { makeQueue } from '@endo/stream';

import { makeShutdown } from './shutdown.js';
import { makeShutdown } from '@agoric/internal/src/node/shutdown.js';

const filename = new URL(import.meta.url).pathname;
const dirname = path.dirname(filename);
Expand Down

0 comments on commit e6e4c8e

Please sign in to comment.