1.7.10 • Published 2 years ago

@ailo/monitoring v1.7.10

Weekly downloads
168
License
MIT
Repository
github
Last release
2 years ago

@ailo/monitoring

Utilities for setting up logging and tracing for Ailo node.js services.

Usage

yarn add @ailo/monitoring @ailo/service-utils @sentry/node @sentry/tracing
// src/common/config.ts
import { parseNumberEnv, parseBooleanEnv } from "@ailo/service-utils";

export const config = {
  ...,
  sentry: {
    enabled:
      parseBooleanEnv(process.env.SENTRY_ENABLE) ??
      process.env.NODE_ENV === "production",
    environment: process.env.SENTRY_ENV ?? process.env.NODE_ENV ?? "local",
    dsn:
      process.env.SENTRY_DSN ||
      "https://abcdef.ingest.sentry.io/123456",
    tracesSampleRate:
      parseNumberEnv(process.env.SENTRY_TRACES_SAMPLE_RATE) ??
      (process.env.NODE_ENV === "production" ? 0.01 : 1)
  }
};

// src/common/monitoring.ts
import { SentryMonitoring } from "@ailo/monitoring";
import { config } from "./config";

export const monitoring = new SentryMonitoring(config.sentry);

// src/app/app.ts
import "local/common/monitoring";

Development

yarn
yarn start

Testing

yarn lint # prettier and eslint
yarn test # unit tests
yarn test:watch # unit tests in watch mode

Releasing

Note: Releasing is done manually (CI isn't configured yet). Linters, tests, build and so on are run during each git push / yarn release.

yarn release # will automatically ask you about version bump, run tests and build, and push new version to git & npm
1.7.10

2 years ago

1.7.8

2 years ago

1.7.6

4 years ago

1.7.5

4 years ago

1.7.3

4 years ago

1.7.2

5 years ago

1.7.1

5 years ago

1.6.2

5 years ago

1.7.0

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago