Skip to content

Commit

Permalink
Expose all host ips as prometheus targets
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonkopliku committed Nov 14, 2024
1 parent 8ef233b commit db426a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/trento_web/views/v1/prometheus_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ defmodule TrentoWeb.V1.PrometheusView do

def render("target.json", %{target: target}) do
%{
targets: ["#{List.first(target.ip_addresses, target.hostname)}:#{@node_exporter_port}"],
targets:
Enum.map(target.ip_addresses ++ [target.hostname], &"#{&1}:#{@node_exporter_port}"),
labels: %{
# TODO: in the future renaeme this label which also is used by node_exporter json
agentID: "#{target.id}",
Expand Down

0 comments on commit db426a1

Please sign in to comment.