{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/logstash/pulls/comments/77029422","id":77029422,"diff_hunk":"@@ -274,4 +298,13 @@ def clean_state?\n   def setting(key)\n     @settings.get(key)\n   end\n+\n+  def init_pipeline_reload_metrics(id)\n+    namespace = @reload_metric.namespace([id.to_sym, :reloads])\n+    namespace.increment(:successes, 0)\n+    namespace.increment(:failures, 0)\n+    namespace.gauge(:last_error, nil)\n+    namespace.gauge(:last_success_timestamp, nil)\n+    namespace.gauge(:last_failure_timestamp, nil)\n+  end","path":"logstash-core/lib/logstash/agent.rb","position":89,"original_position":89,"commit_id":"4d72a280aafe0217baef1b6373cbc69bd161b134","original_commit_id":"4d72a280aafe0217baef1b6373cbc69bd161b134","user":{"login":"jsvd","id":31809,"avatar_url":"https://avatars.githubusercontent.com/u/31809?v=3","gravatar_id":"","url":"https://api.github.com/users/jsvd","html_url":"https://github.com/jsvd","followers_url":"https://api.github.com/users/jsvd/followers","following_url":"https://api.github.com/users/jsvd/following{/other_user}","gists_url":"https://api.github.com/users/jsvd/gists{/gist_id}","starred_url":"https://api.github.com/users/jsvd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsvd/subscriptions","organizations_url":"https://api.github.com/users/jsvd/orgs","repos_url":"https://api.github.com/users/jsvd/repos","events_url":"https://api.github.com/users/jsvd/events{/privacy}","received_events_url":"https://api.github.com/users/jsvd/received_events","type":"User","site_admin":false},"body":"actually I don't wish to complicate things and overengineer the metric publication, for now I'm good with tap.\r\nI'm going to finish up the tests for this and make it a final PR","created_at":"2016-08-31T17:09:31Z","updated_at":"2016-08-31T17:09:31Z","html_url":"https://github.com/elastic/logstash/pull/5848#discussion_r77029422","pull_request_url":"https://api.github.com/repos/elastic/logstash/pulls/5848","_links":{"self":{"href":"https://api.github.com/repos/elastic/logstash/pulls/comments/77029422"},"html":{"href":"https://github.com/elastic/logstash/pull/5848#discussion_r77029422"},"pull_request":{"href":"https://api.github.com/repos/elastic/logstash/pulls/5848"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/logstash/pulls/5848","id":83433996,"html_url":"https://github.com/elastic/logstash/pull/5848","diff_url":"https://github.com/elastic/logstash/pull/5848.diff","patch_url":"https://github.com/elastic/logstash/pull/5848.patch","issue_url":"https://api.github.com/repos/elastic/logstash/issues/5848","number":5848,"state":"open","locked":false,"title":"add metrics regarding pipeline reloading","user":{"login":"jsvd","id":31809,"avatar_url":"https://avatars.githubusercontent.com/u/31809?v=3","gravatar_id":"","url":"https://api.github.com/users/jsvd","html_url":"https://github.com/jsvd","followers_url":"https://api.github.com/users/jsvd/followers","following_url":"https://api.github.com/users/jsvd/following{/other_user}","gists_url":"https://api.github.com/users/jsvd/gists{/gist_id}","starred_url":"https://api.github.com/users/jsvd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsvd/subscriptions","organizations_url":"https://api.github.com/users/jsvd/orgs","repos_url":"https://api.github.com/users/jsvd/repos","events_url":"https://api.github.com/users/jsvd/events{/privacy}","received_events_url":"https://api.github.com/users/jsvd/received_events","type":"User","site_admin":false},"body":"This is a WIP PR to add pipeline reload metrics to logstash.\r\n\r\ntargets https://github.com/elastic/logstash/issues/5680\r\n\r\nexample output:\r\n\r\n```\r\n% curl localhost:9600/_node/stats/pipeline?pretty\r\n{\r\n  \"host\" : \"Joaos-MBP\",\r\n  \"version\" : \"5.0.0-alpha6\",\r\n  \"http_address\" : \"127.0.0.1:9600\",\r\n  \"pipeline\" : {\r\n    \"events\" : {\r\n      \"duration_in_millis\" : 35775,\r\n      \"in\" : 3500,\r\n      \"filtered\" : 3000,\r\n      \"out\" : 3000\r\n    },\r\n    \"plugins\" : {\r\n      \"inputs\" : [ ],\r\n      \"filters\" : [ {\r\n        \"id\" : \"sleep_fd1abb9cb9a7857c354a6579fd0dfbc050304f10-2\",\r\n        \"events\" : {\r\n          \"duration_in_millis\" : 37114,\r\n          \"in\" : 3160,\r\n          \"out\" : 3156\r\n        }\r\n      } ],\r\n      \"outputs\" : [ ]\r\n    },\r\n    \"reloads\" : {\r\n      \"last_error\" : {\r\n        \"message\" : \"Expected one of #, => at line 3, column 8 (byte 60) after filter { sleep { time => 0.\\noutput \",\r\n        \"backtrace\" : [ \"/Users/joaoduarte/projects/logstash/logstash-core/lib/logstash/pipeline.rb:74:in `initialize'\", \"/Users/joaoduarte/projects/logstash/logstash-core/lib/logstash/agent.rb:191:in `create_pipeline'\", \"/Users/joaoduarte/projects/logstash/logstash-core/lib/logstash/agent.rb:221:in `reload_pipeline!'\", \"/Users/joaoduarte/projects/logstash/logstash-core/lib/logstash/agent.rb:102:in `reload_state!'\", \"org/jruby/RubyHash.java:1342:in `each'\", \"/Users/joaoduarte/projects/logstash/logstash-core/lib/logstash/agent.rb:100:in `reload_state!'\", \"org/jruby/ext/thread/Mutex.java:149:in `synchronize'\", \"/Users/joaoduarte/projects/logstash/logstash-core/lib/logstash/agent.rb:99:in `reload_state!'\", \"/Users/joaoduarte/projects/logstash/logstash-core/lib/logstash/agent.rb:67:in `execute'\", \"org/jruby/RubyProc.java:281:in `call'\", \"/Users/joaoduarte/projects/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.22/lib/stud/interval.rb:20:in `interval'\", \"/Users/joaoduarte/projects/logstash/logstash-core/lib/logstash/agent.rb:67:in `execute'\", \"/Users/joaoduarte/projects/logstash/logstash-core/lib/logstash/runner.rb:252:in `execute'\", \"org/jruby/RubyProc.java:281:in `call'\", \"/Users/joaoduarte/projects/logstash/vendor/bundle/jruby/1.9/gems/stud-0.0.22/lib/stud/task.rb:24:in `initialize'\" ]\r\n      },\r\n      \"successes\" : 3,\r\n      \"last_success_timestamp\" : \"2016-08-31T11:11:57.047Z\",\r\n      \"last_failure_timestamp\" : \"2016-08-31T11:11:26.917Z\",\r\n      \"failures\" : 3\r\n    }\r\n  }\r\n}               \r\n```","created_at":"2016-08-31T11:22:09Z","updated_at":"2016-08-31T17:09:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"372dc158d5fecb63cbf24ea391673b06654fc8f5","assignee":{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false},"assignees":[{"login":"ph","id":640,"avatar_url":"https://avatars.githubusercontent.com/u/640?v=3","gravatar_id":"","url":"https://api.github.com/users/ph","html_url":"https://github.com/ph","followers_url":"https://api.github.com/users/ph/followers","following_url":"https://api.github.com/users/ph/following{/other_user}","gists_url":"https://api.github.com/users/ph/gists{/gist_id}","starred_url":"https://api.github.com/users/ph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ph/subscriptions","organizations_url":"https://api.github.com/users/ph/orgs","repos_url":"https://api.github.com/users/ph/repos","events_url":"https://api.github.com/users/ph/events{/privacy}","received_events_url":"https://api.github.com/users/ph/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/logstash/pulls/5848/commits","review_comments_url":"https://api.github.com/repos/elastic/logstash/pulls/5848/comments","review_comment_url":"https://api.github.com/repos/elastic/logstash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/logstash/issues/5848/comments","statuses_url":"https://api.github.com/repos/elastic/logstash/statuses/4d72a280aafe0217baef1b6373cbc69bd161b134","head":{"label":"jsvd:pipeline_reload_metrics","ref":"pipeline_reload_metrics","sha":"4d72a280aafe0217baef1b6373cbc69bd161b134","user":{"login":"jsvd","id":31809,"avatar_url":"https://avatars.githubusercontent.com/u/31809?v=3","gravatar_id":"","url":"https://api.github.com/users/jsvd","html_url":"https://github.com/jsvd","followers_url":"https://api.github.com/users/jsvd/followers","following_url":"https://api.github.com/users/jsvd/following{/other_user}","gists_url":"https://api.github.com/users/jsvd/gists{/gist_id}","starred_url":"https://api.github.com/users/jsvd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsvd/subscriptions","organizations_url":"https://api.github.com/users/jsvd/orgs","repos_url":"https://api.github.com/users/jsvd/repos","events_url":"https://api.github.com/users/jsvd/events{/privacy}","received_events_url":"https://api.github.com/users/jsvd/received_events","type":"User","site_admin":false},"repo":{"id":20619044,"name":"logstash","full_name":"jsvd/logstash","owner":{"login":"jsvd","id":31809,"avatar_url":"https://avatars.githubusercontent.com/u/31809?v=3","gravatar_id":"","url":"https://api.github.com/users/jsvd","html_url":"https://github.com/jsvd","followers_url":"https://api.github.com/users/jsvd/followers","following_url":"https://api.github.com/users/jsvd/following{/other_user}","gists_url":"https://api.github.com/users/jsvd/gists{/gist_id}","starred_url":"https://api.github.com/users/jsvd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsvd/subscriptions","organizations_url":"https://api.github.com/users/jsvd/orgs","repos_url":"https://api.github.com/users/jsvd/repos","events_url":"https://api.github.com/users/jsvd/events{/privacy}","received_events_url":"https://api.github.com/users/jsvd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jsvd/logstash","description":"logstash - logs/event transport, processing, management, search.","fork":true,"url":"https://api.github.com/repos/jsvd/logstash","forks_url":"https://api.github.com/repos/jsvd/logstash/forks","keys_url":"https://api.github.com/repos/jsvd/logstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jsvd/logstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jsvd/logstash/teams","hooks_url":"https://api.github.com/repos/jsvd/logstash/hooks","issue_events_url":"https://api.github.com/repos/jsvd/logstash/issues/events{/number}","events_url":"https://api.github.com/repos/jsvd/logstash/events","assignees_url":"https://api.github.com/repos/jsvd/logstash/assignees{/user}","branches_url":"https://api.github.com/repos/jsvd/logstash/branches{/branch}","tags_url":"https://api.github.com/repos/jsvd/logstash/tags","blobs_url":"https://api.github.com/repos/jsvd/logstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jsvd/logstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jsvd/logstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/jsvd/logstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jsvd/logstash/statuses/{sha}","languages_url":"https://api.github.com/repos/jsvd/logstash/languages","stargazers_url":"https://api.github.com/repos/jsvd/logstash/stargazers","contributors_url":"https://api.github.com/repos/jsvd/logstash/contributors","subscribers_url":"https://api.github.com/repos/jsvd/logstash/subscribers","subscription_url":"https://api.github.com/repos/jsvd/logstash/subscription","commits_url":"https://api.github.com/repos/jsvd/logstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/jsvd/logstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/jsvd/logstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/jsvd/logstash/issues/comments{/number}","contents_url":"https://api.github.com/repos/jsvd/logstash/contents/{+path}","compare_url":"https://api.github.com/repos/jsvd/logstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jsvd/logstash/merges","archive_url":"https://api.github.com/repos/jsvd/logstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jsvd/logstash/downloads","issues_url":"https://api.github.com/repos/jsvd/logstash/issues{/number}","pulls_url":"https://api.github.com/repos/jsvd/logstash/pulls{/number}","milestones_url":"https://api.github.com/repos/jsvd/logstash/milestones{/number}","notifications_url":"https://api.github.com/repos/jsvd/logstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jsvd/logstash/labels{/name}","releases_url":"https://api.github.com/repos/jsvd/logstash/releases{/id}","deployments_url":"https://api.github.com/repos/jsvd/logstash/deployments","created_at":"2014-06-08T15:03:16Z","updated_at":"2015-02-23T10:54:24Z","pushed_at":"2016-08-31T11:19:37Z","git_url":"git://github.com/jsvd/logstash.git","ssh_url":"git@github.com:jsvd/logstash.git","clone_url":"https://github.com/jsvd/logstash.git","svn_url":"https://github.com/jsvd/logstash","homepage":"http://logstash.net/","size":75985,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"9fd35ad4bb30cdae310413f43971e447353d0c18","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":1090311,"name":"logstash","full_name":"elastic/logstash","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/logstash","description":"logstash - transport and process your logs, events, or other data","fork":false,"url":"https://api.github.com/repos/elastic/logstash","forks_url":"https://api.github.com/repos/elastic/logstash/forks","keys_url":"https://api.github.com/repos/elastic/logstash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/logstash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/logstash/teams","hooks_url":"https://api.github.com/repos/elastic/logstash/hooks","issue_events_url":"https://api.github.com/repos/elastic/logstash/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/logstash/events","assignees_url":"https://api.github.com/repos/elastic/logstash/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/logstash/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/logstash/tags","blobs_url":"https://api.github.com/repos/elastic/logstash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/logstash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/logstash/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/logstash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/logstash/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/logstash/languages","stargazers_url":"https://api.github.com/repos/elastic/logstash/stargazers","contributors_url":"https://api.github.com/repos/elastic/logstash/contributors","subscribers_url":"https://api.github.com/repos/elastic/logstash/subscribers","subscription_url":"https://api.github.com/repos/elastic/logstash/subscription","commits_url":"https://api.github.com/repos/elastic/logstash/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/logstash/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/logstash/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/logstash/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/logstash/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/logstash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/logstash/merges","archive_url":"https://api.github.com/repos/elastic/logstash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/logstash/downloads","issues_url":"https://api.github.com/repos/elastic/logstash/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/logstash/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/logstash/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/logstash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/logstash/labels{/name}","releases_url":"https://api.github.com/repos/elastic/logstash/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/logstash/deployments","created_at":"2010-11-18T01:31:50Z","updated_at":"2016-08-31T16:44:39Z","pushed_at":"2016-08-31T17:06:54Z","git_url":"git://github.com/elastic/logstash.git","ssh_url":"git@github.com:elastic/logstash.git","clone_url":"https://github.com/elastic/logstash.git","svn_url":"https://github.com/elastic/logstash","homepage":"https://www.elastic.co/products/logstash","size":89674,"stargazers_count":6382,"watchers_count":6382,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1880,"mirror_url":null,"open_issues_count":814,"forks":1880,"open_issues":814,"watchers":6382,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/logstash/pulls/5848"},"html":{"href":"https://github.com/elastic/logstash/pull/5848"},"issue":{"href":"https://api.github.com/repos/elastic/logstash/issues/5848"},"comments":{"href":"https://api.github.com/repos/elastic/logstash/issues/5848/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/logstash/pulls/5848/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/logstash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/logstash/pulls/5848/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/logstash/statuses/4d72a280aafe0217baef1b6373cbc69bd161b134"}}}}
{"actor":{"display_login":"jsvd"}}