-
Notifications
You must be signed in to change notification settings - Fork 280
Fluentd Logging System Part 1 #652
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
aa6e1db
Update Basic example README.md
rkooo567 f43fa27
Merge branch 'develop' into develop
simon-mo c43e313
Merge branch 'develop' into develop
simon-mo a05443a
Added a basic fluentd support
rkooo567 4525f96
Merge remote-tracking branch 'clipper/develop' into fluentd
rkooo567 d7bd73a
log_config option added
rkooo567 f0dae98
fluentd instance is now running
rkooo567 00c2d91
Now we can mount a fluentd conf file to a docker.
rkooo567 3b5b1ca
Changed pydocstring style
rkooo567 b255c4b
Cleaned up some styles
rkooo567 90d480a
Created an integration test
rkooo567 bb6a990
Cleaned up some part of code
rkooo567 09fc089
Refactor done
rkooo567 0418be7
Cleaning up. Refactoring tests to unittest style
rkooo567 dff44da
Merge branch 'develop' into fluentd
simon-mo 7bf1f1b
Fixed errors found in CI. 1. Added __init__.py in fluentd folder. 2. …
rkooo567 132baa7
Merge branch 'develop' into fluentd
simon-mo a0c8501
Fixed port duplicated error. Internal and external port setting was w…
rkooo567 0f5af00
Merge branch 'fluentd' of https://github.com/rkooo567/clipper into fl…
rkooo567 43cfb4b
Merge branch 'develop' into fluentd
simon-mo 80db695
Merge branch 'develop' into fluentd
simon-mo 3500eff
Merge branch 'develop' into fluentd
rkooo567 b546b16
Merge branch 'develop' into fluentd
rkooo567 18bef18
Changed is_valid_state logic
rkooo567 2d3657a
Merge branch 'fluentd' of https://github.com/rkooo567/clipper into fl…
rkooo567 d9cd323
Remove fluentd test to see if it happens due to the test
rkooo567 008d0ac
Clean some part of code and add some strings for prettifying test logs
rkooo567 9aec964
Test with only one broken test to see if parallelization is an issue
rkooo567 5c9f25f
It will probably fix the bug
rkooo567 2ea53ce
Added a submodule logging in setup.py to resolve import error
rkooo567 6f5673a
changed some code based on code review
rkooo567 0977ad5
Merge branch 'develop' into fluentd
rkooo567 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Clipper Logging with Fluentd | ||
|
|
||
| ## Log Centralization (Beta) | ||
| Clipper uses Fluentd (https://www.fluentd.org/) for centralizing logs from Docker containers within Clipper cluster. | ||
| It is currently a beta version. It only supports centralizing logs into Fluentd instance for now, but we will add various functinoalities | ||
| like monitoring and debugging on the top of it. Please create an issue if you want any functionality. | ||
| Also, please don't hesistate to contribute if you add any features. | ||
|
|
||
| ## How to guide | ||
| Firstly, when you define `DockerContainerManager`, you should set `use_centralized_log` parameter to be `True` | ||
|
|
||
| ```python | ||
| clipper_conn = ClipperConnection(DockerContainerManager(use_centralized_log=True)) | ||
| clipper_conn.start_clipper() | ||
| ``` | ||
|
|
||
| Once you start up the clipper cluster, you can check fluentd Docker container running. | ||
|
|
||
| ```bash | ||
| $docker ps | ||
| CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
| 170000ec75d7 default-cluster-simple-example:1 "/container/containe…" 11 seconds ago Up 10 seconds (healthy) simple-example_1-71538 | ||
| 5b533ff2fd3a prom/prometheus:v2.1.0 "/bin/prometheus --c…" 13 seconds ago Up 12 seconds 0.0.0.0:9090->9090/tcp metric_frontend-7206 | ||
| b71b557a0001 clipper/frontend-exporter:develop "python /usr/src/app…" 14 seconds ago Up 13 seconds query_frontend_exporter-55488 | ||
| bc8a7cc31754 clipper/query_frontend:develop "/clipper/release/sr…" 15 seconds ago Up 14 seconds 0.0.0.0:1337->1337/tcp, 0.0.0.0:7000->7000/tcp query_frontend-55488 | ||
| d04f33c654fd clipper/management_frontend:develop "/clipper/release/sr…" 15 seconds ago Up 15 seconds 0.0.0.0:1338->1338/tcp mgmt_frontend-60461 | ||
| 30103e84e2a1 redis:alpine "docker-entrypoint.s…" 16 seconds ago Up 15 seconds 0.0.0.0:30356->6379/tcp redis-82152 | ||
| b78c3242c3e7 fluent/fluentd:v1.3-debian-1 "tini -- /bin/entryp…" 17 seconds ago Up 16 seconds 5140/tcp, 0.0.0.0:24224->24224/tcp, 0.0.0.0:24224->24224/udp fluentd-51374 | ||
| ``` | ||
|
|
||
| You can see centralized logs from fluentd container's stdout. Type | ||
|
|
||
| ```bash | ||
| $docker logs <fluentd_container_id> | ||
| ``` | ||
|
|
||
| Currently, it just prints out huge amount of logs centralized. It is because this feature is in the beggining phase. | ||
| We will add persistent storage for logs and query feature in the upcoming version. | ||
|
|
||
| ## How to customize | ||
| Currently, we don't recommend customizing a logging feature or using it for production. It is immature and unstable. Some APIs can be drastically changed. | ||
| If you still want to use it, you can directly modify fluentd conf file. It is mounted in a temp folder which you can easily find through python interactive shell. | ||
|
|
||
| ```python | ||
| >>> # Make sure you already ran clipper_conn.clipper_conn.start_clipper() with DockerContainerManager(use_centralized_log=True). Also, it is the python shell. | ||
| >>> clipper_conn = ClipperConnection(DockerContainerManager(use_centralized_log=True)) | ||
| >>> clipper_conn.connect() | ||
| 19-03-21:10:36:58 INFO [clipper_admin.py:157] [default-cluster] Successfully connected to Clipper cluster at localhost:1337 | ||
| >>> cm = clipper_conn.cm | ||
| >>> cm.logging_system_instance.conf_path | ||
| # It will show you conf file path mounted on your local machine. | ||
| ``` |
Empty file.
8 changes: 8 additions & 0 deletions
8
clipper_admin/clipper_admin/docker/logging/clipper_fluentd.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <source> | ||
| @type forward | ||
| port 24224 | ||
| </source> | ||
|
|
||
| <match *> | ||
| @type stdout | ||
| </match> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change the logic of this part. I will make new clipper connection to turn on
use_log_centralizationflag if there is a fluentd instance running in a cluster regardless ofuse_log_centralizationflag of the currentDockerContainerManagerinstance. As you can see the current logic is that if the flag is different from the cluster context (meaning ifuse_centralizationis on but there's no fluentd instance), it will cause an error. I will change this to