Custom routes via server.extend() can't emit WideEvents / telemetry (logger not exported)

Open
#483 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet

Research direction

Start with the server.extend() entry point used from onPluginsReady and review logging/logger.js alongside the package exports map. Compare the existing internal WideEvent usage with the public @databricks/appkit and beta exports. Done means custom routes have a documented or supported way to emit per-request structured telemetry, with the public API boundary and expected behavior clear.

Written by the indexing model from the issue text.

Description

Summary

Custom Express routes added via createApp({ onPluginsReady(appkit){ appkit.server.extend(app => …) } }) can't emit AppKit WideEvents / structured telemetry. Built-in plugin routes (analytics, files, genie) emit per-request WideEvents to the configured OTLP exporter, but custom routes have no supported way to do the same. console.log from a custom route reaches stdout but isn't part of the OTLP WideEvent/log export.

Version

@databricks/appkit 0.38.1 · Node 24 · Databricks Apps · telemetry configured via OTLP.

What I'm doing

Mounting custom HTTP routes (an MCP server over Streamable HTTP, plus a model-serving proxy) via server.extend() in onPluginsReady, and wanting per-request/per-tool observability alongside the plugin routes.

What I tried

Plugin routes use an internal logger:

import { createLogger } from ".../logging/logger.js";
const logger = createLogger("analytics");
logger.event(req)?.setComponent("analytics", "executeQuery").setContext("analytics", {...});

But that API isn't publicly reachable: createLogger / the WideEvent API is not exported from @databricks/appkit or @databricks/appkit/beta, and the package exports map (only ., ./beta, ./dist/shared/src/plugin, ./type-generator, ./package.json) blocks importing @databricks/appkit/dist/logging/logger.js.

Ask (any one)
  1. Export the WideEvent logger (createLogger + event/setComponent/setContext) as public API, or
  2. Document a supported way to emit WideEvents / structured telemetry from server.extend() routes, or
  3. Auto-instrument custom routes registered via server.extend().
Workaround

console.log (stdout only), or emitting a raw OTLP LogRecord via @opentelemetry/api-logs against the exporter AppKit already configures.

Dominant language
TypeScript
Stars
119
Forks
36
Avg merge
4d 16h
Merged PRs (30d)
37

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databricks/appkit

All issues in databricks/appkit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.