{"action":"closed","issue":{"url":"https://api.github.com/repos/bosun-monitor/bosun/issues/1966","repository_url":"https://api.github.com/repos/bosun-monitor/bosun","labels_url":"https://api.github.com/repos/bosun-monitor/bosun/issues/1966/labels{/name}","comments_url":"https://api.github.com/repos/bosun-monitor/bosun/issues/1966/comments","events_url":"https://api.github.com/repos/bosun-monitor/bosun/issues/1966/events","html_url":"https://github.com/bosun-monitor/bosun/issues/1966","id":190753007,"number":1966,"title":"/api/egraph won't render graphs I can build in the expression tab","user":{"login":"eswdd","id":1651355,"avatar_url":"https://avatars.githubusercontent.com/u/1651355?v=3","gravatar_id":"","url":"https://api.github.com/users/eswdd","html_url":"https://github.com/eswdd","followers_url":"https://api.github.com/users/eswdd/followers","following_url":"https://api.github.com/users/eswdd/following{/other_user}","gists_url":"https://api.github.com/users/eswdd/gists{/gist_id}","starred_url":"https://api.github.com/users/eswdd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eswdd/subscriptions","organizations_url":"https://api.github.com/users/eswdd/orgs","repos_url":"https://api.github.com/users/eswdd/repos","events_url":"https://api.github.com/users/eswdd/events{/privacy}","received_events_url":"https://api.github.com/users/eswdd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-21T15:41:44Z","updated_at":"2016-11-22T09:13:56Z","closed_at":"2016-11-22T09:13:56Z","body":"For example, I have an expression which we use to extrapolate when our tsdb write rate will exceed our threshold and render it nicely:\r\n```\r\n$recent_period = 16w\r\n$extrapolate_period = 10y\r\n$q = dropl(q(\"sum:1d-max:rate:tsd.rpc.received{type=put}\",\"$recent_period\",\"\"), 0)\r\n$line = linelr($q, \"$extrapolate_period\")\r\n$offset_line = $line - first($line) + max($q)\r\n$line_start = epoch() - d(\"$recent_period\")\r\n$threshold = series(\"line=threshold\", $line_start, 100000, epoch() + d(\"$extrapolate_period\"), 100000)\r\n$m = merge($q, $offset_line, $threshold)\r\n$m\r\n```\r\n\r\nThis renders nicely on the expr tab when I click graph. However, attempts to render this in a template using the .Graph command, or embedding using the /api/egraph link result in the following error:\r\n\r\n> expr: unexpected invalid character: $ in input\r\n\r\nHow do I render complex expressions for use in a template? I can't find any samples."}}
{"actor":{"display_login":"eswdd"}}