amazon web services - setSegment unexpected error TypeError: segment.resolveLambdaTraceData is not a function -
i trying change trace-id tell me if i'm taking wrong approach. i'm thinking of create segment, , add parent-id trace_id want 1 trace can follow trace. reason i'm trying because asynchronous parts of aws such kinesis streams not supported in aws x-ray.
const segment = new awsxray.segment('1-11111111-111111111111111111111111', '1-11111111-111111111111111111111111', '1-11111111-111111111111111111111111') console.log(segment) awsxray.setsegment(segment)
however, error:
typeerror: segment.resolvelambdatracedata not function
any ideas why i'm getting error, or how can connect 2 events happened before , after kinesis stream connecting trace_ids?
when x-ray sdk used in lambda, lambda creates it's own segment (and sends out of band of lambda function code) , sdk creates "facade" on context placeholder given parent id , id of segment lambda created (exposed via process.env._x_amzn_trace_id). sdk creates subsegments attached facade segment, , when lambda function concludes, these subsegments sent , service pieces together. each time lambda function fires, , wasn't cold start, facade segment refreshes new parent id , id supplied lambda (with call resolvelambdatracedata). sdk not expect user created segment in lambda set on context. manually created segment, resolvelambdatracedata function not available, hence error, , when set on context, fires automatically when detects separate lambda execution.
can go more detail use-case?
Comments
Post a Comment