Skip to content

Commit c295345

Browse files
committed
[EXPORTERS]: elastic search put attributes in json root instead of under
`attributes` This allows user to set other fields that are part of the [ECS log documentation](https://www.elastic.co/guide/en/ecs/8.11/ecs-log.html). For instance, it allows to have an attribute with key `log.file`, that will, thanks to `nlohmann::json`, appear as : ``` { "log": { "file": "xxx" } } ``` Closes #3091
1 parent f8f0c57 commit c295345

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exporters/elasticsearch/src/es_log_recordable.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void ElasticSearchRecordable::SetAttribute(
312312
nostd::string_view key,
313313
const opentelemetry::common::AttributeValue &value) noexcept
314314
{
315-
WriteKeyValue(key, value, "attributes");
315+
WriteValue(value, key.data());
316316
}
317317

318318
void ElasticSearchRecordable::SetResource(

0 commit comments

Comments
 (0)