Open omri-shilton opened 3 weeks ago
I can confirm this as well if we take an example payload from otel:
{
"resource": {
"attributes": {
"service.name": "example-service",
"service.namespace": "example-namespace",
"service.instance.id": "instance-12345",
"service.version": "1.0.0",
"host.name": "example-host",
"host.id": "host-12345",
"cloud.provider": "aws",
"cloud.region": "us-west-2"
}
},
"instrumentationLibrary": {
"name": "example-logger",
"version": "0.1.0"
},
"logRecords": [
{
"timeUnixNano": "1625241600000000000",
"severityText": "INFO",
"severityNumber": 9,
"name": "example-log",
"body": {
"stringValue": "This is an example log message"
},
"attributes": {
"http.method": "GET",
"http.url": "https://example.com/api/resource",
"http.status_code": 200,
"db.system": "mysql",
"db.statement": "SELECT * FROM users WHERE id = ?"
},
"traceId": "4bf92f3577b34da6a3ce929d0e0e4736",
"spanId": "00f067aa0ba902b7",
"flags": 1,
"droppedAttributesCount": 0
}
]
}
We only allow users to promote logRecords data to structured metadata:
log_attributes:
- action: structured_metadata
attributes:
- severityText
changing the above to
log_attributes:
- action: index_label
attributes:
- severityText
Causes Loki to fail:
level=info ts=2024-07-09T09:05:33.245743339Z caller=loki.go:506 msg="Loki stopped" running_time=21m38.185866051s
level=error ts=2024-07-09T09:05:33.509294922Z caller=main.go:70 msg="validating config" err="CONFIG ERROR: invalid limits_config config: index_label action is only supported for resource_attributes"
We should allow users to promote log attributes like severity to labels to provide better flexibility on what is indexed
Describe the bug When using otel http listener for ingesting otel logs, cannot index label objects that are not in the attribute, such as "SeverityText". Yet grafana does identify the log level correctly.
To Reproduce Steps to reproduce the behavior:
Which has no effect
Expected behavior An option to map otel objects as labels as well Environment:
Screenshots, Promtail config, or terminal output Example log object
And in Grafana