-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move trace ID generation into a single function
In the future, we might optimize this to use a less-intensive method to generate IDs
- Loading branch information
1 parent
45be0b3
commit e9079aa
Showing
3 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package graph | ||
|
||
import ( | ||
"github.com/google/uuid" | ||
) | ||
|
||
// NewTraceID generates a new trace ID. The trace IDs will only be unique with | ||
// a single dispatch request tree and should not be used for any other purpose. | ||
// This function currently uses the UUID library to generate a new trace ID, | ||
// which means it should not be invoked from performance-critical code paths. | ||
func NewTraceID() string { | ||
return uuid.NewString() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters