{"id":15842751,"url":"https://github.com/dweber019/spring-sleuth-example","last_synced_at":"2025-07-25T00:35:26.956Z","repository":{"id":77030070,"uuid":"446148861","full_name":"dweber019/spring-sleuth-example","owner":"dweber019","description":"With OpenApi, RestTemplate and request logging","archived":false,"fork":false,"pushed_at":"2022-11-09T05:09:21.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T17:49:09.856Z","etag":null,"topics":["b3","openapi","sleuth","spring-boot","tracing"],"latest_commit_sha":null,"homepage":"","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/dweber019.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-09T16:54:52.000Z","updated_at":"2022-01-09T18:16:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"2181ddbd-6364-4588-b438-37eb4d7ee0f7","html_url":"https://github.com/dweber019/spring-sleuth-example","commit_stats":{"total_commits":3,"total_committers":3,"mean_commits":1.0,"dds":0.6666666666666667,"last_synced_commit":"6642c199a134acf8b9f4703002d16eff601d89d1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dweber019/spring-sleuth-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweber019%2Fspring-sleuth-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweber019%2Fspring-sleuth-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweber019%2Fspring-sleuth-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweber019%2Fspring-sleuth-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dweber019","download_url":"https://codeload.github.com/dweber019/spring-sleuth-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweber019%2Fspring-sleuth-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266931154,"owners_count":24008283,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["b3","openapi","sleuth","spring-boot","tracing"],"created_at":"2024-10-05T17:01:38.119Z","updated_at":"2025-07-25T00:35:26.907Z","avatar_url":"https://github.com/dweber019.png","language":"Java","readme":"# spring-sleuth-example\nWith OpenApi, RestTemplate and request logging\n\n## Swagger UI\nYou can find the OpenAPI UI at http://localhost:8080/swagger-ui/index.html\n\nAs the Sleuth headers (default B3) aren't directly generated into the OpenAPI specification we have to add them manually.  \nSee `OpenApiConfig.java`.\n\n## Sleuth settings\nIf you like to pass tracing context from outside the app you need to define at least `TraceId` and `SpanId`.\n\n**Here are some valid example values:**  \nX-B3-TraceId: 80f198ee56343ba864fe8b2a57d3eff7  \nX-B3-ParentSpanId: 05e3ac9a4f6e3b90  \nX-B3-SpanId: e457b5a2e4d86bd1  \nX-B3-Sampled: 1\n\n## Logging and proxy\nAll logging configs can be found at `LoggingConfig.java` including a proxy config as this example was behind a proxy.  \nJust remove the factory if you don't need it.\n\n## Baggage\nYou can use the [testing.http](./testing.http) file to test.\nWe propagate the `cid` field via `baggage` header. You need to add the `cid` to `remote-fields` and `correlation-fields` in [application.yaml](./src/main/resources/application.yml).\n\nYou also need to specify specific log pattern:\n```yaml\nlogging.pattern.level: \"%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-},CID=%X{cid:-}]\"\n```\n\nThis will generate the following log example:\n```text\n2022-11-07 16:22:04.583  INFO [Sleuth Example,3e7eb8c882e31157,261ccb470dc092c4,CID=my-correalation-id] 22656 --- [nio-8080-exec-1] c.b.e.sleuthexample.CatFactsController   : You are at sleuth endpoint\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdweber019%2Fspring-sleuth-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdweber019%2Fspring-sleuth-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdweber019%2Fspring-sleuth-example/lists"}