{"id":21212811,"url":"https://github.com/bad-logic/distributed-tracing","last_synced_at":"2026-02-19T10:30:57.303Z","repository":{"id":121507356,"uuid":"541150272","full_name":"bad-logic/distributed-tracing","owner":"bad-logic","description":"distributed tracing example with opentelemetry","archived":false,"fork":false,"pushed_at":"2026-01-12T15:57:27.000Z","size":2727,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T16:59:03.287Z","etag":null,"topics":["011y","kafka","microservices","observability","opentelemetry","opentelemetry-collector","opentelemetry-cpp","opentelemetry-go","opentelemetry-javascript","opentelemetry-python","otel","trace"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bad-logic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2022-09-25T11:37:08.000Z","updated_at":"2026-01-12T07:04:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f3f84d9-a5b3-4153-bdf4-8cbdca56ce03","html_url":"https://github.com/bad-logic/distributed-tracing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bad-logic/distributed-tracing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bad-logic%2Fdistributed-tracing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bad-logic%2Fdistributed-tracing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bad-logic%2Fdistributed-tracing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bad-logic%2Fdistributed-tracing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bad-logic","download_url":"https://codeload.github.com/bad-logic/distributed-tracing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bad-logic%2Fdistributed-tracing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29609771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["011y","kafka","microservices","observability","opentelemetry","opentelemetry-collector","opentelemetry-cpp","opentelemetry-go","opentelemetry-javascript","opentelemetry-python","otel","trace"],"created_at":"2024-11-20T21:12:04.743Z","updated_at":"2026-02-19T10:30:57.285Z","avatar_url":"https://github.com/bad-logic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### DISTRIBUTED TRACING\n\nIn distributed systems, a single operation may traverse across multiple software components. each software components may produce traces/logs that are uniquely identifiable across the participating systems. so it is very difficult to correlate those traces/logs.\n\nIn order to correlate those traces/logs, they must share a context that tells them that they are part of a specific transaction/operation.\n\nTrace context is something that can be passed along with the request, that tells the participating system that it is a part of a specific operation.\n\nTrace context is split into two individual propagation fields supporting interoperability and vendor-specific extensibility:\n\n**_traceparent header_** : represents the incoming request in a tracing system in a common format, understood by all vendors.\n\nFormat: {version}-{trace_id}-{parent_id}-{trace_flags}\n\n**version** =\u003e 2 HEXDIGLC (Hexadecimal digits lowercase)\n\n\u003e The current specification assumes the version is set to 00. Version ff is forbidden\n\n**trace_id** =\u003e 32 HEXDIGLC (16 bytes array identifier. All zeroes forbidden)\n\n\u003e All traces belonging to the same transaction will have same trace_id. it is a unique identifier across the distributed system.\n\n[how to generate trace_id ?](https://www.w3.org/TR/trace-context-1/#considerations-for-trace-id-field-generation)\n\n**parent_id** =\u003e 16 HEXDIGLC (8 bytes array identifier. All zeroes forbidden)\n\n\u003e It is the id of the caller. In some tracing system it may also be known as the span_id.\n\n**trace_flags** =\u003e 2 HEXDIGLC (8 bit flags.)\n\n\u003e The current version of this specification (00) only supports a single flag called sampled.\n\n```\nstatic final byte FLAG_SAMPLED = 1; // 00000001\nboolean sampled = (traceFlags \u0026 FLAG_SAMPLED) == FLAG_SAMPLED;\n```\n\nEx:\n\n```\n00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01\nbase16(version) = 00\nbase16(trace-id) = 4bf92f3577b34da6a3ce929d0e0e4736\nbase16(parent-id) = 00f067aa0ba902b7\nbase16(trace-flags) = 01  // sampled\n```\n\n```\n00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00\nbase16(version) = 00\nbase16(trace-id) = 4bf92f3577b34da6a3ce929d0e0e4736\nbase16(parent-id) = 00f067aa0ba902b7\nbase16(trace-flags) = 00  // not sampled\n```\n\n**_tracestate header_** (optional): includes the parent in a potentially vendor-specific format\n\n\u003ca href=\"https://www.w3.org/TR/trace-context-1/\" target=\"_blank\"\u003eRead more...\u003c/a\u003e\n\n### How to run application !!!\n\nFirst run kafka\n\n\u003e docker-compose -f deploy/kafka-compose.yaml up -d\n\nRun logging containers\n\n\u003e docker-compose -f deploy/logs-compose.yaml up -d\n\nRun application containers\n\n\u003e docker-compose -f deploy/docker-compose.yaml up\n\nOR\n\nRun with script\n\n```bash\n$ chmod +x run.sh\n$ ./run.sh\n```\n\nRunning Migrations\n\n```bash\n$ chmod +x migrations.sh\n$ ./migrations.sh run\n```\n\nRunning Applications\\\n[product microservice](./products/README.md) `localhost:8082/product`\\\n[order microservice](./orders/README.md) `localhost:8083/order/`\\\n[kafka ui](./deploy/kafka-compose.yaml#L52) `localhost:8080`\\\n[Zipkin](./deploy/logs-compose.yaml#L30) `localhost:9411`\\\n[Jaeger](./deploy/logs-compose.yaml#L22) `localhost:16686`\\\n[consumer node](./consumer-node/README.md)\\\n[consumer cpp](./consumers/README.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbad-logic%2Fdistributed-tracing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbad-logic%2Fdistributed-tracing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbad-logic%2Fdistributed-tracing/lists"}