compose-x / ecs_composex

Manage, Configure and Deploy your services and AWS services and applications from your docker-compose definitions
https://docs.compose-x.io
Mozilla Public License 2.0
158 stars 16 forks source link

[BUG] x-logging.FireLens.Advanced.FirelensConfiguration.Options.enable-ecs-log-metadata: false does not work #709

Closed thorfi closed 7 months ago

thorfi commented 7 months ago

Describe the bug [BUG] x-logging.FireLens.Advanced.FirelensConfiguration.Options.enable-ecs-log-metadata: false does not work

To Reproduce Steps to reproduce the behavior:

  1. pip install
  2. executed as CLI tool
  3. Docker compose file
    services:
    foo:
    x-logging: # ecscomposex
      RetentionInDays: 1
      FireLens:
        Advanced:
          FirelensConfiguration:
            Options:
              enable-ecs-log-metadata: false
          ComposeXManagedAwsDestinations:
            - log_group_name: "foo/"
  4. Generated service.yml file has incorrect enable-ecs-log-metadata value
    Resources:
    ...
    EcsTaskDefinition:
    Properties:
      ContainerDefinitions:
        - ...
        - Command:
            Ref: AWS::NoValue
          Cpu: 102
          DependsOn:
            - Condition: SUCCESS
              ContainerName: log_router_preload
          DockerLabels:
            container_name: log_router
          ...
          FirelensConfiguration:
            Options:
              config-file-type: file
              config-file-value: /compose_x_rendered/firelens.conf
              enable-ecs-log-metadata: true
            Type: fluentbit

Expected behavior

service.yml enable-ecs-log-metadata setting should match the docker-compose.yml setting

Logs Not Applicable.

Desktop

JohnPreston commented 7 months ago

Thanks @thorfi You're on fire! This one sounds like an oversight

JohnPreston commented 7 months ago

EDIT: joking aside, I had so much forgotten about this parameter, I was recently looking into how to disable it :trollface:

JohnPreston commented 7 months ago

Okay, I have it working using your compose example

          FirelensConfiguration:
            Options:
              config-file-type: file
              config-file-value: /compose_x_rendered/firelens.conf
              enable-ecs-log-metadata: false
            Type: fluentbit
          HealthCheck:
            Command:
              - CMD-SHELL
              - 'echo ''{"health": "check"}'' | nc 127.0.0.1 8877 || exit 1'
            Interval: 10
            Retries: 3
            StartPeriod: 15
            Timeout: 5
          Image:
            Ref: FluentBitAwsImage
JohnPreston commented 7 months ago

@thorfi will wait for your feedback if you don't mind testing out from #711

JohnPreston commented 7 months ago

FYI @thorfi I published 0.23.27rc4 => give it a try, let me know Although I think that 0.23.27 will be out today

thorfi commented 6 months ago

Hey, I can confirm this is doing the right thing in the CF template. Thanks! :-)