opentelemetry-rust icon indicating copy to clipboard operation
opentelemetry-rust copied to clipboard

Stop populating severity text and instead auto-deduct it from severity number

Open cijothomas opened this issue 1 year ago • 4 comments

Mentioned here : https://github.com/open-telemetry/opentelemetry-rust/pull/1997/files#r1707954979 I wonder if should even remove SeverityText from LogRecord itself to reduce the size of LogRecord. I am not aware of any use case where user puts severity number and different text, so exporters can simply derive SeverityText from the numbered field to save perf.

cijothomas avatar Aug 08 '24 03:08 cijothomas

@lalitb Please share your thoughts.

cijothomas avatar Aug 08 '24 03:08 cijothomas

Agree on this. If we are always going to populate the textual representation of SeverityNumber here, there is no point of populating it in SDK. Let the exporter decide if they need it.

lalitb avatar Aug 08 '24 04:08 lalitb

Also, the field is optional as per the log data model - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-severitytext

lalitb avatar Aug 08 '24 04:08 lalitb

Discussion in community meeting

  • Having getters for LogRecord, and make existing fields to private.
  • Remove severity_text from LogRecord.

lalitb avatar Aug 13 '24 16:08 lalitb