All Projects → aws → amazon-ecs-shim-loggers-for-containerd

aws / amazon-ecs-shim-loggers-for-containerd

Licence: Apache-2.0 license
Logger shim repository for streaming container logs when using Containerd

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to amazon-ecs-shim-loggers-for-containerd

MPContribs
Platform for materials scientists to contribute and disseminate their materials data through Materials Project
Stars: ✭ 30 (-14.29%)
Mutual labels:  fargate
aws-ecs-orb
An orb that simplifies deployment to Amazon's Elastic Container Service (ECS). Supports both EC2 and Fargate launch types.
Stars: ✭ 48 (+37.14%)
Mutual labels:  fargate
cdk-github-actions-runner
Deploy self-hosted GitHub Actions runner to AWS Fargate using AWS Cloud Development Kit (CDK)
Stars: ✭ 89 (+154.29%)
Mutual labels:  fargate
http-api-aws-fargate-cdk
Build HTTP API Based Services using Amazon API Gateway, AWS PrivateLink, AWS Fargate and AWS CDK
Stars: ✭ 5 (-85.71%)
Mutual labels:  fargate
ecs-container-exporter
AWS ECS side car that exports ECS container level docker stats metrics to Prometheus as well as publish it via Statsd.
Stars: ✭ 22 (-37.14%)
Mutual labels:  fargate
guestbook
A simple app with automated infrastructure provisioning, app deployment, and E2E testing
Stars: ✭ 25 (-28.57%)
Mutual labels:  fargate
Containerd
An open and reliable container runtime
Stars: ✭ 9,956 (+28345.71%)
Mutual labels:  containerd
fluentbit-containerd-cri-o-json-log
Parsing CRI JSON logs with Fluent Bit - applies to fluentbit, kubernetes, containerd and cri-o
Stars: ✭ 58 (+65.71%)
Mutual labels:  containerd
on-demand
CloudFormation resources for scheduling On-Demand Buildkite Agents with AWS ECS and AWS Fargate
Stars: ✭ 19 (-45.71%)
Mutual labels:  fargate
workshop-serverless-graphql
[AWSKRUG Serverless Group 2019] Serverless GraphQL Workshop
Stars: ✭ 80 (+128.57%)
Mutual labels:  fargate
missing-container-metrics
Prometheus exporter for container metrics cAdvisor won't give you
Stars: ✭ 143 (+308.57%)
Mutual labels:  containerd
terraform-aws-fargate
Terraform module to provision a Fargate-ready AWS infrastructure 🚀
Stars: ✭ 77 (+120%)
Mutual labels:  fargate
ansible-role-containerd
Ansible Role - containerd.io
Stars: ✭ 45 (+28.57%)
Mutual labels:  containerd
terraform-aws-eks-fargate-cluster
Source code of my AWS EKS with fargate cluster setup
Stars: ✭ 26 (-25.71%)
Mutual labels:  fargate
aws-eks-accelerator-for-terraform
Configure and deploy complete EKS clusters.
Stars: ✭ 1,220 (+3385.71%)
Mutual labels:  fargate
Talos
Talos is a modern OS for Kubernetes.
Stars: ✭ 2,390 (+6728.57%)
Mutual labels:  containerd
terraform-fargate-tutorial
A minimal set of Terraform to create a Fargate service
Stars: ✭ 32 (-8.57%)
Mutual labels:  fargate
ecs-taskmetadata-cloudwatch
An example sidecar container for Amazon ECS and AWS Fargate to enable task/container-level metrics on CloudWatch
Stars: ✭ 17 (-51.43%)
Mutual labels:  fargate
container-demo
How can I manage microservices using ecs-cli?
Stars: ✭ 30 (-14.29%)
Mutual labels:  fargate
ddd-practitioners-ref
EventStorming workshop, this is a hands-on workshop. Contains such topics: DDD, Event storming, Specification by example. Including the AWS product : Serverless Lambda , DynamoDB, Fargate, CloudWatch.
Stars: ✭ 276 (+688.57%)
Mutual labels:  fargate

Amazon ECS shim loggers for containerd

Amazon ECS shim loggers for containerd is a collection of containerd compatible logger implementations that send container logs to various destinations. The following destinations are currently supported:

Build

Make sure you have golang installed. Then simply run make build to build the respective binaries. You might need to execute make get-deps to install some of the dependencies.

Usage

Containerd supports shim plugins that redirect container output to a custom binary on Linux using STDIO URIs with runc v2 runtime. These loggers can be used either programmatically or with the ctr tool.

When using the NewTask API

When using the NewTask API to start a container, simply provide the path to the built binary file shim-loggers-for-containerd and required arguments. Note it's a good practice to clean up container resources with Delete API call after container exited as the container IO pipes are not closed if the shim process is still running.

Example:

NewTask(context, cio.BinaryIO("/usr/bin/shim-loggers-for-containerd", args))

When using the ctr tool

When using ctr tool to run a container, provide the URI path to the binary file shim-loggers-for-containerd and required arguments as part of the path.

Example:

ctr run \
    --runtime io.containerd.runc.v2 \
    --log-uri "binary:///usr/bin/shim-loggers-for-containerd?--log-driver=awslogs&--arg1=value1&-args2=value2" \
    docker.io/library/redis:alpine \
    redis

Arguments

Common arguments

The following list of arguments apply to all of the shim logger binaries in this repo:

Name Required Description
log-driver Yes The name of the shim logger. Can be any of awslogs, splunk or fluentd.
container-id Yes The container id
container-name Yes The name of the container
mode No Either blocking or non-blocking. In the non-blocking mode, log events are buffered and the application continues to execute even if these logs can't be drained or sent to the destination. Logs could also be lost when the buffer is full.
max-buffer-size No Only supported in non-blocking mode. Set to 1m (1MiB) by default. Example values: 200, 4k, 1m etc.
uid No Set a custom uid for the shim logger process. 0 is not supported.
gid No Set a custom gid for the shim logger process. 0 is not supported.
cleanup-time No Set a custom time for the shim logger process clean up itself. Set to 5s (5 seconds) by default. Note the maximum supported value is 12 seconds, since containerd shim sets shim logger cleanup timeout value as 12 seconds. See reference.
container-image-id No The container image id. This is part of the docker config variables that can be logged by splunk log driver.
container-image-name No The container image name. This is part of the docker config variables that can be logged by splunk log driver.
container-env No The container environment variables map in json format. This is part of the docker config variables that can be logged by splunk log driver.
container-labels No The container labels map in json format. This is part of the docker config variables that can be logged by splunk log driver.

Windows specific arguments

The following list of arguments apply to Windows shim logger binaries in this repo:

Name Required Description
log-file-dir No Only supported in Windows. Will be the path where shim logger's log files are written. By default it is \ProgramData\Amazon\ECS\log\shim-logger
proxy-variable No Only supported in Windows. The proxy variable will set the HTTP_PROXY and HTTPS_PROXY environment variables.

Additional log driver options

Amazon CloudWatch Logs

The following additional arguments are supported for the awslogs shim logger binary, which can be used to send container logs to Amazon CloudWatch Logs.

Name Required Description
awslogs-group Yes The log group in which the log stream for the container will be created.
awslogs-stream Yes The log stream name to stream container logs to.
awslogs-region Yes The region name in which the log group and log stream needs to be created in.
awslogs-credentials-endpoint Yes The endpoint from which credentials are retrieved from to connect to Amazon CloudWatch Logs.
awslogs-create-group No Set to false by default. If the provided log group name does not exist and this value is set to false, the binary will directly exit with an error
awslogs-create-stream No Set to true by default. The log stream will always be created unless this value specified to false explicitly.
awslogs-multiline-pattern No Matches the behavior of the awslogs Docker log driver.
awslogs-datetime-format No Matches the behavior of the awslogs Docker log driver

Splunk

The following additional arguments are supported for the splunk shim logger binary, which can be used to send container logs to splunk. You can find a description of what these parameters are used for here.

Name Required
splunk-token Yes
splunk-url Yes
splunk-source No
splunk-sourcetype No
splunk-index No
splunk-capath No
splunk-caname No
splunk-insecureskipverify No
splunk-format No
splunk-verify-connection No
splunk-gzip No
splunk-gzip-level No
splunk-tag No
labels No
env No
env-regex No

Fluentd

The following additional arguments are supported for the fluentd shim logger binary, which can be used to send container logs to Fluentd. Note that all of these are optional arguments.

  • fluentd-address: The address of the Fluentd server to connect to. By default, the localhost:24224 address is used.
  • fluentd-async-connect: Specifies if the logger connects to Fluentd in background. Defaults to false.
  • fluentd-sub-second-precision: Generates logs in nanoseconds. Defaults to true. Note that this is in contrast to the default behaviour of fluentd log driver where it defaults to false.
  • fluentd-buffer-limit: Sets the number of events buffered on the memory. Defaults to 1MB.
  • fluentd-tag: Specifies the tag used for log messages. Defaults to the first 12 characters of container ID.

License

This project is licensed under the Apache-2.0 License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].