[googlecloudexporter] Support Google Cloud Format LogSeverity
strings set as SeverityText
field
#39220
Labels
LogSeverity
strings set as SeverityText
field
#39220
Uh oh!
There was an error while loading. Please reload this page.
Component(s)
googlecloudexporter
Is your feature request related to a problem? Please describe.
Currently the
googlecloudexporter
for logs has mappings [1] that useSeverityNumber
to match aLogSeverity
[3] value when sending theLogEntry
to Google Cloud Logging. The exporter also has mappings [1] that transform theSeverityText
field toSeverityNumber
before exporting to Google Cloud Logging. This behaviour is documented in [2].When parsing logs that contain
LogSeverity
[3] style values, this mappings doesn't export correctly some severity values when set asSeverityText
. For example,NOTICE
would be set asNo Severity
(0) in theLogEntry
since theSeverityText -> SeverityNumber
mapping in the exporter doesn't contain a rule forNOTICE
.[1] https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/v0.48.3/exporter/collector/logs.go#L66-L127
[2] https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/googlecloudexporter/README.md
[3] https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity
Describe the solution you'd like
Add
LogSeverity
styles values (uppercase, DEBUG, NOTICE, INFO ...) to the mapping fromSeverityText -> SeverityNumber
in [1]. The OpenTelemetry definition ofSeverityText
[4] doesn't have restrictions on which strings could be set in that field.This solution enables a logging pipeline to use Google Cloud Logging data model logs without having to do intermediate transformation to set correctly
SeverityNumber
.[1] https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/v0.48.3/exporter/collector/logs.go#L66-L127
[4] https://opentelemetry.io/docs/specs/otel/logs/data-model/#severity-field
Describe alternatives you've considered
One alternative would be to always have an intermediate
LogSeverity -> SeverityNumber
transform processor when handling logs that conform to the Google Cloud Logging (GCL) data model, e.g. usingLogSeverity
values. To manage a pipeline that handles GCL style logs, there would always have to intermediate transformations to make sure it is mapped correctly in the exporter.Concerns : This adds more processing at each step when working with GCL data model logs.
Additional context
No response
The text was updated successfully, but these errors were encountered: