diff --git a/exporters/elasticsearch/include/opentelemetry/exporters/elasticsearch/es_log_recordable.h b/exporters/elasticsearch/include/opentelemetry/exporters/elasticsearch/es_log_recordable.h index af4ccb16ef..52d24cada6 100644 --- a/exporters/elasticsearch/include/opentelemetry/exporters/elasticsearch/es_log_recordable.h +++ b/exporters/elasticsearch/include/opentelemetry/exporters/elasticsearch/es_log_recordable.h @@ -42,6 +42,8 @@ class ElasticSearchRecordable final : public sdk::logs::Recordable void WriteValue(const opentelemetry::common::AttributeValue &value, const std::string &name); public: + ElasticSearchRecordable() noexcept; + /** * Returns a JSON object contain the log information */ diff --git a/exporters/elasticsearch/src/es_log_recordable.cc b/exporters/elasticsearch/src/es_log_recordable.cc index 07b54db0c1..92cccc4921 100644 --- a/exporters/elasticsearch/src/es_log_recordable.cc +++ b/exporters/elasticsearch/src/es_log_recordable.cc @@ -197,6 +197,11 @@ void ElasticSearchRecordable::WriteValue(const opentelemetry::common::AttributeV } } +ElasticSearchRecordable::ElasticSearchRecordable() noexcept : sdk::logs::Recordable() +{ + json_["ecs"]["version"] = "8.11.0"; +} + nlohmann::json ElasticSearchRecordable::GetJSON() noexcept { return json_;