Skip to content

Commit

Permalink
Add more properties to base document
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Oct 24, 2024
1 parent 9e5f5ae commit 1530245
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/uplink/metrics/instance/document.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,23 @@ defimpl Uplink.Metrics.Document, for: Uplink.Metrics.Instance do
if usage_bytes > 0 and total > 0, do: usage_bytes / total, else: 0.0
end

defp build_base(%Instance{name: node_name, timestamp: timestamp, data: data}) do
defp build_base(%Instance{
name: name,
timestamp: timestamp,
data: data,
node: node
}) do
%{
"@timestamp" => timestamp,
"host" => %{
"name" => node_name,
"name" => name,
"containerized" => data.type == "container"
},
"container.id" => node_name
"container.id" => name,
"agent.id" => "uplink",
"cloud" => %{
"instance.id" => node.name
}
}
end
end

0 comments on commit 1530245

Please sign in to comment.