Skip to content

Deploy docs: --minify-syntax also strips function names, breaking OpenTelemetry span naming #802

@turisanapo

Description

@turisanapo

What is the type of issue?

Documentation is incorrect, Documentation is confusing

What is the issue?

The Deploy to Production page recommends --minify-whitespace --minify-syntax for production builds and warns that only --minify breaks OpenTelemetry:

Bun does have --minify flag that will minify the binary.
However if we are using OpenTelemetry, it's going to reduce a function name to a single character.

This was accurate until Bun's PR oven-sh/bun#22492 (merged September 2025), which added function/class expression name removal to --minify-syntax. Since that change, --minify-syntax also strips function names — not by renaming them to a single character, but by removing them entirely from function expressions.

This breaks @elysiajs/opentelemetry span naming, since the plugin reads Function.name from lifecycle hooks (.resolve(), .onBeforeHandle(), etc.) to label spans. In production traces, named spans like resolveAuthContext appear as raw hex span IDs (e.g., 9339fc914c291242) instead.

Where did you find it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions