Skip to content

evals(v4): OTEL o11y UX (doctor/welcome + cli shutdown) - #2762

Open
miguelg719 wants to merge 1 commit into
miguelgonzalez/evals-v4-otel-harness-spansfrom
miguelgonzalez/evals-v4-otel-ux
Open

evals(v4): OTEL o11y UX (doctor/welcome + cli shutdown)#2762
miguelg719 wants to merge 1 commit into
miguelgonzalez/evals-v4-otel-harness-spansfrom
miguelgonzalez/evals-v4-otel-ux

Conversation

@miguelg719

@miguelg719 miguelg719 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Why

Stack 6/6.

What

  • doctor + welcomeStatus surface the LangSmith key.
  • cli.ts flushes/shuts down the tracer on SIGINT/SIGTERM (otel-gated, error-swallowing).

Testing

typecheck + unit + build green.

Base: #2761


Summary by cubic

Surfaces the LangSmith API key in doctor/welcome and flushes OTEL traces on CLI shutdown to improve observability. Previously these views omitted LangSmith and the CLI exited without flushing spans; now, when trace transport is "otel", the CLI waits for tracer shutdown on SIGINT/SIGTERM and ignores shutdown errors.

  • doctor and welcome show the LangSmith API key, preferring LANGSMITH_API_KEY and falling back to LANGCHAIN_API_KEY; welcomeStatus records which var was used and doctor labels it.
  • On SIGINT/SIGTERM, if transport is "otel", the CLI awaits shutdownTracing() before exit; errors are swallowed. Non-OTEL behavior is unchanged.
  • No migration required.

Written for commit e601252. Summary will update on new commits.

Review in cubic

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e601252

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Architecture diagram
sequenceDiagram
    participant CLI as CLI Entry (cli.ts)
    participant Doctor as Doctor Command (tui/commands/doctor.ts)
    participant Welcome as Welcome Status (tui/welcomeStatus.ts)
    participant Env as Environment Snapshot
    participant OTEL as OTEL Framework (framework/otel.ts)
    participant Tracer as Tracer (shutdown/flush)
    participant Langsmith as LangSmith Provider

    Note over CLI,Welcome: OTEL Observability UX

    Welcome->>Env: snapshotEnv()
    Env->>Env: langSmithEntry() - resolve LANGSMITH_API_KEY first
    alt LANGSMITH_API_KEY set
        Env-->>Welcome: ProviderKeyEntry (set)
    else LANGSMITH_API_KEY not set
        Env->>Env: fallback to LANGCHAIN_API_KEY
        Env-->>Welcome: ProviderKeyEntry (set/optional)
    end
    Welcome-->>CLI: env snapshot with langsmith entry

    Doctor->>Doctor: renderHuman(report)
    Doctor->>Doctor: keyRow("LANGSMITH_API_KEY", ...)
    Doctor-->>CLI: displays LangSmith key status

    Note over CLI,OTEL: CLI Shutdown Signal Handling

    alt SIGINT/SIGTERM received
        CLI->>CLI: handleSignal(code)
        CLI->>CLI: try resolveTraceTransport()
        alt trace transport is "otel"
            CLI->>OTEL: import shutdownTracing()
            OTEL->>Tracer: await shutdown()
            Tracer-->>OTEL: completed/flushed
            OTEL-->>CLI: done
        else non-OTEL transport
            CLI->>CLI: no tracer shutdown (unchanged)
        end
        CLI->>CLI: process.exit(code)
    else normal exit
        CLI->>CLI: continue execution
    end
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/evals/tui/commands/doctor.ts Outdated
@miguelg719
miguelg719 force-pushed the miguelgonzalez/evals-v4-otel-ux branch from 569556b to c313f54 Compare August 17, 2026 19:46
@miguelg719
miguelg719 force-pushed the miguelgonzalez/evals-v4-otel-ux branch from c313f54 to 9a714c1 Compare August 17, 2026 20:04
@miguelg719
miguelg719 force-pushed the miguelgonzalez/evals-v4-otel-ux branch from 9a714c1 to cacb00c Compare August 17, 2026 21:03
@miguelg719
miguelg719 force-pushed the miguelgonzalez/evals-v4-otel-ux branch from cacb00c to 179ca03 Compare August 17, 2026 22:05
@miguelg719
miguelg719 force-pushed the miguelgonzalez/evals-v4-otel-ux branch from 179ca03 to 7e0c01f Compare August 17, 2026 22:07
@miguelg719
miguelg719 force-pushed the miguelgonzalez/evals-v4-otel-ux branch from 7e0c01f to e601252 Compare August 17, 2026 22:34
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