-
Notifications
You must be signed in to change notification settings - Fork 894
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
Rename exception.*
to error.*
(aligning with ECS)
#3198
Comments
@AlexanderWert it's not clear to us the best mapping from OTel's all-in-one-string (unstructured) Is |
@trask In ECS (and Elasticsearch) there are different types of strings:
For OTel semconv the |
Some potential reasons not to rename
|
Thinking more about this, I'm wondering if it wouldn't be better for
So, while in the scope of spans So, how about keeping OTel's |
same... I'd like to see if we can avoid having both And I think I think the existing API method |
Hmm, but not in the sense of the original argument of (re)naming that thing exception. An exception may indicate that some problem occurred but was handled, in which case, was it really an error? Or an exception might be used for other things, like Python's GeneratorExit |
ya, I don't disagree, I guess my preference is to stretch the meaning a bit instead of having both |
I agree. Having both
I agree with the first part of the statement. An error is a generic concept, whereas an exception is a language specific construct. Not all languages have an exception construct, e. g. Go and Rust. To summarize, I'd be strongly in favor of having just one of
|
What about the Span status? An error can be recorded by setting the span status to ERROR and setting a appropriate status text. Cf. #306. I think there is totally space for separate error and exception conventions, and they might not even look that similar: #306 (comment)
Here, by @jmacd on the original name decision: #427 (comment)
=> So the intention of the OTel exception.* conventions is to be used just for exceptions. For errors (and even to indicate whether an exception is an error or not), you'd use other conventions (e.g. http.status_code) or the span Status (message+ERROR/OK/UNSET) |
One of the problems
In addition to the mentioned two use cases above, it is also used for errors happening during ingest. If we already touch error, we should narrow down on what our targeted use case is no matter if it is error or exception. Most cases I see described above are focused on "cases where the event itself contains an error." That is also what I would focus on and scrap "fetching" or "ingest" errors. |
Agree with that for spans! How would that look like for other use cases (e.g. error logs that are not exceptions)? For example, an Apache error log:
An example of a MySQL error message:
So for capturing the above examples as OTel logs, right now the only way is to write them into |
I also think a separate error convention would be the way to go. If we want consistency with span's status, it would need to be |
I understand some of the reasoning behind this, but when I try to picture a concrete solution, it feels quite murky to me:
A lot of emphasis is put on exceptions that aren't errors (but instead used for flow control). There might be some controversy about this, but I would argue that recording details about such exceptions has only limited value in the context of telemetry data and should be avoided if possible (what value would we get from e. g. To summarize, separating errors and exceptions seems cleaner on a conceptual level, however, it adds a fair amount of complexity. The additional value provided seems small to me, especially in the context of telemetry data, and I'm not convinced it is worth the additional complexity. |
T> With the exception (no pun intended) of Python, this usage of exceptions is also very niche in all languages I'm familiar with. Erlang is another one that uses exceptions for control flow at times and I'd completely agree that these should not be recorded in an The only thing I'd add is |
For spans, you won't have error.message, since you would store it in the status (which needs to be error then). As for stacktrace, I don't see how it is related to errors in particular. We might want a general stacktrace attribute though (note that the exception's stacktrace attribute is not actually a "pure" stacktrace (as in, a list of frames), but the full exception detail representation, usually including exception, causing exception, etc. I protested that name quite vehemently when it was introduced, but since a few languages do call it stacktace and there is no commonly used specific other name for the concept, it stuck) |
That's a great point that spans already have both concepts:
So maybe having separate As far as introducing
(and |
Hmm, I think error.message would be the status description. At least most usages of the status description I have seen don't use a fixed string, but put in some exception message or similar. And actuallly, I think we should use the ones defined here: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/mapping-to-non-otlp.md#span-status: |
interesting, we (@open-telemetry/java-instrumentation-maintainers) have interpreted this differently so far: open-telemetry/opentelemetry-java-instrumentation#6710 (comment)
|
on the logging side we have Severity, though it doesn't map 1-1 with SpanKind OK/ERROR, and it doesn't solve the issue for metrics signal |
wrt
Functionally, we can extend |
@trask Your interpretation may very well be what was originially intended, but it's not generally used that way, e.g. the Python API provides an option to automatically record the exception messge as span status: https://github.com/open-telemetry/opentelemetry-python/blob/v1.17.0/opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py#L951 |
@Oberon00 do you think I should raise a spec issue to clarify, or do you think the spec is reasonably clear and I should open a bug report in the python repo? thx |
This is a spec issue IMHO. Python was just one example, the same happens in some .NET instrumentations, e.g.: https://github.com/open-telemetry/opentelemetry-dotnet/blob/fea6793a5590a18ff6d5e99460f9dfd8cf4c95b2/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs#L248 At this point, I think you have to adapt the spec to explicitly allow this. What these do was not originally the intention maybe, but it is useful and not obviously wrong. |
Some opentelemetry-specification/specification/semantic-conventions.md Lines 10 to 23 in 7b4c60c
|
|
What are you trying to achieve?
Rename
exception.*
attributes to the corresponding ECS names undererror.*
(see open-telemetry/oteps#222 for motivation).Rename:
exception.type
->error.type
exception.message
->error.message
exception.stacktrace
->error.stack_trace
exception.escaped
-> (nothing corresponding)The text was updated successfully, but these errors were encountered: