Skip to content

Commit 2ecc349

Browse files
committed
EXPORTERS]: elastic search recorable constructor sets ecs.version field
to 8.11.0 According to ECS guidelines this field is mandatory https://www.elastic.co/guide/en/ecs/8.11/ecs-guidelines.html Refs #3091
1 parent b644f21 commit 2ecc349

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

exporters/elasticsearch/include/opentelemetry/exporters/elasticsearch/es_log_recordable.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class ElasticSearchRecordable final : public sdk::logs::Recordable
4242
void WriteValue(const opentelemetry::common::AttributeValue &value, const std::string &name);
4343

4444
public:
45+
ElasticSearchRecordable() noexcept;
46+
4547
/**
4648
* Returns a JSON object contain the log information
4749
*/

exporters/elasticsearch/src/es_log_recordable.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ void ElasticSearchRecordable::WriteValue(const opentelemetry::common::AttributeV
197197
}
198198
}
199199

200+
ElasticSearchRecordable::ElasticSearchRecordable() noexcept : sdk::logs::Recordable()
201+
{
202+
json_["ecs"]["version"] = "8.11.0";
203+
}
204+
200205
nlohmann::json ElasticSearchRecordable::GetJSON() noexcept
201206
{
202207
return json_;

0 commit comments

Comments
 (0)