How to start trace with custom trace-id and parent-id?
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Funcionalidade
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- java, kafka
- Domínio
- distributed-systems, observability-sre
Direção de pesquisa
Comece pelos pontos de entrada Java mostrados no exemplo—GlobalTracer.get(), buildSpan(...).asChildOf() e CustomSpanContext—e compare como os headers Kafka armazenados são consumidos no contêiner outbox. Determine qual API compatível, se houver alguma, aceita o trace-id e o parent-id enquanto preserva o distributed tracing. Está concluído quando um span de publishFromOutbox aparece no trace existente com logs correlacionados.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Java
- Estrelas
- 736
- Forks
- 364
- Merge médio
- 3d 8h
- PRs com merge (30d)
- 208
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de DataDog/dd-trace-java
-
type: bug report
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
DataDog/dd-trace-java#12818 · 3 reações ·
Mantenedores costumam responder em até 2 dias
-
Update DEFAULT_HTTP_CLIENT_ERROR_STATUSES to include 5xx status codesTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Abertatype: feature request
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 70/100
DataDog/dd-trace-java#10245 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
type: feature request
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
DataDog/dd-trace-java#12838 · 2 comentários ·
Mantenedores costumam responder em até 2 dias
-
Startup ~2x slower with AOT class linking: agent retransforms ~22k preloaded classes (JDK 25, 1.67.0)Talvez já em andamento @mcculls assumiu há 4 dias. Abertatype: bug report
DataDog/dd-trace-java#12795 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 2 dias
-
gRPC server instrumentations (grpc-1.5, armeria-grpc) don't make extracted W3C baggage current in the handlerTalvez já em andamento @mcculls assumiu há 14 dias. Abertacomp: context propagation inst: grpc type: feature request
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 78/100
DataDog/dd-trace-java#12654 · 1 responsável ·
Mantenedores costumam responder em até 2 dias
Todas as issues de DataDog/dd-trace-java
Issues semelhantes
-
`RedisList.reversed()` view returns an empty `range` and `trim` removes all elementsTalvez já em andamento @CCCLL assumiu hoje. Abertastatus: waiting-for-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
spring-projects/spring-data-redis#3461 ·
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
devops-thiago/ThrillhouseBot#1093 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
wimdeblauwe/htmx-spring-boot#205 ·
-
[BUG] 增量 SSE 解析器未识别单独 CR 换行,导致事件无法及时交付Talvez já em andamento @king-wwwhhh assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
langchain4j/langchain4j#6669 ·
Mantenedores costumam responder em até 1 dia
-
enhancement tech-debt
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Albertinesilva/backend-engineering-journey-java-springboot#41 ·