Closed nhinsch closed 4 years ago
Merging #44 into master will decrease coverage by
1.92%
. The diff coverage is24.56%
.
@@ Coverage Diff @@
## master #44 +/- ##
==========================================
- Coverage 84.44% 82.52% -1.93%
==========================================
Files 12 12
Lines 540 555 +15
==========================================
+ Hits 456 458 +2
- Misses 63 81 +18
+ Partials 21 16 -5
Impacted Files | Coverage Δ | |
---|---|---|
internal/trace/listener.go | 0.00% <0.00%> (ø) |
|
ddlambda.go | 80.00% <100.00%> (+3.72%) |
:arrow_up: |
internal/trace/context.go | 87.15% <100.00%> (+0.24%) |
:arrow_up: |
internal/metrics/processor.go | 93.75% <0.00%> (-3.13%) |
:arrow_down: |
internal/metrics/listener.go | 96.29% <0.00%> (+23.79%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update e683acf...4ce82c5. Read the comment docs.
Hi @nhinsch @DarcyRaynerDD
I would like to ask, are you sure that this is working? From tests, I see that it is generating trace_id as hex
{
"traces": [
[
{
"trace_id": "6fb744bf13869d00",
"span_id": "1e8538262a43c188",
"parent_id": "1e5df70157538a8e",
"name": "aws.lambda",
And traces are not connecting with logs - https://docs.datadoghq.com/tracing/connect_logs_and_traces/ - because Datadog is making query like @lambda.request_id:(fe757c85-ef6f-4c09-8e24-ca5a16edbdae) OR trace_id:8049978446405082368
(converted hex to uint64 is giving correct value). Also reading documentation https://docs.datadoghq.com/api/v1/tracing/#send-traces looks like DataDog is expecting trace_id as uint64
Even in this PR we can find
fmt.Println("Current trace ID: " + strconv.FormatUint(currentSpanContext.TraceID(), 10))
Bottom line: In current Hex format traces are not connected to Logs - it should be fixed and send as uint64
What do you think? Or maybe I am doing something wrong
What does this PR do?
Adds support for tracing.
dd-trace-go
packageDD_TRACE_ENABLED
andDD_MERGE_XRAY_TRACES
(both default to false)DD_TRACE_ENABLED == true
, create a function execution span representing the Lambda function execution and add appropriate tags.DD_MERGE_XRAY_TRACES == true
, make the function execution span a child of the current span. In other words, do NOT make the function execution span a child of the current span if the current span is an X-Ray segment and the user does NOT want to merge their Datadog and X-Ray traces.source
of a trace context when we receive it (necessary for the X-Ray merging logic)ExtractTraceContext
method toContextWithTraceContext
to better reflect what it does (it adds the trace context to the context object)Motivation
Customers want to instrument Go Lambda functions for use with Datadog APM.
Testing Guidelines
Integration tests and manual testing.
Types of changes
Checklist