{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/prometheus/issues/1147","labels_url":"https://api.github.com/repos/prometheus/prometheus/issues/1147/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/prometheus/issues/1147/comments","events_url":"https://api.github.com/repos/prometheus/prometheus/issues/1147/events","html_url":"https://github.com/prometheus/prometheus/pull/1147","id":109945465,"number":1147,"title":"Implement label_join.","user":{"login":"varunpatro","id":6943308,"avatar_url":"https://avatars.githubusercontent.com/u/6943308?v=3","gravatar_id":"","url":"https://api.github.com/users/varunpatro","html_url":"https://github.com/varunpatro","followers_url":"https://api.github.com/users/varunpatro/followers","following_url":"https://api.github.com/users/varunpatro/following{/other_user}","gists_url":"https://api.github.com/users/varunpatro/gists{/gist_id}","starred_url":"https://api.github.com/users/varunpatro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varunpatro/subscriptions","organizations_url":"https://api.github.com/users/varunpatro/orgs","repos_url":"https://api.github.com/users/varunpatro/repos","events_url":"https://api.github.com/users/varunpatro/events{/privacy}","received_events_url":"https://api.github.com/users/varunpatro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-06T06:52:14Z","updated_at":"2015-10-06T08:08:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/prometheus/prometheus/pulls/1147","html_url":"https://github.com/prometheus/prometheus/pull/1147","diff_url":"https://github.com/prometheus/prometheus/pull/1147.diff","patch_url":"https://github.com/prometheus/prometheus/pull/1147.patch"},"body":"This PR partially completes #959 \r\n\r\nI have implemented the basic features of `label_join`. Yet to cover all cases.\r\n\r\nA few questions on the behavior of `label_join`:\r\n1. What is the expected output if some or all of the src labels are not found? (No change? Or join only found src labels?)\r\n2. Should I create a dst label if the label doesn't exist in the original vector? (Or no change?)\r\n3. Should I drop labels that have empty values? (like `label_replace`)\r\n\r\nA question on implementation:\r\n1. How do I specify variable arguments in the `ArgTypes` of `label_join`.\r\n    "},"comment":{"url":"https://api.github.com/repos/prometheus/prometheus/issues/comments/145776966","html_url":"https://github.com/prometheus/prometheus/pull/1147#issuecomment-145776966","issue_url":"https://api.github.com/repos/prometheus/prometheus/issues/1147","id":145776966,"user":{"login":"fabxc","id":4948210,"avatar_url":"https://avatars.githubusercontent.com/u/4948210?v=3","gravatar_id":"","url":"https://api.github.com/users/fabxc","html_url":"https://github.com/fabxc","followers_url":"https://api.github.com/users/fabxc/followers","following_url":"https://api.github.com/users/fabxc/following{/other_user}","gists_url":"https://api.github.com/users/fabxc/gists{/gist_id}","starred_url":"https://api.github.com/users/fabxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabxc/subscriptions","organizations_url":"https://api.github.com/users/fabxc/orgs","repos_url":"https://api.github.com/users/fabxc/repos","events_url":"https://api.github.com/users/fabxc/events{/privacy}","received_events_url":"https://api.github.com/users/fabxc/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T08:08:02Z","updated_at":"2015-10-06T08:08:02Z","body":"Thanks for this.\r\n\r\n1. We treat unset/nonexistant/empty labels all the same way. So if a label does not exist it should be treated as if its value was the empty string. \r\n2. If the destination label does not exist, create it. If the separator is the empty string and all source values are empty the destination value can be empty. In that case nothing should be done.\r\n3. As `label_join` only creates new labels but cannot modify, this should be of no concern here except for the case in 2.\r\n\r\nCurrently we do not support variadic arguments for our functions.\r\nIn #959 it was suggested to just add 8 arguments or so, which should cover most cases. However, this hack is not an acceptable solution to me.\r\nWe currently have the `OptionalArgs` field in the function definition. This could be replaced by a `Variadic` boolean that states that the last argument type in the list may occur 0 or more times. This is compatible with the current uses of `OptionalArgs` and solves the problem correctly.\r\n\r\nDo you want to give the last part a shot?"}}