Skip to content

Commit 67d7e6b

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 2ecc349 commit 67d7e6b

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
@@ -313,7 +313,7 @@ void ElasticSearchRecordable::SetAttribute(
313313
nostd::string_view key,
314314
const opentelemetry::common::AttributeValue &value) noexcept
315315
{
316-
WriteKeyValue(key, value, "attributes");
316+
WriteValue(value, key.data());
317317
}
318318

319319
void ElasticSearchRecordable::SetResource(

0 commit comments

Comments
 (0)