cdk deploy.
New to this? AWS CDK is a tool for describing cloud infrastructure in a
programming language instead of a YAML template. If your team doesn’t use CDK,
you don’t need this section — use the CloudFormation instructions on
Instrument Lambda or
Instrument Fargate, or let
Odigos apply instrumentation for you.
When you’d use this
Odigos can instrument your workloads two ways, and the CDK package is for the second one:
Pick self-managed when your infrastructure code should stay the single source of truth for what’s deployed.
Pick Odigos-managed when you’d rather not touch your infrastructure code at all. Full comparison:
Odigos-managed vs. self-managed instrumentation.
Install
TypeScript and JavaScript only, for now. A Python distribution
(
odigos-aws-cdk) is built but not yet published — it’s waiting on package-index
approval. Until it’s out, Python CDK apps should use the
CloudFormation instructions
instead.@odigos/aws-cdk@0.0.15
installs the OpenTelemetry layer and agents bundle built by Odigos release v0.0.15, and nothing resolves
or moves at deploy time. Upgrading is a deliberate npm update followed by a cdk diff that shows you
exactly what changes. An instrumentation agent that silently updated itself under a deployment that changed
nothing is not a property you want.
The two constructs
Lambda construct
Every option for instrumenting Lambda functions.
Fargate construct
Every option for instrumenting ECS Fargate services.
destination
options.
How Odigos recognizes your workload
Both constructs write an environment variable calledODIGOS_IAC onto everything they instrument. This
is the one thing that tells Odigos “this workload is instrumented, and here’s what with.”
The marker also records which version of instrumentation you deployed — the layer ARN on Lambda, the
agents image on Fargate. That’s what lets you pin a version and have Odigos respect it, rather than
reporting your deliberately-pinned workload as out of date the day Odigos publishes something newer.
Turning on debug logging
boolean
default:"false"
Makes the OpenTelemetry agent log verbosely, which helps when telemetry isn’t arriving and you need to
see why. Available on both constructs.
Next steps
Destinations
Endpoint formats, credentials, and which signals to enable.
Lambda construct
Layer sources, web-server mode, Java handler interfaces.
Fargate construct
Languages, service naming, the agents image.