How to start trace with custom trace-id and parent-id?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java, kafka
- Lĩnh vực
- distributed-systems, observability-sre
Hướng nghiên cứu
Bắt đầu với các điểm vào Java được nêu trong ví dụ—GlobalTracer.get(), buildSpan(...).asChildOf() và CustomSpanContext—và so sánh cách các Kafka header đã lưu được sử dụng trong outbox container. Xác định API được hỗ trợ nào, nếu có, chấp nhận trace-id và parent-id trong khi vẫn duy trì distributed tracing. Hoàn tất khi một span từ publishFromOutbox xuất hiện trong trace hiện có cùng với các log tương quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Library Name
micronaut
Library Version(s)
dd-trace:1.50.1
Describe the feature you'd like
Hi,
We are storing outbox events for Kafka in the database with current span context headers:
headers={
x-datadog-parent-id=1425649086485655485,
x-datadog-sampling-priority=1,
tracestate=dd=s:1;
o:rum;
p:13c8ec4a6e566fbd,
x-datadog-origin=rum,
traceparent=00-000000000000000024fefac4c68ae928-13c8ec4a6e566fbd-01,
x-datadog-trace-id=2665843752501438760
}
and when these outbox events are picked (by a different container), we want to trace that operation but attach those spans to an already existing trace so that we can have support for:
- distributed tracing
- distributed logs
Is your feature request related to a problem?
No response
Describe alternatives you've considered
This is what we tried
void publishFromOutbox(final Outbox outboxEvent) {
final var tracer = GlobalTracer.get();
final Span span = tracer.buildSpan(JOBS)
.withTag(DDTags.RESOURCE_NAME, OUTBOX_SCHEDULER_PUBLISH)
.ignoreActiveSpan()
.asChildOf(new CustomSpanContext(
outboxEvent.headers().get(X_DATADOG_TRACE_ID), outboxEvent.headers().get(X_DATADOG_PARENT_ID)))
.start();
tracer.activateSpan(span);
publish(outboxEvent);
tracer.activeSpan().finish();
}
but we can see this doesn't work. Trace is not created or attached to any existing trace.
How can we accomplish starting trace with custom trace-id and parent-id? For PHP services we are using this handy method that you provide
/**
* Apply the distributed tracing information on the current and future spans. That API can be called if there is no
* other currently active span.
*
* The distributed tracing context can be reset by calling 'set_distributed_tracing_context("0", "0")'
*
* @param string $traceId The unique integer (128-bit unsigned) ID of the trace containing this span
* @param string $parentId The span integer ID of the parent span
* @param string|null $origin The distributed tracing origin
* @param array|string|null $propagated_tags If provided, propagated tags from the root span will be cleared and
* replaced by the given tags and applied to existing spans
* @return bool 'true' if the distributed tracing context was properly set, else 'false' if an error occurred
*/
function set_distributed_tracing_context(
string $traceId,
string $parentId,
?string $origin = null,
array|string|null $propagated_tags = null
): bool {}
Additional context
No response
- Ngôn ngữ chính
- Java
- Star
- 737
- Fork
- 361
- Merge trung bình
- 3 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 173
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DataDog/dd-trace-java
-
type: feature request
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 70/100
DataDog/dd-trace-java#10245 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
DataDog/dd-trace-java#12608 ·
-
type: bug report
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
DataDog/dd-trace-java#12597 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
DataDog/dd-trace-java#12540 · 3 bình luận · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
DataDog/dd-trace-java#12480 ·
Tất cả issue của DataDog/dd-trace-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
elastic/gradle-plugins#157 ·
-
enhancement Tools
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
apache/rocketmq-dashboard#5008 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
DETECT_PARAMETER_NAMES=false silently disables @ConstructorProperties-based Creator detection too Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
FasterXML/jackson-databind#6229 ·