Closed pokryfka closed 3 years ago
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
CC @ktoso @slashmo
@swift-server-bot add to whitelist
Awesome 👏 😎 Will give it a look :-)
@ktoso
Awesome 👏 😎 Will give it a look :-)
I have been using it for a week, obviously its PoC state, but I think PR may be a good way to discuss how it could be integrated including context propagation (note that Lambda defines its own Context
which I used to pass the "context baggage" BaggageContext
hmm...)
Attributes aside, I think it would be great to be able to share EventLoop
to send UDP;
something XRayRecorder
does support but is currently not exposed by Lambda
, InstrumentationSystem
(bootstrap
) and TracingInstrument
(forceFlush
)
14:23:44 Precondition failed: client not stopped before the deinit.: file /code/.build/checkouts/aws-xray-sdk-swift/Sources/AWSXRayUDPEmitter/UDPClient.swift, line 71
this breaks the tests at the moment, I was hoping ServiceLifecycle
support will get merged https://github.com/swift-server/swift-aws-lambda-runtime/pull/141
Nice @pokryfka, thanks for taking the initiative! 🎉
thanks @pokryfka tagged this as RFC/draft for discussion
(note that Lambda defines its own Context which I used to pass the "context baggage" BaggageContext hmm...)
Yeah, that's as-intended 👍
The lambda context should conform to LoggingBaggageContextCarrier as well (open to shorter /better names btw, could not think of a better one so far for this protocol 🤔 ).
hi @pokryfka if you want to keep this around, could you please update this PR to be against the main
branch so we can delete the old master
branch
PoC instrumentation of the lambda handler.
Motivation:
Add support for instrumentation.
Modifications:
AWSXRayRecorder
) - needs to be configurableTracingInstrument
and (context) baggageBaggageContext
inLambda.Context
TODO
swift-tracing
instead ofaws-xray-sdk-swift
to limit dependenciesTracingInstrument
APILambda
bootstrap to be able to use the sameEventLoop
in an instance ofXRayUDPEmitter
Result:
Example in X-Ray console of handling a simple HelloWorld, cold start, Foundation JSON encoder/decoder.