Skip to content

Support diagnostic channels #6353

Closed
pillarjs/router
#196

Description

@bjohansebas

It has been mentioned several times, both in meetings and other issues, to provide support for diagnostic channels, which seems to be something that wants to be integrated into Express no matter what. I am posting this in the issue in case anyone is interested in working on it.

The integration should also be done in the router module.

Activity

  1. dpopp07 commented on Feb 20, 2025

    @dpopp07
    Contributor

    +1 as it could be a useful way to share diagnostic info throughout the ecosystem.

    I'm interested in working on this. That said, before getting too far it might be worth discussing the desired direction for both logging and diagnostics overall.

    I know @wesleytodd has talked about integrating pino as a logger a few times and while these tools do different things to solve different problems, I imagine they could end up working together. As they are related, I think it would be good to align on the strategy for each of them for v6.

    I opened expressjs/discussions#341 to discuss.

  2. wesleytodd commented on Mar 5, 2025

    @wesleytodd
    Member

    pillarjs/router#96

    I am hoping to consolidate this work into the Performance WG since mostly this will be used to observe performance (while recognizing it serves other o11y purposes).

    Additionally @simon-id, @Qard, @timfish, and @AbhiPrasad have all either worked in this area or mentioned interest in this work. I will keep this open until we have a better place to discuss, but want to point folks to this Perf WG proposal so we can get everyone involved in a productive way with that.

  3. ahmed-abdalkder commented on Jun 24, 2025

    @ahmed-abdalkder

    Hi! I'm interested in working on this issue. Could you please assign it to me?

  4. wesleytodd commented on Jun 24, 2025

    @wesleytodd
    Member

    @ahmed-abdalkder, we typically do not assign issues like this. Please feel free to open PRs and issues in the relevant areas.

  5. dohrisalim commented on Nov 9, 2025

    @dohrisalim

    I can implement Node.js diagnostic channels support in Express. I understand this involves instrumenting key lifecycle events like request/response cycles, middleware execution, and route matching. I'll add the diagnostics_channel integration points while maintaining backward compatibility and providing clear documentation for monitoring use cases.

  6. efekrskl commented on Nov 10, 2025

    @efekrskl
    Member

    Hi @dohrisalim, as Wesley already mentioned, feel free to open a PR with your implementation.

  7. added a commit that references this issue on Dec 27, 2025
    a401a4b
  8. added a commit that references this issue on Feb 21, 2026
    ea0417f
  9. logaretm commented on Mar 16, 2026

    @logaretm

    @efekrskl @wesleytodd I have been contributing tracing channels support across a few libraries (redis, pg, mysql2, nitro) recently, so I'm happy to help adopt this into express as it feels like a must have for an instrumentation future without monkey patching.

    I noticed there are already a few PRs/issues/discussions sprinkled here and there for this. Any chance to resolve those to see what's missing or perhaps do we need a place to spec this out first properly? like how many channels do we need, what context information to pass, etc...

  10. added a commit that references this issue on Apr 7, 2026
    20bc659
  11. MakenRosa commented on Jun 20, 2026

    @MakenRosa

    A first implementation should probably be a small diagnostics contract PR, not a logging abstraction.

    Concrete slice:

    1. Start in pillarjs/router, because route/layer matching lives there and Express can consume it without duplicating matching logic.
    2. Define only lifecycle channels for routing: router:route:match, router:route:start, router:route:end, router:route:error (or namespaced under express:router:* if maintainers prefer a public namespace).
    3. Use stable payload fields: { req, route, layer, params } for match/start/end and { req, route, layer, params, error } for error. Avoid response body, timing policy, or logger integration in the first PR.
    4. Gate publishes through the normal diagnostics_channel subscriber checks so the no-subscriber path stays close to current performance.
    5. Add Express integration tests that subscribe to the router channels during a request and verify ordering for success and error middleware.

    That gives the Perf WG a concrete observable surface to iterate on without coupling the first change to a logger or tracing vendor.

  12. LeonxLJX commented on Sep 1, 2026

    @LeonxLJX

    I'd like to take this one (Support diagnostic channels). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)

  13. LeonxLJX commented on Sep 1, 2026

    @LeonxLJX

    I'd like to take this one (Support diagnostic channels). I'll look into the root cause and follow up with a PR. (claiming via @LeonxLJX)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions