Add unique ID without impacting wildcard functionality

Open
#758 1 comment 3 reactions 0 assignees View on GitHub

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
Stale
Tech stack
javascript
Domain
observability

Research direction

Start by reviewing the library's extend behavior and wildcard matching, then trace how names are formatted and filtered. Define how a unique transaction ID should appear in log output while preserving patterns such as DEBUG=debug:app*:other_extend_call; done means both identification and wildcard filtering work together.

Written by the indexing model from the issue text.

Description

If a lot of different users interact with your application at the same time and calling async calls, you get log output that is a combination of all these actions and it's not easy to determine which log line is for which user/action/transaction/call_it_however_you_like.

I thought about using the extend function and add something like ":trans(transaction_id)" so the output would be:
debug:app(transaction_id) Some log output

But the problem here is that wildcards for enabling other extend calls would be an issue. For example DEBUG=debug:app*:other_extend_call which will not work.

Is there a way to add a transactionid to this without breaking the wildcard functionality? For example by just removing (transaction_id) using a replace somewhere in the library?

Dominant language
JavaScript
Stars
11.5k
Forks
992
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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 debug-js/debug

All issues in debug-js/debug

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.