Comments (35)
@nletourneau While #123 is necessary and takes priority over this issue, I'd be using the Syslog driver to send my logs to CloudWatch Logs anyway. What I'd be interested in is being able to bypass the middleman and have a CloudWatch Logs driver that does direct and declare something like:
docker run --log-driver=cloudwatch myapp/foo
from amazon-ecs-agent.
I've removed my vote and exchange it for a 👎. My reasons for that are:
- there is an
awslogs
Docker logs driver (see https://docs.docker.com/engine/admin/logging/awslogs/) - the ECS agent itself should not need to care about container logs because this would violate separation of concerns. If the question would be "should AWS extend ECS and somehow collect Docker logs from ECS cluster instances?", my answer would be: yes please, but maybe rather with another tool 😄
from amazon-ecs-agent.
+1 on this feature.
from amazon-ecs-agent.
+1!
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
and/or syslog driver then you can just syslog -> {loggly, papertrail, *}
from amazon-ecs-agent.
Docker 1.6 added pluggable drivers, it would be interesting if there could be a CloudWatch Logs driver in addition to the existing Console and Syslog drivers
from amazon-ecs-agent.
#123 is a bit more concise and would use the built in docker features instead of something amazon specific.
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
I've written an experimental logging driver for Amazon CloudWatch Logs and sent a pull request to the Docker project: moby/moby#15495.
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
👍 Nice work @samuelkarp . It's probably better to have this be a part of Docker core instead.
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
@samuelkarp Hey there - I have tried out your new driver, using today's docker-1.9.0-dev build. It seems to work for the most part, great job!
I do see an occasional error from my daemon:
ERRO[1839] Failed to put log events errorCode=InvalidSequenceTokenException logGroupName=awslogs logStreamName=apps message=The given sequenceToken is invalid. The next expected sequenceToken is: 49540112654804690997104352997714685391863631165190586194 origError=<nil>
INFO[2031] GET /v1.17/version
ERRO[2033] Failed to put log events errorCode=InvalidSequenceTokenException logGroupName=awslogs logStreamName=apps message=The given sequenceToken is invalid. The next expected sequenceToken is: 49540112654804690997104353009076170244601927144195506002 origError=<nil>
There's a bunch of these in my docker daemon output.. Not sure what this means though, any ideas??
from amazon-ecs-agent.
@IPvFletch Can you open a separate issue for troubleshooting the new logging driver? I'd like to see how you're running the containers (specific log-opt
arguments you're passing to the daemon and docker run
).
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
👍
from amazon-ecs-agent.
👍
from amazon-ecs-agent.
👍
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
👍
from amazon-ecs-agent.
+1
from amazon-ecs-agent.
Maybe... but it would like to have an awslogs option in ecs, like i have a
fluentd, syslog, etc
2016-03-11 5:24 GMT-03:00 Paul Seiffert [email protected]:
I've removed my vote and exchange it for a [image: 👎]. My reasons for
that are:
- there is an awslogs Docker logs driver (see
https://docs.docker.com/engine/admin/logging/awslogs/)- the ECS agent itself should not need to care about container logs
because this would violate separation of concerns. If the question would be
"should AWS extend ECS and somehow collect Docker logs from ECS cluster
instances?", my answer would be: yes please, but maybe rather with another
tool [image: 😄]—
Reply to this email directly or view it on GitHub
#9 (comment).
from amazon-ecs-agent.
@seiffert a few points on that:
- awslogs have a [fixed rate limit](The maximum rate of a PutLogEvents request is 5 requests per second per log stream. The maximum batch size of a PutLogEvents request is 1MB.) that can cause problems with container output. Secondly, the logs are stored in cloudwatch logs under that container id.
- As far as I can tell there is no way short of access to the ecs introspection api to match an ECS job id to a container id.
A key part of the docker experience is being able to get streaming output from containers, IMO. Especially for one-off tasks, this is critical. Our particular use case is continuous deployment and applying database migrations. There are ways to work around this, but it's annoying, and divergent from the rest of the docker ecosystem.
For those that need something workable now, checkout https://github.com/Signiant/logspout-ecs
from amazon-ecs-agent.
@lox you're completely right, gathering logs is extremely important. My argument was just that the ECS agent is the wrong place to implement this logic.
Docker has a plugin-system for logging drivers. In our setup, we're using a software called dockerlogstream that receives logs from the fluentd logging driver. In the dockerlogstream configuration, we're parsing the container name and add it as metadata to the log lines. (The difference to your setup is that we're streaming logs to Papertrail)
First, we used logspout as well. However, we encountered a couple of problems with the stability of logspout. Maybe, this issues have been fixed by now, I don't know.
from amazon-ecs-agent.
The awslogs
driver is supported with our 1.9.0 release and lets you send container output to CloudWatch Logs. Please see the documentation for details on how to use it.
from amazon-ecs-agent.
@samuelkarp - Is it possible to override the awslogs-group
in a one-off invocation of an ECS task?
from amazon-ecs-agent.
@gregeinfrank It's not currently possible to override log options through the RunTask
or StartTask
API.
from amazon-ecs-agent.
Related Issues (20)
- [Question] Support for custom CNI plugins HOT 1
- CgroupError: Agent could not create task's platform resources HOT 2
- Deployment doesn't cover all tasks.
- Deployment doesn't cover all tasks. HOT 1
- Tasks failing to start on ECS-optimized Amazon Linux 2023 ARM64 HOT 3
- ECS Agent not Releasing EFS Client Connections HOT 9
- [ECS EC2] ECS Agent reachable from Linux containers but not from Windows containers HOT 3
- Bring back task accounting changes? HOT 2
- EFS mount noac and other attributes override HOT 1
- tls cipher suite error after ecs-agent start
- Support for alternative docker runtimes
- Incompatible with Docker v25 (API 1.44) HOT 4
- The CPU parameter in the task is not behaving as a hard limit and is not setting either cpu-quota or cpu HOT 2
- Support cgroupns Docker flag
- ECS agent disconnects instances but autoscalling not working properly after that HOT 4
- It seems impossible to define default cgroups settings for tasks HOT 1
- [ECS Anywhere] Latest ecs-agent/ecs-init breaks compatibility, EBS mount error, v1.78.0 - v1.81.0 HOT 3
- Upgrade minimum docker client api to 1.24 to maintain compatibility with upcoming docker engine v26 release HOT 3
- Task Health Status wrongly reported as HEALTHY HOT 1
- Update not supported on ARM architecture HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-ecs-agent.