Repository navigation
Trace, measure and log every invocation over OpenTelemetry - #38
Merged
Merged
Conversation
Each invocation runs inside the OpenTelemetry Lambda wrapper's span, and traces and metrics are flushed before the function returns. A TelemetryBehaviour gives every use case a span and two metrics, a command interceptor gives every SQL command a span, and Serilog sends its logs over OTLP as well as to the console when OTEL_EXPORTER_OTLP_ENDPOINT is set. Docker Compose adds an OpenTelemetry Collector and the Aspire dashboard beside the emulator.
Build Pipeline✅ Ready to merge. Every stage passed.
Commit |
Drop the database command interceptor until the EF Core instrumentation is stable, and drop the telemetry behaviour and its metrics, which repeated what the ASP.NET Core instrumentation already records. LoggingBehaviour now starts the use case span, so there's one timer and Application needs no package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every invocation now runs inside a span from the OpenTelemetry Lambda wrapper (
OpenTelemetry.Instrumentation.AWSLambda), with the use case beneath it, and traces and metrics are flushed before the function returns, because Lambda can freeze the environment the moment it does. Logs still go to the console as compact JSON for CloudWatch, and also leave over OTLP, with the traces and metrics, wheneverOTEL_EXPORTER_OTLP_ENDPOINTis set. Docker Compose adds an OpenTelemetry Collector and the Aspire dashboard beside the emulator, and the docs explain how to run a collector in AWS (the ADOT extension built into the image, since container images can't use layers, or a gateway).LoggingBehaviour, and EF Core's built-in meter).Startupwith the SDK builders, because the generated classes build two service providers from the same services andAddOpenTelemetry()would export everything twice. X-Ray context extraction is off, so Lambda's "not sampled" header can't switch tracing off. Runtime metrics andservice.versionon everything.otel-collector.yamlships in the template package.telemetryskill, with a Lambda section and a watch list.serilog,mediator,docker-and-compose,health-checks,optional-token-auth,configuration-and-environmentsandlambda-emulatorupdated.Type of change
Shared layers
Checklist
dotnet buildanddotnet testpass locally with no warnings..agents/skills.