Skip to content
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

Should Syslog Emergency map to FATAL instead of ERROR3? #2042

Closed
markdascher opened this issue Oct 20, 2021 · 4 comments · Fixed by #2091
Closed

Should Syslog Emergency map to FATAL instead of ERROR3? #2042

markdascher opened this issue Oct 20, 2021 · 4 comments · Fixed by #2091
Assignees
Labels
release:required-logdatamodel-ga Required for declaring log data model stable spec:logs Related to the specification/logs directory

Comments

@markdascher
Copy link

The Log Data Model's Appendix B shows an example mapping from syslog severity levels to SeverityNumber values. All of the syslog severities make sense except for Emergency and Alert, which are apparently swapped.

In syslog, Emergency is the highest severity possible, and Alert is just below Emergency, at least numerically. Quoting from RFC5424:

              0       Emergency: system is unusable
              1       Alert: action must be taken immediately
              2       Critical: critical conditions
              3       Error: error conditions
              4       Warning: warning conditions
              5       Notice: normal but significant condition
              6       Informational: informational messages
              7       Debug: debug-level messages

I'd therefore expect Emergency=FATAL and Alert=ERROR3, but Appendix B does the opposite. Looking through the commit history, tigrannajaryan/rfcs@784e409 seems relevant, possibly in response to this conversation. But it doesn't quite match the mappings suggested in that comment. (The Alert=FATAL mapping was already there anyway.)

Was this just a typo, or is there more to it?

@markdascher markdascher added the spec:logs Related to the specification/logs directory label Oct 20, 2021
@tigrannajaryan
Copy link
Member

Good catch. It is a mistake in the spec. I think Emergency should FATAL2 (more severe than Alert which is FATAL).

Or perhaps Alert should be ERROR4 and Emergency should be FATAL (but I think this is less desirable, Alert seems to be long to FATAL category).

Would you be able to submit a PR to fix this?

@markdascher
Copy link
Author

I was assuming Alert would be ERROR4, mainly because FATAL2 isn't used anywhere else yet. And I vaguely remember some discussions about making FATAL a "special" category without four different levels. Obviously that didn't happen technically, but it may still be a useful convention to ensure FATAL is reserved for the most critical events.

On the other hand, if we want to dispel that notion, putting Emergency onto FATAL2 could be a good way to do that.

Without looking at examples, it feels like we're just guessing.

Some examples of ALERT syslogs that might not be FATAL:

FLASH: firmware flash requires a reboot
FLASH: the firmware image will NOT be flashed
user %d attempted to rebuild the alias map
Veriexec: Preventing rename of `%s' to `%s', uid=%u, pid=%u: Lockdown mode.
the %s group is missing, token authentication disabled

There are also plenty of examples that could fit the FATAL category. But there are similar examples for Critical syslogs as well.

@tigrannajaryan
Copy link
Member

I was assuming Alert would be ERROR4, mainly because FATAL2 isn't used anywhere else yet. And I vaguely remember some discussions about making FATAL a "special" category without four different levels.

I don't remember a discussion like this and I don't think this was an intent in the design.

However, if we do believe ERROR4 is a better fit for Alert because there are examples of relatively benign logs seen in syslog then I think that is the right way.

Being by a level off is not a huge deal IMO, and if we discover other arguments in favour of shifting the levels by one we can do that later.

The incorrect ordering is much more important, so let's fix that.

@markdascher
Copy link
Author

Submitted #2087 with the described changes.

Here's the discussion I was thinking of: https://docs.google.com/document/d/1WQDz1jF0yKBXe3OibXWfy3g6lor9SvjZ4xT-8uuDCiA/edit?disco=AAAAGb77xaY

tigrannajaryan added a commit to tigrannajaryan/opentelemetry-specification that referenced this issue Nov 2, 2021
Emergency and Alert were incorrectly ordered (Emergency is was
less severe but it is actually more severe in Syslog).

This fixes the mapping.

Fixes open-telemetry#2042
tigrannajaryan added a commit to tigrannajaryan/opentelemetry-specification that referenced this issue Nov 2, 2021
Emergency and Alert were incorrectly ordered (Emergency is was
less severe but it is actually more severe in Syslog).

This fixes the mapping.

Fixes open-telemetry#2042
tigrannajaryan added a commit to tigrannajaryan/opentelemetry-specification that referenced this issue Nov 2, 2021
Emergency and Alert were incorrectly ordered (Emergency is was
less severe but it is actually more severe in Syslog).

This fixes the mapping.

Fixes open-telemetry#2042
@tigrannajaryan tigrannajaryan added the release:required-logdatamodel-ga Required for declaring log data model stable label Nov 4, 2021
bogdandrutu added a commit that referenced this issue Nov 4, 2021
Emergency and Alert were incorrectly ordered (Emergency is was
less severe but it is actually more severe in Syslog).

This fixes the mapping.

Fixes #2042

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
joaopgrassi pushed a commit to dynatrace-oss-contrib/semantic-conventions that referenced this issue Mar 21, 2024
Emergency and Alert were incorrectly ordered (Emergency is was
less severe but it is actually more severe in Syslog).

This fixes the mapping.

Fixes open-telemetry/opentelemetry-specification#2042

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:required-logdatamodel-ga Required for declaring log data model stable spec:logs Related to the specification/logs directory
Projects
None yet
3 participants