Skip to content

Commit

Permalink
EXPORTERS]: elastic search recorable constructor sets ecs.version f…
Browse files Browse the repository at this point in the history
…ield

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 open-telemetry#3091
  • Loading branch information
ShadowMaxLeb committed Oct 18, 2024
1 parent b644f21 commit 2ecc349
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
5 changes: 5 additions & 0 deletions exporters/elasticsearch/src/es_log_recordable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit 2ecc349

Please sign in to comment.