{"action":"created","comment":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/comments/231269231","pull_request_review_id":172180932,"id":231269231,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTI2OTIzMQ==","diff_hunk":"@@ -0,0 +1,103 @@\n+---\n+title: \"Dropwizard\"\n+date: 2018-11-05T14:42:17-07:00\n+draft: false\n+class: \"shadowed-image lightbox\"\n+aliases: [/integrations/dropwizard]\n+weight: 5\n+---\n+\n+- [Background](#background)\n+- [How it works](#how-it-works)\n+    - [Prerequisites](#1-prerequisites)\n+    - [Add the dependencies to your project](#2-add-the-dependencies-to-your-project)\n+    - [And the following code](#3-and-the-following-code)\n+    - [Viewing your metrics](#4-viewing-your-metrics)\n+\n+## Background\n+Dropwizard Metrics is a popular solution used by Java developers to capture JVM and application-level metrics from their services. In addition to distributed tracing, OpenCensus also captures application-level metrics from Java services, and interoperability between Dropwizard and OpenCensus has been one of our most asked for Java features. \n+\n+We have good news: OpenCensus now provides an easy way to export and migrate Dropwizard metrics to OpenCensus, and then on to your backend of choice.\n+\n+## How it works\n+We will follow four steps to complete the work.\n+\n+##### 1. Prerequisites\n+Assuming, you already have both the OpenCensus and Dropwizard client libraries setup and working inside your application.\n+\n+##### 2. Add the dependencies to your project\n+If you’ve got a Maven application, you’ll need to add opencensus-contrib-dropwizard as a dependency.\n+\n+```xml\n+<dependencies>\n+    <dependency>\n+        <groupId>io.opencensus</groupId>\n+        <artifactId>opencensus-contrib-dropwizard</artifactId>                  \n+        <version>0.17.0</version>\n+    </dependency>\n+</dependencies>\n+```\n+\n+And you can find its latest version [\\[here\\]](https://mvnrepository.com/artifact/io.opencensus/opencensus-contrib-dropwizard).\n+\n+\n+For Gradle add to your dependencies:\n+```xml\n+compile ‘io.opencensus:opencensus-dropwizard:0.17.0’\n+```\n+\n+##### 3. And the following code\n+\n+{{<highlight java>}}\n+import java.util.Collections;\n+import java.io.IOException;\n+import io.opencensus.exporter.stats.prometheus.PrometheusStatsCollector;\n+import io.prometheus.client.exporter.HTTPServer;\n+\n+public class YourClass {\n+  // Create registry for Dropwizard metrics.\n+  static final com.codahale.metrics.MetricRegistry \n+    codahaleRegistry = new com.codahale.metrics.MetricRegistry();\n+\n+  // Create a Dropwizard counter.\n+  static final com.codahale.metrics.Counter \n+     requests = codahaleRegistry.counter(\"requests\");\n+\n+  public static void main(String[] args) {\n+\n+    // Increment the requests.\n+    requests.inc();\n+\n+    // Hook the Dropwizard registry into the OpenCensus registry\n+    // via the DropWizardMetrics metric producer.\n+    io.opencensus.metrics.Metrics.getExportComponent().getMetricProducerManager().add(\n+          new io.opencensus.contrib.dropwizard.DropWizardMetrics(\n+            Collections.singletonList(codahaleRegistry)));\n+    \n+    setupOpenCensusAndPrometheusExporter();\n+    ...\n+  }\n+\n+  private static void setupOpenCensusAndPrometheusExporter() throws IOException {\n+    // Register the Prometheus exporter\n+    PrometheusStatsCollector.createAndRegister();","path":"content/guides/integrations/dropwizard.md","position":83,"original_position":83,"commit_id":"aecf3b2a919d3df40f7b4606820eda20c243cfe4","original_commit_id":"aecf3b2a919d3df40f7b4606820eda20c243cfe4","user":{"login":"odeke-em","id":4898263,"node_id":"MDQ6VXNlcjQ4OTgyNjM=","avatar_url":"https://avatars3.githubusercontent.com/u/4898263?v=4","gravatar_id":"","url":"https://api.github.com/users/odeke-em","html_url":"https://github.com/odeke-em","followers_url":"https://api.github.com/users/odeke-em/followers","following_url":"https://api.github.com/users/odeke-em/following{/other_user}","gists_url":"https://api.github.com/users/odeke-em/gists{/gist_id}","starred_url":"https://api.github.com/users/odeke-em/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odeke-em/subscriptions","organizations_url":"https://api.github.com/users/odeke-em/orgs","repos_url":"https://api.github.com/users/odeke-em/repos","events_url":"https://api.github.com/users/odeke-em/events{/privacy}","received_events_url":"https://api.github.com/users/odeke-em/received_events","type":"User","site_admin":false},"body":"Somehow in their POM.xml we forgot to include the Prometheus imports.","created_at":"2018-11-06T19:54:41Z","updated_at":"2018-11-06T19:59:03Z","html_url":"https://github.com/census-instrumentation/opencensus-website/pull/429#discussion_r231269231","pull_request_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/429","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/comments/231269231"},"html":{"href":"https://github.com/census-instrumentation/opencensus-website/pull/429#discussion_r231269231"},"pull_request":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/429"}}},"pull_request":{"url":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/429","id":228764778,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4NzY0Nzc4","html_url":"https://github.com/census-instrumentation/opencensus-website/pull/429","diff_url":"https://github.com/census-instrumentation/opencensus-website/pull/429.diff","patch_url":"https://github.com/census-instrumentation/opencensus-website/pull/429.patch","issue_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/issues/429","number":429,"state":"open","locked":false,"title":"content/guides/integrations: Dropwizard","user":{"login":"mayurkale22","id":6525361,"node_id":"MDQ6VXNlcjY1MjUzNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/6525361?v=4","gravatar_id":"","url":"https://api.github.com/users/mayurkale22","html_url":"https://github.com/mayurkale22","followers_url":"https://api.github.com/users/mayurkale22/followers","following_url":"https://api.github.com/users/mayurkale22/following{/other_user}","gists_url":"https://api.github.com/users/mayurkale22/gists{/gist_id}","starred_url":"https://api.github.com/users/mayurkale22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mayurkale22/subscriptions","organizations_url":"https://api.github.com/users/mayurkale22/orgs","repos_url":"https://api.github.com/users/mayurkale22/repos","events_url":"https://api.github.com/users/mayurkale22/events{/privacy}","received_events_url":"https://api.github.com/users/mayurkale22/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-06T17:00:04Z","updated_at":"2018-11-06T19:59:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a77db077d33a7a99f7607e176120f68a36e24433","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":867838896,"node_id":"MDU6TGFiZWw4Njc4Mzg4OTY=","url":"https://api.github.com/repos/census-instrumentation/opencensus-website/labels/cla:%20yes","name":"cla: yes","color":"ccfcae","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/429/commits","review_comments_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/429/comments","review_comment_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/comments{/number}","comments_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/issues/429/comments","statuses_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/statuses/aecf3b2a919d3df40f7b4606820eda20c243cfe4","head":{"label":"mayurkale22:dropwizard_integration","ref":"dropwizard_integration","sha":"aecf3b2a919d3df40f7b4606820eda20c243cfe4","user":{"login":"mayurkale22","id":6525361,"node_id":"MDQ6VXNlcjY1MjUzNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/6525361?v=4","gravatar_id":"","url":"https://api.github.com/users/mayurkale22","html_url":"https://github.com/mayurkale22","followers_url":"https://api.github.com/users/mayurkale22/followers","following_url":"https://api.github.com/users/mayurkale22/following{/other_user}","gists_url":"https://api.github.com/users/mayurkale22/gists{/gist_id}","starred_url":"https://api.github.com/users/mayurkale22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mayurkale22/subscriptions","organizations_url":"https://api.github.com/users/mayurkale22/orgs","repos_url":"https://api.github.com/users/mayurkale22/repos","events_url":"https://api.github.com/users/mayurkale22/events{/privacy}","received_events_url":"https://api.github.com/users/mayurkale22/received_events","type":"User","site_admin":false},"repo":{"id":145482773,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU0ODI3NzM=","name":"opencensus-website","full_name":"mayurkale22/opencensus-website","private":false,"owner":{"login":"mayurkale22","id":6525361,"node_id":"MDQ6VXNlcjY1MjUzNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/6525361?v=4","gravatar_id":"","url":"https://api.github.com/users/mayurkale22","html_url":"https://github.com/mayurkale22","followers_url":"https://api.github.com/users/mayurkale22/followers","following_url":"https://api.github.com/users/mayurkale22/following{/other_user}","gists_url":"https://api.github.com/users/mayurkale22/gists{/gist_id}","starred_url":"https://api.github.com/users/mayurkale22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mayurkale22/subscriptions","organizations_url":"https://api.github.com/users/mayurkale22/orgs","repos_url":"https://api.github.com/users/mayurkale22/repos","events_url":"https://api.github.com/users/mayurkale22/events{/privacy}","received_events_url":"https://api.github.com/users/mayurkale22/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mayurkale22/opencensus-website","description":"opencensus.io website content","fork":true,"url":"https://api.github.com/repos/mayurkale22/opencensus-website","forks_url":"https://api.github.com/repos/mayurkale22/opencensus-website/forks","keys_url":"https://api.github.com/repos/mayurkale22/opencensus-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mayurkale22/opencensus-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mayurkale22/opencensus-website/teams","hooks_url":"https://api.github.com/repos/mayurkale22/opencensus-website/hooks","issue_events_url":"https://api.github.com/repos/mayurkale22/opencensus-website/issues/events{/number}","events_url":"https://api.github.com/repos/mayurkale22/opencensus-website/events","assignees_url":"https://api.github.com/repos/mayurkale22/opencensus-website/assignees{/user}","branches_url":"https://api.github.com/repos/mayurkale22/opencensus-website/branches{/branch}","tags_url":"https://api.github.com/repos/mayurkale22/opencensus-website/tags","blobs_url":"https://api.github.com/repos/mayurkale22/opencensus-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mayurkale22/opencensus-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mayurkale22/opencensus-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/mayurkale22/opencensus-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mayurkale22/opencensus-website/statuses/{sha}","languages_url":"https://api.github.com/repos/mayurkale22/opencensus-website/languages","stargazers_url":"https://api.github.com/repos/mayurkale22/opencensus-website/stargazers","contributors_url":"https://api.github.com/repos/mayurkale22/opencensus-website/contributors","subscribers_url":"https://api.github.com/repos/mayurkale22/opencensus-website/subscribers","subscription_url":"https://api.github.com/repos/mayurkale22/opencensus-website/subscription","commits_url":"https://api.github.com/repos/mayurkale22/opencensus-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/mayurkale22/opencensus-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/mayurkale22/opencensus-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/mayurkale22/opencensus-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/mayurkale22/opencensus-website/contents/{+path}","compare_url":"https://api.github.com/repos/mayurkale22/opencensus-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mayurkale22/opencensus-website/merges","archive_url":"https://api.github.com/repos/mayurkale22/opencensus-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mayurkale22/opencensus-website/downloads","issues_url":"https://api.github.com/repos/mayurkale22/opencensus-website/issues{/number}","pulls_url":"https://api.github.com/repos/mayurkale22/opencensus-website/pulls{/number}","milestones_url":"https://api.github.com/repos/mayurkale22/opencensus-website/milestones{/number}","notifications_url":"https://api.github.com/repos/mayurkale22/opencensus-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mayurkale22/opencensus-website/labels{/name}","releases_url":"https://api.github.com/repos/mayurkale22/opencensus-website/releases{/id}","deployments_url":"https://api.github.com/repos/mayurkale22/opencensus-website/deployments","created_at":"2018-08-21T00:00:36Z","updated_at":"2018-11-05T23:50:46Z","pushed_at":"2018-11-06T18:31:30Z","git_url":"git://github.com/mayurkale22/opencensus-website.git","ssh_url":"git@github.com:mayurkale22/opencensus-website.git","clone_url":"https://github.com/mayurkale22/opencensus-website.git","svn_url":"https://github.com/mayurkale22/opencensus-website","homepage":"https://opencensus.io","size":61842,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"census-instrumentation:master","ref":"master","sha":"38205bc462ebad7f92545c0a3050ca6bd5e95d88","user":{"login":"census-instrumentation","id":26944525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2OTQ0NTI1","avatar_url":"https://avatars0.githubusercontent.com/u/26944525?v=4","gravatar_id":"","url":"https://api.github.com/users/census-instrumentation","html_url":"https://github.com/census-instrumentation","followers_url":"https://api.github.com/users/census-instrumentation/followers","following_url":"https://api.github.com/users/census-instrumentation/following{/other_user}","gists_url":"https://api.github.com/users/census-instrumentation/gists{/gist_id}","starred_url":"https://api.github.com/users/census-instrumentation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/census-instrumentation/subscriptions","organizations_url":"https://api.github.com/users/census-instrumentation/orgs","repos_url":"https://api.github.com/users/census-instrumentation/repos","events_url":"https://api.github.com/users/census-instrumentation/events{/privacy}","received_events_url":"https://api.github.com/users/census-instrumentation/received_events","type":"Organization","site_admin":false},"repo":{"id":107703454,"node_id":"MDEwOlJlcG9zaXRvcnkxMDc3MDM0NTQ=","name":"opencensus-website","full_name":"census-instrumentation/opencensus-website","private":false,"owner":{"login":"census-instrumentation","id":26944525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2OTQ0NTI1","avatar_url":"https://avatars0.githubusercontent.com/u/26944525?v=4","gravatar_id":"","url":"https://api.github.com/users/census-instrumentation","html_url":"https://github.com/census-instrumentation","followers_url":"https://api.github.com/users/census-instrumentation/followers","following_url":"https://api.github.com/users/census-instrumentation/following{/other_user}","gists_url":"https://api.github.com/users/census-instrumentation/gists{/gist_id}","starred_url":"https://api.github.com/users/census-instrumentation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/census-instrumentation/subscriptions","organizations_url":"https://api.github.com/users/census-instrumentation/orgs","repos_url":"https://api.github.com/users/census-instrumentation/repos","events_url":"https://api.github.com/users/census-instrumentation/events{/privacy}","received_events_url":"https://api.github.com/users/census-instrumentation/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/census-instrumentation/opencensus-website","description":"opencensus.io website content","fork":false,"url":"https://api.github.com/repos/census-instrumentation/opencensus-website","forks_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/forks","keys_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/keys{/key_id}","collaborators_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/teams","hooks_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/hooks","issue_events_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/issues/events{/number}","events_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/events","assignees_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/assignees{/user}","branches_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/branches{/branch}","tags_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/tags","blobs_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/git/refs{/sha}","trees_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/git/trees{/sha}","statuses_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/statuses/{sha}","languages_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/languages","stargazers_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/stargazers","contributors_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/contributors","subscribers_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/subscribers","subscription_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/subscription","commits_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/commits{/sha}","git_commits_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/git/commits{/sha}","comments_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/comments{/number}","issue_comment_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/issues/comments{/number}","contents_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/contents/{+path}","compare_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/compare/{base}...{head}","merges_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/merges","archive_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/downloads","issues_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/issues{/number}","pulls_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls{/number}","milestones_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/milestones{/number}","notifications_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/labels{/name}","releases_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/releases{/id}","deployments_url":"https://api.github.com/repos/census-instrumentation/opencensus-website/deployments","created_at":"2017-10-20T16:51:09Z","updated_at":"2018-11-05T22:40:52Z","pushed_at":"2018-11-06T18:31:32Z","git_url":"git://github.com/census-instrumentation/opencensus-website.git","ssh_url":"git@github.com:census-instrumentation/opencensus-website.git","clone_url":"https://github.com/census-instrumentation/opencensus-website.git","svn_url":"https://github.com/census-instrumentation/opencensus-website","homepage":"https://opencensus.io","size":61331,"stargazers_count":26,"watchers_count":26,"language":"CSS","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":51,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":62,"open_issues":51,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/429"},"html":{"href":"https://github.com/census-instrumentation/opencensus-website/pull/429"},"issue":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-website/issues/429"},"comments":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-website/issues/429/comments"},"review_comments":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/429/comments"},"review_comment":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-website/pulls/429/commits"},"statuses":{"href":"https://api.github.com/repos/census-instrumentation/opencensus-website/statuses/aecf3b2a919d3df40f7b4606820eda20c243cfe4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"odeke-em"}}