Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing logs when main containers exits immediately #856

Open
proof-nicholas opened this issue Sep 29, 2024 · 1 comment
Open

Missing logs when main containers exits immediately #856

proof-nicholas opened this issue Sep 29, 2024 · 1 comment

Comments

@proof-nicholas
Copy link

We are aws-fluent-bit to route the logs from our main container to Datadog. I was recently troubleshooting an issue where the ECS Fargate task was exiting due to one of its essential containers exiting but couldn't find any logs in Datadog indicating a failure. I then disabled fluent-bit logging so that the task logs go to CloudWatch. Then in the ECS Fargate console, when the the task exited, I was able to see the application log messages indicating the errors (required environment variables missing). I suspect the main container exited so fast that either fluent-bit did not receive the logs or did not ship them to Datadog before the task was terminated. How can I prevent this from happening?

Configuration

I am using AWS ECS Copilot Logging:

logging:
  image: 351603118025.dkr.ecr.us-east-2.amazonaws.com/aws-fluent-bit
  destination:
    Name: "datadog"
    Host: "http-intake.logs.datadoghq.com"
    compress: "gzip"
    dd_service: "my-service"
    dd_source: "my-service"
    dd_tags: "env:staging"
    TLS: "on"
    provider: "ecs"
  secretOptions:
    apiKey: XXXXXXX
  configFilePath: "/fluent-bit/configs/parse-json.conf"

Fluent Bit Version Info

7.57.2

Cluster Details

ECS Fargate with Fluent Bit deployed as a Sidecar with awsvpc networking.

@swapneils
Copy link
Contributor

Could you try the changes in Wesley's PR changing the Grace period behavior during shutdown (#829)? That might be what kept the logs from getting ingested.

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

No branches or pull requests

2 participants