{"action":"created","comment":{"url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments/238429979","pull_request_review_id":180970559,"id":238429979,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODQyOTk3OQ==","diff_hunk":"@@ -124,6 +130,20 @@ func (c call) endStats(elapsed time.Duration, err error, isApplicationError bool\n \t}\n \n \terrCode := yarpcerrors.FromError(err).Code()\n+\tif c.isClientSideErrorCode(errCode) {\n+\t\tc.edge.callerErrLatencies.Observe(elapsed)\n+\t\tif counter, err := c.edge.callerFailures.Get(_error, errCode.String()); err == nil {\n+\t\t\tcounter.Inc()\n+\t\t}\n+\t} else {\n+\t\tc.edge.serverErrLatencies.Observe(elapsed)\n+\t\tif counter, err := c.edge.serverFailures.Get(_error, errCode.String()); err == nil {\n+\t\t\tcounter.Inc()\n+\t\t}\n+\t}\n+}\n+\n+func (c call) isClientSideErrorCode(errCode yarpcerrors.Code) bool {\n \tswitch errCode {","path":"internal/observability/call.go","position":48,"original_position":48,"commit_id":"62d079b7041125f2fb31d04da287e7a222c20c8a","original_commit_id":"1be299f069ec5e871949279efab3a22068122014","user":{"login":"martindam","id":10091249,"node_id":"MDQ6VXNlcjEwMDkxMjQ5","avatar_url":"https://avatars0.githubusercontent.com/u/10091249?v=4","gravatar_id":"","url":"https://api.github.com/users/martindam","html_url":"https://github.com/martindam","followers_url":"https://api.github.com/users/martindam/followers","following_url":"https://api.github.com/users/martindam/following{/other_user}","gists_url":"https://api.github.com/users/martindam/gists{/gist_id}","starred_url":"https://api.github.com/users/martindam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martindam/subscriptions","organizations_url":"https://api.github.com/users/martindam/orgs","repos_url":"https://api.github.com/users/martindam/repos","events_url":"https://api.github.com/users/martindam/events{/privacy}","received_events_url":"https://api.github.com/users/martindam/received_events","type":"User","site_admin":false},"body":"Do you mean an if statement with a lot of ORs? I went for a switch case as it is easier to write when there are a lot of values. I don't think it will make it easier to make an if statement with a lot of OR parts. ","created_at":"2018-12-03T20:45:08Z","updated_at":"2018-12-03T20:45:08Z","html_url":"https://github.com/yarpc/yarpc-go/pull/1569#discussion_r238429979","pull_request_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1569","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments/238429979"},"html":{"href":"https://github.com/yarpc/yarpc-go/pull/1569#discussion_r238429979"},"pull_request":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1569"}},"in_reply_to_id":219684356},"pull_request":{"url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1569","id":217233067,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MjMzMDY3","html_url":"https://github.com/yarpc/yarpc-go/pull/1569","diff_url":"https://github.com/yarpc/yarpc-go/pull/1569.diff","patch_url":"https://github.com/yarpc/yarpc-go/pull/1569.patch","issue_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/1569","number":1569,"state":"open","locked":false,"title":"Observability middleware: Log client side YARPC errors at debug level","user":{"login":"martindam","id":10091249,"node_id":"MDQ6VXNlcjEwMDkxMjQ5","avatar_url":"https://avatars0.githubusercontent.com/u/10091249?v=4","gravatar_id":"","url":"https://api.github.com/users/martindam","html_url":"https://github.com/martindam","followers_url":"https://api.github.com/users/martindam/followers","following_url":"https://api.github.com/users/martindam/following{/other_user}","gists_url":"https://api.github.com/users/martindam/gists{/gist_id}","starred_url":"https://api.github.com/users/martindam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martindam/subscriptions","organizations_url":"https://api.github.com/users/martindam/orgs","repos_url":"https://api.github.com/users/martindam/repos","events_url":"https://api.github.com/users/martindam/events{/privacy}","received_events_url":"https://api.github.com/users/martindam/received_events","type":"User","site_admin":false},"body":"This changes the logging level in the observability middleware to only log at error level when it is an \"server error\" according to the YARPC error codes. \"Client side\" errors are logged at debug level\r\n\r\nThis follows the HTTP approach where 4xx errors are caused by the client and not by a problem in the server","created_at":"2018-09-21T10:01:38Z","updated_at":"2018-12-03T20:45:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34dc2216b582196c0df045e5df0cb28280ba3f77","assignee":null,"assignees":[],"requested_reviewers":[{"login":"akshayjshah","id":972790,"node_id":"MDQ6VXNlcjk3Mjc5MA==","avatar_url":"https://avatars3.githubusercontent.com/u/972790?v=4","gravatar_id":"","url":"https://api.github.com/users/akshayjshah","html_url":"https://github.com/akshayjshah","followers_url":"https://api.github.com/users/akshayjshah/followers","following_url":"https://api.github.com/users/akshayjshah/following{/other_user}","gists_url":"https://api.github.com/users/akshayjshah/gists{/gist_id}","starred_url":"https://api.github.com/users/akshayjshah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akshayjshah/subscriptions","organizations_url":"https://api.github.com/users/akshayjshah/orgs","repos_url":"https://api.github.com/users/akshayjshah/repos","events_url":"https://api.github.com/users/akshayjshah/events{/privacy}","received_events_url":"https://api.github.com/users/akshayjshah/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1569/commits","review_comments_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1569/comments","review_comment_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/1569/comments","statuses_url":"https://api.github.com/repos/yarpc/yarpc-go/statuses/62d079b7041125f2fb31d04da287e7a222c20c8a","head":{"label":"martindam:error-on-server-errors","ref":"error-on-server-errors","sha":"62d079b7041125f2fb31d04da287e7a222c20c8a","user":{"login":"martindam","id":10091249,"node_id":"MDQ6VXNlcjEwMDkxMjQ5","avatar_url":"https://avatars0.githubusercontent.com/u/10091249?v=4","gravatar_id":"","url":"https://api.github.com/users/martindam","html_url":"https://github.com/martindam","followers_url":"https://api.github.com/users/martindam/followers","following_url":"https://api.github.com/users/martindam/following{/other_user}","gists_url":"https://api.github.com/users/martindam/gists{/gist_id}","starred_url":"https://api.github.com/users/martindam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martindam/subscriptions","organizations_url":"https://api.github.com/users/martindam/orgs","repos_url":"https://api.github.com/users/martindam/repos","events_url":"https://api.github.com/users/martindam/events{/privacy}","received_events_url":"https://api.github.com/users/martindam/received_events","type":"User","site_admin":false},"repo":{"id":149732625,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk3MzI2MjU=","name":"yarpc-go","full_name":"martindam/yarpc-go","private":false,"owner":{"login":"martindam","id":10091249,"node_id":"MDQ6VXNlcjEwMDkxMjQ5","avatar_url":"https://avatars0.githubusercontent.com/u/10091249?v=4","gravatar_id":"","url":"https://api.github.com/users/martindam","html_url":"https://github.com/martindam","followers_url":"https://api.github.com/users/martindam/followers","following_url":"https://api.github.com/users/martindam/following{/other_user}","gists_url":"https://api.github.com/users/martindam/gists{/gist_id}","starred_url":"https://api.github.com/users/martindam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martindam/subscriptions","organizations_url":"https://api.github.com/users/martindam/orgs","repos_url":"https://api.github.com/users/martindam/repos","events_url":"https://api.github.com/users/martindam/events{/privacy}","received_events_url":"https://api.github.com/users/martindam/received_events","type":"User","site_admin":false},"html_url":"https://github.com/martindam/yarpc-go","description":"A message passing platform for Go","fork":true,"url":"https://api.github.com/repos/martindam/yarpc-go","forks_url":"https://api.github.com/repos/martindam/yarpc-go/forks","keys_url":"https://api.github.com/repos/martindam/yarpc-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/martindam/yarpc-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/martindam/yarpc-go/teams","hooks_url":"https://api.github.com/repos/martindam/yarpc-go/hooks","issue_events_url":"https://api.github.com/repos/martindam/yarpc-go/issues/events{/number}","events_url":"https://api.github.com/repos/martindam/yarpc-go/events","assignees_url":"https://api.github.com/repos/martindam/yarpc-go/assignees{/user}","branches_url":"https://api.github.com/repos/martindam/yarpc-go/branches{/branch}","tags_url":"https://api.github.com/repos/martindam/yarpc-go/tags","blobs_url":"https://api.github.com/repos/martindam/yarpc-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/martindam/yarpc-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/martindam/yarpc-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/martindam/yarpc-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/martindam/yarpc-go/statuses/{sha}","languages_url":"https://api.github.com/repos/martindam/yarpc-go/languages","stargazers_url":"https://api.github.com/repos/martindam/yarpc-go/stargazers","contributors_url":"https://api.github.com/repos/martindam/yarpc-go/contributors","subscribers_url":"https://api.github.com/repos/martindam/yarpc-go/subscribers","subscription_url":"https://api.github.com/repos/martindam/yarpc-go/subscription","commits_url":"https://api.github.com/repos/martindam/yarpc-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/martindam/yarpc-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/martindam/yarpc-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/martindam/yarpc-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/martindam/yarpc-go/contents/{+path}","compare_url":"https://api.github.com/repos/martindam/yarpc-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/martindam/yarpc-go/merges","archive_url":"https://api.github.com/repos/martindam/yarpc-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/martindam/yarpc-go/downloads","issues_url":"https://api.github.com/repos/martindam/yarpc-go/issues{/number}","pulls_url":"https://api.github.com/repos/martindam/yarpc-go/pulls{/number}","milestones_url":"https://api.github.com/repos/martindam/yarpc-go/milestones{/number}","notifications_url":"https://api.github.com/repos/martindam/yarpc-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/martindam/yarpc-go/labels{/name}","releases_url":"https://api.github.com/repos/martindam/yarpc-go/releases{/id}","deployments_url":"https://api.github.com/repos/martindam/yarpc-go/deployments","created_at":"2018-09-21T08:19:59Z","updated_at":"2018-09-21T08:20:03Z","pushed_at":"2018-12-03T20:43:12Z","git_url":"git://github.com/martindam/yarpc-go.git","ssh_url":"git@github.com:martindam/yarpc-go.git","clone_url":"https://github.com/martindam/yarpc-go.git","svn_url":"https://github.com/martindam/yarpc-go","homepage":"","size":11437,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"yarpc:dev","ref":"dev","sha":"f9453eab4d29176f1fd5a3c6ba902bf996eaa636","user":{"login":"yarpc","id":16569504,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTY5NTA0","avatar_url":"https://avatars2.githubusercontent.com/u/16569504?v=4","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"repo":{"id":50390111,"node_id":"MDEwOlJlcG9zaXRvcnk1MDM5MDExMQ==","name":"yarpc-go","full_name":"yarpc/yarpc-go","private":false,"owner":{"login":"yarpc","id":16569504,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTY5NTA0","avatar_url":"https://avatars2.githubusercontent.com/u/16569504?v=4","gravatar_id":"","url":"https://api.github.com/users/yarpc","html_url":"https://github.com/yarpc","followers_url":"https://api.github.com/users/yarpc/followers","following_url":"https://api.github.com/users/yarpc/following{/other_user}","gists_url":"https://api.github.com/users/yarpc/gists{/gist_id}","starred_url":"https://api.github.com/users/yarpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarpc/subscriptions","organizations_url":"https://api.github.com/users/yarpc/orgs","repos_url":"https://api.github.com/users/yarpc/repos","events_url":"https://api.github.com/users/yarpc/events{/privacy}","received_events_url":"https://api.github.com/users/yarpc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/yarpc/yarpc-go","description":"A message passing platform for Go","fork":false,"url":"https://api.github.com/repos/yarpc/yarpc-go","forks_url":"https://api.github.com/repos/yarpc/yarpc-go/forks","keys_url":"https://api.github.com/repos/yarpc/yarpc-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yarpc/yarpc-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yarpc/yarpc-go/teams","hooks_url":"https://api.github.com/repos/yarpc/yarpc-go/hooks","issue_events_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/events{/number}","events_url":"https://api.github.com/repos/yarpc/yarpc-go/events","assignees_url":"https://api.github.com/repos/yarpc/yarpc-go/assignees{/user}","branches_url":"https://api.github.com/repos/yarpc/yarpc-go/branches{/branch}","tags_url":"https://api.github.com/repos/yarpc/yarpc-go/tags","blobs_url":"https://api.github.com/repos/yarpc/yarpc-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yarpc/yarpc-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yarpc/yarpc-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/yarpc/yarpc-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yarpc/yarpc-go/statuses/{sha}","languages_url":"https://api.github.com/repos/yarpc/yarpc-go/languages","stargazers_url":"https://api.github.com/repos/yarpc/yarpc-go/stargazers","contributors_url":"https://api.github.com/repos/yarpc/yarpc-go/contributors","subscribers_url":"https://api.github.com/repos/yarpc/yarpc-go/subscribers","subscription_url":"https://api.github.com/repos/yarpc/yarpc-go/subscription","commits_url":"https://api.github.com/repos/yarpc/yarpc-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/yarpc/yarpc-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/yarpc/yarpc-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/yarpc/yarpc-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/yarpc/yarpc-go/contents/{+path}","compare_url":"https://api.github.com/repos/yarpc/yarpc-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yarpc/yarpc-go/merges","archive_url":"https://api.github.com/repos/yarpc/yarpc-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yarpc/yarpc-go/downloads","issues_url":"https://api.github.com/repos/yarpc/yarpc-go/issues{/number}","pulls_url":"https://api.github.com/repos/yarpc/yarpc-go/pulls{/number}","milestones_url":"https://api.github.com/repos/yarpc/yarpc-go/milestones{/number}","notifications_url":"https://api.github.com/repos/yarpc/yarpc-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yarpc/yarpc-go/labels{/name}","releases_url":"https://api.github.com/repos/yarpc/yarpc-go/releases{/id}","deployments_url":"https://api.github.com/repos/yarpc/yarpc-go/deployments","created_at":"2016-01-26T00:04:14Z","updated_at":"2018-12-03T15:10:36Z","pushed_at":"2018-12-03T20:43:14Z","git_url":"git://github.com/yarpc/yarpc-go.git","ssh_url":"git@github.com:yarpc/yarpc-go.git","clone_url":"https://github.com/yarpc/yarpc-go.git","svn_url":"https://github.com/yarpc/yarpc-go","homepage":"","size":12377,"stargazers_count":171,"watchers_count":171,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":39,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":39,"open_issues":14,"watchers":171,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1569"},"html":{"href":"https://github.com/yarpc/yarpc-go/pull/1569"},"issue":{"href":"https://api.github.com/repos/yarpc/yarpc-go/issues/1569"},"comments":{"href":"https://api.github.com/repos/yarpc/yarpc-go/issues/1569/comments"},"review_comments":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1569/comments"},"review_comment":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yarpc/yarpc-go/pulls/1569/commits"},"statuses":{"href":"https://api.github.com/repos/yarpc/yarpc-go/statuses/62d079b7041125f2fb31d04da287e7a222c20c8a"}},"author_association":"NONE"}}
{"actor":{"display_login":"martindam"}}