{"id":20337328,"url":"https://github.com/expediadotcom/haystack-dropwizard","last_synced_at":"2025-07-13T23:07:48.443Z","repository":{"id":57719178,"uuid":"170121443","full_name":"ExpediaDotCom/haystack-dropwizard","owner":"ExpediaDotCom","description":null,"archived":false,"fork":false,"pushed_at":"2020-01-24T03:29:34.000Z","size":101,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-07-13T23:04:41.234Z","etag":null,"topics":["distributed-tracing","dropwizard","java","opentracing"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ExpediaDotCom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-11T12:00:22.000Z","updated_at":"2020-01-23T13:35:09.000Z","dependencies_parsed_at":"2022-08-26T08:20:17.494Z","dependency_job_id":null,"html_url":"https://github.com/ExpediaDotCom/haystack-dropwizard","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ExpediaDotCom/haystack-dropwizard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpediaDotCom%2Fhaystack-dropwizard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpediaDotCom%2Fhaystack-dropwizard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpediaDotCom%2Fhaystack-dropwizard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpediaDotCom%2Fhaystack-dropwizard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ExpediaDotCom","download_url":"https://codeload.github.com/ExpediaDotCom/haystack-dropwizard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpediaDotCom%2Fhaystack-dropwizard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265218753,"owners_count":23729528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distributed-tracing","dropwizard","java","opentracing"],"created_at":"2024-11-14T21:08:39.459Z","updated_at":"2025-07-13T23:07:48.172Z","avatar_url":"https://github.com/ExpediaDotCom.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/ExpediaDotCom/haystack-dropwizard.svg?branch=master)](https://travis-ci.org/ExpediaDotCom/haystack-dropwizard)\n[![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/ExpediaDotCom/haystack/blob/master/LICENSE)\n\n## Table of Contents\n\n- [Instrumenting dropwizard applications](#Instrumenting-dropwizard-applications)\n- [Quick start](#quick-start)\n  * [Haystack dropwizard dependency](#haystack-dropwizard-dependency)\n  * [Usage](#Usage)\n- [See Also](#See-also)\n\n## Instrumenting dropwizard applications\nOne can use haystack-dropwizard to instrument dropwizard applications and send tracing information to open tracing compliant [Haystack](https://expediadotcom.github.io/haystack) server distributed tracing platform.\n\nThis library in turn use [haystack-client-java](https://github.com/ExpediaDotCom/haystack-client-java) which provides an implementation of `io.opentracing.Tracer` and helps create an instance of it.\n\n## Quick Start\nThis section provides steps required to quickly configure your dropwizard application, to be wired using [OpenTracing JAX-RS Instumentation](https://github.com/opentracing-contrib/java-jaxrs)'s dropwizard integration to haystack.\nIf you need additional information, please read the subsequent sections in this document.\n\n# Haystack dropwizard dependency\nAdd the following dependency to your application.\n\n```\n   \u003cdependency\u003e\n        \u003cgroupId\u003ecom.expedia.www\u003c/groupId\u003e\n        \u003cartifactId\u003ehaystack-dropwizard\u003c/artifactId\u003e\n        \u003cversion\u003e${haystack-dropwizard.version}\u003c/version\u003e\n   \u003c/dependency\u003e\n```\n\n# Usage\nTo make use of the depency to create and manage traces one needs to do the following.\n\nInstantiate a `HaystackTracerBundle` to be passed to your dropwizard application while bootstrapping. \nAlso in case we need to trace the client requests emanating from this app we need to register the clienttracing feature with the client to be used. \nHere is a short example:\n\n```\npublic class FrontendApplication extends Application\u003cHelloWorldConfiguration\u003e {\n    \n    // This bundle needs to be always initialised and passed to the app while bootstrapping.\n    // bundle that initializes an instance of io.opentracing.Tracer\n    private final HaystackTracerBundle\u003cHelloWorldConfiguration\u003e haystackTracerBundle = new HaystackTracerBundle\u003c\u003e();\n\n    // Here we are adding the bundle\n    @Override\n    public void initialize(Bootstrap\u003cHelloWorldConfiguration\u003e bootstrap) {\n        // the following line initializes server tracing and entertains @Traced\n        // annotations on Resource methods\n        bootstrap.addBundle(this.haystackTracerBundle);\n    }\n\n    // If we need to trace client requests emanating from the app,\n    // We need to register the clienttracingfeature with the client and then use this client to make the requests.\n    @Override\n    public void run(HelloWorldConfiguration helloWorldConfiguration,\n                    Environment environment) {\n        // the following line registers ClientTracingFeature to trace all\n        // outbound service calls\n        final Client client = ClientBuilder.newBuilder()\n                .register(this.haystackTracerBundle.clientTracingFeature(environment))\n                .build();\n\n        environment.jersey().register(new Frontend(client));\n    }\n}\n```\n\nAlso in the configuration yaml file for the application usually named config.yml, one needs to add the following snippet\nwith appropriate configs:\n\nFor local dispatch, means the traces will not be sent to the haystack server instead they will only be written to local file\n```\ntracer:\n  serviceName: Backend\n  enabled: true\n  dispatchers:\n    - type: logger\n      loggerName: dispatcher\n```\n\nFor remote dispatch, means the traces will be sent to the haystack server using the haystack client\n```\ntracer:\n  serviceName: Backend\n  enabled: true\n  dispatchers:\n    - type: remote\n      client:\n        type: agent\n        host: localhost\n        format:\n          type: protobuf\n```\n\nTo find the full example check this example of a simple application with client and server side tracing enabled,\n[Haystack Dropwizard Example](https://github.com/ExpediaDotCom/haystack-dropwizard-example).\n\n\nTo check how blobs feature work with tracing, check this example of a simple application with client and server side\n[Haystack Blob Example](https://github.com/ExpediaDotCom/haystack-blob-example).\n\n## See Also \nThis library is built on top of [Haystack client java](https://github.com/ExpediaDotCom/haystack-client-java).\n\nFurther resources:  \n[JAX-RS2]: https://jax-rs.github.io/apidocs/2.1/  \n[Jersey]: https://jersey.java.net  \n[Dropwizard]: http://www.dropwizard.io  \n[Opentracing JAX-RS instrumentation]: https://github.com/opentracing-contrib/java-jaxrs  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpediadotcom%2Fhaystack-dropwizard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpediadotcom%2Fhaystack-dropwizard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpediadotcom%2Fhaystack-dropwizard/lists"}