Fix OTel Collector deployment and Winston log shipping to Axiom - #358
Merged
Merged
Conversation
The OTel Collector was never deployed to production (stale docker-compose.yml on server). Three issues fixed: - Add user: "0:0" to collector so it can read Docker container logs - Target existing dofek-logs dataset (token is scoped, can't create new ones) - Added AXIOM_API_TOKEN to server .env for collector auth Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…umentation WinstonInstrumentation doesn't work in ESM apps (type: module) because it relies on CJS require hooks that can't patch ESM imports. Replace it with @opentelemetry/winston-transport which adds an OTel transport directly to the Winston logger — no module hooking needed. Also: - Add explicit OTEL_EXPORTER_OTLP_LOGS_ENDPOINT to docker-compose (proto exporter doesn't resolve from generic endpoint alone) - Add ESM hook to entrypoint.sh for future instrumentation compatibility - Update instrumentation tests for removed WinstonInstrumentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Knip correctly flagged this as unused after switching to @opentelemetry/winston-transport. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Asherlc
added a commit
that referenced
this pull request
Mar 31, 2026
* fix: restore OTel Collector and fix log shipping to Axiom The OTel Collector was never deployed to production (stale docker-compose.yml on server). Three issues fixed: - Add user: "0:0" to collector so it can read Docker container logs - Target existing dofek-logs dataset (token is scoped, can't create new ones) - Added AXIOM_API_TOKEN to server .env for collector auth Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: bridge Winston to OTel via transport instead of broken ESM instrumentation WinstonInstrumentation doesn't work in ESM apps (type: module) because it relies on CJS require hooks that can't patch ESM imports. Replace it with @opentelemetry/winston-transport which adds an OTel transport directly to the Winston logger — no module hooking needed. Also: - Add explicit OTEL_EXPORTER_OTLP_LOGS_ENDPOINT to docker-compose (proto exporter doesn't resolve from generic endpoint alone) - Add ESM hook to entrypoint.sh for future instrumentation compatibility - Update instrumentation tests for removed WinstonInstrumentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove unused @opentelemetry/instrumentation-winston dependency Knip correctly flagged this as unused after switching to @opentelemetry/winston-transport. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
user: "0:0") so it can read Docker container logs, and targeting the existingdofek-logsAxiom dataset (ingest token is scoped)./v1/logsfrom the genericOTEL_EXPORTER_OTLP_ENDPOINTalone. Added explicitOTEL_EXPORTER_OTLP_LOGS_ENDPOINTto all containers.WinstonInstrumentationrelies on CJS require hooks that can't patch ESM imports ("type": "module"). Switched to@opentelemetry/winston-transportwhich adds an OTel transport directly to the Winston logger, loaded lazily only when OTLP is configured.Test plan
src/instrumentation.test.tsupdated for removed WinstonInstrumentation)🤖 Generated with Claude Code