-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require and change description for error.id
#1384
Conversation
Was there a discussion somewhere on the switch from 64-bit IDs to 128-bit? I can't seem to find it. This change would make them incompatible with the TraceContext IDs used in spans and transactions, so we'd need to special-case ID generation for errors. 🤔 |
The agreement has always been to use 128-bit for In case we align |
If the error id wasn't required, would the APM Server then just generate one before inserting the error into ES? |
It takes 5,056,937,541 tries to have a 50% probability of a collision for 64 bits of randomness (see https://en.wikipedia.org/wiki/Universally_unique_identifier#Collisions). That means if 1000 Errors/s are created, it takes 58,5 days to reach that. Whether that's good enough is of course debatable. But since Errors happening outside of a trace is rather the exception than the norm, I'd say it's probably worth to align the error id having 64 bits of randomness with span and transaction ids. But I don't mean to veto against 128 bit ids for errors. What would be the worst thing that can happen when there are collisions for an error id? |
I've seen a few comments elsewhere about that not using 64-bit id's for errors will complicate the code in the agents as it's no longer the same as spans and transactions. I can't see exactly how that can be though. Can someone elaborate? |
In the Java agent, I have the |
@felixbarny I see, thanks for explaining. Does the Java agent support reporting of errors outside the scope of a trace? And if so, will it then generate a trace-id because of the errors association with There's a lot of room for optimization in the Node.js agent, and I guess that's part of the reason why I had a hard time understanding the relation. In the Node.js agent errors live 100% outside the world of the instrumentation logic. It's only recently that the agent added an optional |
Yes
Currently, if an error is tracked outside of a transaction, it will not have an id at all. But if I were to add support that (for example to expose the error id so that users can display the error id for end-users of their application), I would not generate a new trace id as that would imply that this error is part of a particular trace. |
It looks like @Qard is ok with the changes. However, the discussions on this issue don't look finalized. @roncohen, @alvarolobato could you please state your opinion regarding 64-bit vs 128-bit for |
036462f
to
a17b385
Compare
OK, let's stick to the decision to make the error ids 128-bit. Some agents allow users to turn tracing off completely (or are planning to make that possible) and only do error logging, so an error happening outside a trace is not just a crazy edge case. I understand this comes with some complexity for some agents. I can understand that it's annoying to have to special case error ids, but i also understand from the comments here that it's not a huge problem. |
+1 |
a17b385
to
71b818b
Compare
71b818b
to
f877537
Compare
Yep, no problem to me. It was just unexpected, as the spec previously stated 64-bit, so I built my initial error ID stuff to share the same trace context class as everything else, but I've since changed that. 👍 |
FWIW, I use the same context class but have means to specify the length of the |
cc @elastic/apm-agent-devs