Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"workspaces": {
"packages/appkit": {
"ignoreDependencies": ["vitest"]
"ignoreDependencies": ["vitest", "@databricks/sdk-experimental"]
},
"packages/appkit-ui": {
"ignoreDependencies": ["tailwindcss", "tw-animate-css"]
Expand Down
5 changes: 3 additions & 2 deletions packages/appkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"dependencies": {
"@ast-grep/napi": "0.37.0",
"@databricks/lakebase": "workspace:*",
"@databricks/sdk-experimental": "0.17.0",
"@mlflow/core": "0.4.0",
"@opentelemetry/api": "1.9.0",
"@opentelemetry/api-logs": "0.219.0",
"@opentelemetry/auto-instrumentations-node": "0.77.0",
Expand All @@ -83,8 +85,8 @@
"@opentelemetry/resources": "2.8.0",
"@opentelemetry/sdk-logs": "0.219.0",
"@opentelemetry/sdk-metrics": "2.8.0",
"@opentelemetry/sdk-node": "0.219.0",
"@opentelemetry/sdk-trace-base": "2.8.0",
"@opentelemetry/sdk-trace-node": "2.8.0",
"@opentelemetry/semantic-conventions": "1.38.0",
"@types/semver": "7.7.1",
"apache-arrow": "21.1.0",
Expand All @@ -95,7 +97,6 @@
"jiti": "2.6.1",
"js-yaml": "4.3.1",
"magic-string": "0.30.21",
"mlflow-tracing": "0.1.3",
"obug": "2.1.1",
"pg": "8.18.0",
"picocolors": "1.1.1",
Expand Down
6 changes: 6 additions & 0 deletions packages/appkit/src/core/appkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ export class AppKit<TPlugins extends InputPluginMap> {
const instance = new AppKit(mergedConfig);

await Promise.all(instance.#setupPromises);

// Build the global tracer provider now that every plugin's setup() has run
// and contributed any span processors. Deferred to here so a single provider
// carries all processors (OTLP + plugin-contributed); see TelemetryManager.
TelemetryManager.start();

await instance.#context.emitLifecycle("setup:complete");

const handle = instance as unknown as PluginMap<T>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ vi.mock("../../telemetry", async () => {
...actual,
TelemetryManager: {
initialize: vi.fn(),
start: vi.fn(),
registerSpanProcessor: vi.fn(),
getProvider: () => ({
getTracer: () => ({
startActiveSpan: vi.fn((_name: string, fn: (span: any) => any) =>
Expand Down
7 changes: 7 additions & 0 deletions packages/appkit/src/plugins/agents/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import {
currentTraceId,
initAgentTracing,
linkTraceToRun,
startAgentTracing,
traceAgent,
} from "./mlflow";
import { composePromptForAgent } from "./prompt";
Expand Down Expand Up @@ -201,6 +202,12 @@ export class AgentsPlugin extends Plugin implements ToolProvider {

async setup() {
await initAgentTracing();
// Seed mlflow's config right after TelemetryManager.start() (before the
// server serves), so the first turn's request-root span is forwarded and
// that turn assembles into a trace — not dropped as a cold-start artifact.
this.context?.onLifecycle("setup:complete", () => {
startAgentTracing();
});
const { agents, defaultAgentName } = await this.buildAgentRegistry();
this.agents = agents;
this.defaultAgentName = defaultAgentName;
Expand Down
Loading
Loading