Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

allow alias_by_node to take a list of nodes as an argument #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/graphite_graph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,11 @@ def url(format = nil, url=true)

unless target.include?(:subgroup)
if target[:alias_by_node]
graphite_target = "aliasByNode(#{graphite_target},#{target[:alias_by_node]})"
if target[:alias_by_node].is_a? Array
graphite_target = "aliasByNode(#{graphite_target},#{target[:alias_by_node].join(",")})"
else:
graphite_target = "aliasByNode(#{graphite_target},#{target[:alias_by_node]})"
end
elsif target[:alias_sub_search]
graphite_target = "aliasSub(#{graphite_target},\"#{target[:alias_sub_search]}\",\"#{target[:alias_sub_replace]}\")"
elsif target[:alias]
Expand Down