Skip to content

feat: Configurable OTEL layer with architecture and version support (BREAKING)#26

Merged
ncipollina merged 1 commit intomainfrom
feature/configurable-otel-layer-v2
Aug 6, 2025
Merged

feat: Configurable OTEL layer with architecture and version support (BREAKING)#26
ncipollina merged 1 commit intomainfrom
feature/configurable-otel-layer-v2

Conversation

@ncipollina
Copy link
Contributor

Summary

  • Add configurable OpenTelemetry layer with architecture and version support
  • BREAKING CHANGE: OTEL layer now disabled by default (was enabled by default in v1.x)
  • Bump version to 2.0.0-beta for breaking changes

Breaking Changes

  • IncludeOtelLayer default changed from true to false
  • Added new properties: Architecture (default: "amd64") and OtelLayerVersion (default: "0-117-0")

New Features

  • Configurable OTEL layer architecture (amd64/arm64)
  • Configurable OTEL layer version (future-proof for AWS updates)
  • Dynamic OTEL layer ARN format: arn:aws:lambda:{region}:901920570463:layer:aws-otel-collector-{architecture}-ver-{version}:1

Migration Guide

For users upgrading from v1.x who want to keep OTEL enabled:

var props = new LambdaFunctionConstructProps
{
    // ... existing properties
    IncludeOtelLayer = true,           // Explicitly enable (was default in v1.x)
    Architecture = "arm64",            // Optional: specify architecture
    OtelLayerVersion = "0-117-0"       // Optional: specify version
};

Documentation Updates

  • Updated CLAUDE.md with new OTEL configuration section
  • Updated README.md examples
  • Updated docs/constructs/lambda-function.md with breaking change warnings
  • Added migration examples

Test Updates

  • Updated all test attributes and customizations to use new defaults
  • Updated test patterns to expect new OTEL layer ARN format
  • All 151 tests passing

Benefits

  • Future-proof: No more package updates when AWS releases new OTEL versions
  • Architecture flexibility: Support for both amd64 and arm64
  • Cost control: OTEL layer now opt-in, reducing unnecessary costs
  • Backward compatibility: Existing code works with explicit configuration

Test plan

  • All existing tests pass (151/151)
  • Build succeeds without warnings
  • New properties work correctly in tests
  • Documentation is comprehensive and accurate
  • Manual testing of new OTEL configuration
  • Verify ARM64 architecture support works

🤖 Generated with Claude Code

…BREAKING)

BREAKING CHANGES:
- OpenTelemetry layer is now disabled by default (was enabled by default)
- Added new required properties: Architecture and OtelLayerVersion

Features:
- Add Architecture property with default "amd64" (supports arm64)
- Add OtelLayerVersion property with default "0-117-0" (latest version)
- Support configurable OTEL layer ARN format with architecture and version
- Update all tests to reflect new defaults
- Update testing helpers and builders with new properties

Documentation:
- Update CLAUDE.md, README.md, and docs/constructs/lambda-function.md
- Add migration guide and breaking change warnings
- Add examples showing new OTEL configuration

Version:
- Bump version to 2.0.0-beta for breaking changes
- Update CDK dependency to 2.209.1

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ncipollina ncipollina requested a review from Copilot August 6, 2025 17:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces configurable OpenTelemetry (OTEL) layer support with architecture and version flexibility, while implementing breaking changes for version 2.0.0-beta. The OTEL layer is now disabled by default instead of enabled, providing better cost control and making observability features opt-in.

  • BREAKING: OTEL layer default changed from enabled to disabled
  • Added configurable OTEL layer version and architecture support (amd64/arm64)
  • Updated version to 2.0.0-beta and bumped AWS CDK dependency

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Directory.Build.props Version bump to 2.0.0-beta for breaking changes
src/LayeredCraft.Cdk.Constructs/LayeredCraft.Cdk.Constructs.csproj AWS CDK dependency update to 2.209.1
src/LayeredCraft.Cdk.Constructs/Models/LambdaFunctionConstructProps.cs Added new OTEL configuration properties with updated defaults
src/LayeredCraft.Cdk.Constructs/LambdaFunctionConstruct.cs Dynamic OTEL layer ARN generation using new configuration properties
src/LayeredCraft.Cdk.Constructs/Testing/LambdaFunctionConstructPropsBuilder.cs Builder pattern updates for new OTEL configuration options
test files Test framework updates to use new default values and validate new OTEL ARN format
documentation Updated docs with breaking change warnings and migration examples

Comment on lines +38 to +39
public bool EnableSnapStart { get; set; }
public bool GenerateUrl { get; set; }
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The default value assignment has been removed from these properties. Consider maintaining explicit default values for consistency with other properties in the class.

Suggested change
public bool EnableSnapStart { get; set; }
public bool GenerateUrl { get; set; }
public bool EnableSnapStart { get; set; } = false;
public bool GenerateUrl { get; set; } = false;

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +39
public bool EnableSnapStart { get; set; }
public bool GenerateUrl { get; set; }
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The default value assignment has been removed from these properties. Consider maintaining explicit default values for consistency with other properties in the class.

Suggested change
public bool EnableSnapStart { get; set; }
public bool GenerateUrl { get; set; }
public bool EnableSnapStart { get; set; } = false;
public bool GenerateUrl { get; set; } = false;

Copilot uses AI. Check for mistakes.
@ncipollina ncipollina merged commit 3ed0aae into main Aug 6, 2025
3 checks passed
@ncipollina ncipollina deleted the feature/configurable-otel-layer-v2 branch August 6, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments