Skip to content

chore: OpenTelemetry tracing, hardened Dockerfile, and CONTRIBUTING guide (Closes #130 #131 #132) - #177

Open
MatanOga01 wants to merge 5 commits into
NovaCoreLabs1:mainfrom
MatanOga01:fix/matanoga-issues-130-131-132
Open

chore: OpenTelemetry tracing, hardened Dockerfile, and CONTRIBUTING guide (Closes #130 #131 #132)#177
MatanOga01 wants to merge 5 commits into
NovaCoreLabs1:mainfrom
MatanOga01:fix/matanoga-issues-130-131-132

Conversation

@MatanOga01

Copy link
Copy Markdown

Description

This PR closes all three issues currently assigned to @MatanOga01 in a single reviewable change set:

Closes #130
Closes #131
Closes #132

Change type

  • feat: OpenTelemetry tracing is a new feature
  • chore: build, CI, tooling
  • docs: documentation only

Test plan

  • cd backend && npm install — resolves 6 new OpenTelemetry deps; build passes.
  • cd backend && npm run build — nest build succeeds (exit 0).
  • cd backend && npm run lint — ESLint clean (exit 0).
  • cd backend && npm test -- --passWithNoTests — 23/23 tests pass across 6 suites.
  • docker build -t novalabs-backend . — produces distroless image running as UID 65532.
  • Telemetry smoke test: OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 npm --prefix backend run start:prod against a local Jaeger collects outbound-HTTP and Nest spans.

Screenshots

N/A — no UI changes.

Breaking changes

  • No breaking changes. Frontend next.config.ts and the contract workspace are untouched. One new optional env-var pair (OTEL_*) is documented in CONTRIBUTING.md and defaults preserve current behaviour. The start:prod script now preloads dist/telemetry.js via -r; if dist/telemetry.js is missing the script fails loudly on boot, intentionally — better than silent partial tracing.

PR contents

3 conventional commits:

  • feat(observability): add OpenTelemetry tracing to backend
  • chore(docker): add hardened multi-stage Dockerfile for backend
  • docs(contributing): add comprehensive contributor guide

Preloads the OpenTelemetry NodeSDK via backend/src/telemetry.ts, registered
through 'node -r ./dist/telemetry dist/main' in start:prod so the SDK can
patch http, express, typeorm/pg, ioredis and others before any Nest
module loads.

Includes:
  - backend/src/telemetry.ts (NodeSDK bootstrap, OTLP HTTP exporter, fs
    instrumentation disabled by default, swallow-all errors, SIGTERM/SIGINT
    shutdown, no-op when OTEL_SDK_DISABLED=true)
  - New deps: @opentelemetry/api, sdk-node, auto-instrumentations-node,
    exporter-trace-otlp-http, resources, semantic-conventions
  - start:prod script now preloads telemetry before booting Nest

Closes part of NovaCoreLabs1#131.
Three-stage build (deps, build, runtime) emitting a distroless Node 20
image that runs as the built-in nonroot user (UID 65532). Build context
is tightly scoped via .dockerignore (.git, node_modules, contracts/target,
.env, secrets, IDE noise). Templates included via nest-cli.json assets.

Closes part of NovaCoreLabs1#130.
Covers: code of conduct, bug/feature templates, security disclosures,
local dev setup, branching, Conventional Commits, pre-commit checklist,
backend/frontend/contracts style & module architecture, OpenTelemetry
activation env vars and a local Jaeger recipe, hardened Docker build/run
instructions, testing (Jest/Stryker/ESLint/cargo), PR process, label
triage guide.

Closes part of NovaCoreLabs1#132.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant