Set ID manually
See original GitHub issueOur app does some periodic polling, which is started by a setInterval
and not an external call to our app. This call is missing a trace id. Would it be possible for us to manually set an ID before kicking of the async calls?
Or code is essentially this
export async function setupBroadcastPolling(client: SomeClient) {
async function loadMessages() {
try {
const data = await loadBroadcastMessages(client);
if (data) {
broadcastMessages = data.messages;
}
} catch (error) {
logger.error({ error }, 'Unable to poll broadcast messages');
}
}
// reload every minute
setInterval(loadMessages, 60 * 1000).unref();
await loadMessages();
}
It would be great if we could have an ID in our logs in this case as well. In this case I’d love to somehow set an ID if it’s missing within the loadMessages
function. Our client does a bunch of logging as it works, which are all missing the request ID
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (15 by maintainers)
Top Results From Across the Web
How to set autogenerated Id manually? - java - Stack Overflow
Using @GeneratedValue(strategy = GenerationType.IDENTITY).
Read more >Manually set id attribute - Laracasts
Use PHP's array_merge with Input::all() to set the ID manually before calling MyModel::create(...) . ... // Put the array with ID last to...
Read more >Set ID By Yourself : Primary Key « JPA « Java Tutorial
Set ID By Yourself : Primary Key « JPA « Java Tutorial.
Read more >How-to: Setting auto-generated Ids manually in Hibernate
Use auto-generated values and let Hibernate or the underlying database engine generate those identifiers for you, or · Generate all ids yourself ...
Read more >Chapter 35. Adjusting ID ranges manually
By creating and assigning different ID ranges to replicas, it also ensures that they never generate the same ID numbers. By default, this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
12.18.0 in prod, 12.18.1 locally. It works consistently locally with both 12.17.0 and 12.18.1. Hoping it’s not something weird with the load balancers in GCP or something…
Thanks! I’m having troubles reproducing this locally, it seems to only happen when deployed, for some reason… Will keep on trying to get a reproduction locally