知识卡片
追踪传播独立请求身份
在请求进入系统时建立追踪身份,并沿调用传播上下文,才能把各服务的片段拼成一条端到端路径。路径和来源IP可能重复,简单散列二者不能唯一标识每次请求;宜遵循Trace Context等规范和成熟SDK生成、传播TraceId/SpanId。标识用于关联,不应混作无限基数指标标签。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 14. Monitoring and Observability Patterns · 查看原书依据
you need to pass it along with the API calls you make throughout your system. Assuming that you are making API requests using the HTTP protocol, you can embed your correlation ID in an application-specific header, for example, x-my-apps-correlation-id, and modify your code to read from that
参考来源
- 位置:《Designing Distributed Systems, 2nd Edition》第14章《Chapter 14. Monitoring and Observability Patterns》(来源项目 book-sources;源文件:extracted/Designing Distributed Systems, 2nd Edition/_epub-src/OEBPS/ch14.html)
- 结论依据:原文说明上下文传递;W3C规范核验唯一追踪身份,纠正路径/IP散列可唯一的建议。
- 原始内容:you need to pass it along with the API calls you make throughout your system. Assuming that you are making API requests using the HTTP protocol, you can embed your correlation ID in an application-specific header, for example, x-my-apps-correlation-id, and modify your code to read from that