Skip to content

Logs not forwarding from GitLab to CloudWatch #8176

Description

@dsotirho-ucsc

dev

Image

anvildev

Image

GitLab dev

From /opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log:

2026-07-08T00:19:38Z E! [outputs.cloudwatchlogs] InvalidParameterException: 1 validation error detected: Value at 'logGroupName' failed to satisfy constraint: Member must satisfy regular expression pattern: [\.\-_/#A-Za-z0-9]+, will not retry the request

It appears the CloudWatch agent isn't setup correctly on GitLab dev & anvildev, specifically in the agent's config the log_group_name fields contains a variable name instead of the actual value.

Compare GitLab dev's /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.toml:

    [[inputs.logfile.file_config]]
      deployment_environment = ""
      file_path = "/var/log/amazon/ssm/amazon-ssm-agent.log"
      from_beginning = true
      log_group_class = ""
      log_group_name = "${aws_cloudwatch_log_group.gitlab_cwagent.name}"
      log_stream_name = "/var/log/amazon/ssm/amazon-ssm-agent.log"
      pipe = false
      retention_in_days = -1
      service_name = ""

... to GitLab anvilprod's /opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.toml:

    [[inputs.logfile.file_config]]
      deployment_environment = ""
      file_path = "/var/log/amazon/ssm/amazon-ssm-agent.log"
      from_beginning = true
      log_group_class = ""
      log_group_name = "/aws/cwagent/azul-gitlab"
      log_stream_name = "/var/log/amazon/ssm/amazon-ssm-agent.log"
      pipe = false
      retention_in_days = -1
      service_name = ""

Metadata

Metadata

Assignees

Labels

compliance[subject] Information and software securitydemo[process] To be demonstrated at the end of the sprintinfra[subject] Project infrastructure like CI/CD, build and deployment scriptsspike:3[process] Spike estimate of three points

Type

Fields

No fields configured for Debt.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions