Skip to content

fix: patch logger and Docker build to emit query-completed logs#1

Open
tvansteenburgh wants to merge 1 commit into
stacklet/v1.6.6from
tvan/chore/logging-patch
Open

fix: patch logger and Docker build to emit query-completed logs#1
tvansteenburgh wants to merge 1 commit into
stacklet/v1.6.6from
tvan/chore/logging-patch

Conversation

@tvansteenburgh
Copy link
Copy Markdown

@tvansteenburgh tvansteenburgh commented May 28, 2026

ENG-7523

what

  • Patch prodLogger in cubejs-server-core to unconditionally emit
    "Performing query completed" messages regardless of log level
  • Introduce scripts/build-docker.sh to compile locally patched packages
    and stage their dist/ output into
    packages/cubejs-docker/stacklet-patches/ before docker build
  • Update packages/cubejs-docker/latest.Dockerfile to overlay any
    *-dist/ directories found in stacklet-patches/ onto the
    npm-installed package versions
  • Add packages/cubejs-docker/DEVELOPMENT.md documenting the Stacklet
    build workflow

why

The CloudWatch log metric filter in platform-cubejs-schemas relies on
"Performing query completed" messages to track pre-aggregation runs, but
the upstream logger gates them on log level. Our goal is to preserve these
specific log lines needed for metrics without the expense of running at
trace-level logging across the board. The Docker image installs packages
from npm via yarn install --prod, so local TypeScript changes compiled
into packages/*/dist/ are silently ignored. The build script and
Dockerfile overlay ensure the patched logger is always present in the
resulting image.

testing

docs

  • Updated packages/cubejs-docker/DEVELOPMENT.md with Stacklet build instructions and pattern for adding future patched packages.
  • Will update Cube build guide once this lands.

…7523)

[ENG-7523](https://stacklet.atlassian.net/browse/ENG-7523)

### what

- Patch `prodLogger` in `cubejs-server-core` to unconditionally emit
  "Performing query completed" messages regardless of log level
- Introduce `scripts/build-docker.sh` to compile locally patched packages
  and stage their `dist/` output into
  `packages/cubejs-docker/stacklet-patches/` before `docker build`
- Update `packages/cubejs-docker/latest.Dockerfile` to overlay any
  `*-dist/` directories found in `stacklet-patches/` onto the
  npm-installed package versions
- Add `packages/cubejs-docker/DEVELOPMENT.md` documenting the Stacklet
  build workflow

### why

The CloudWatch log metric filter in `platform-cubejs-schemas` relies on
"Performing query completed" messages to track pre-aggregation runs, but
the upstream logger gates them on log level. Our goal is to preserve these
specific log lines needed for metrics without the expense of running at
trace-level logging across the board. The Docker image installs packages
from npm via `yarn install --prod`, so local TypeScript changes compiled
into `packages/*/dist/` are silently ignored. The build script and
Dockerfile overlay ensure the patched logger is always present in the
resulting image.

### testing

Run `./scripts/build-docker.sh <tag>` and verify:
  docker run --rm <tag> grep -c "Performing query completed" \
    /cube/node_modules/@cubejs-backend/server-core/dist/src/core/logger.js
Expected output: 2

### docs

Updated `packages/cubejs-docker/DEVELOPMENT.md` with Stacklet build
instructions and pattern for adding future patched packages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant