Skip to content

Commit 5786a5c

Browse files
author
Uzziah Eyee
committed
Readme cleanup
1 parent e1e8ab0 commit 5786a5c

File tree

1 file changed

+33
-66
lines changed

1 file changed

+33
-66
lines changed

README.md

+33-66
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
# Horus
22

3-
A test project for learning microservices observability through: **centralized logging** and **distributed tracing**.
3+
A project for learning about microservices observability.
44

5-
## Requirements
5+
* Centralized Logging
6+
* Distributed Tracing
7+
8+
## Development Requirements
69

710
- Docker Compose v1.23.2
8-
- OSX or GNU/Linux operating system
11+
- OSX or GNU/Linux
912

1013
## Development Setup
1114

1215
1. Clone this repo and open the root folder in an IDE like *Visual Studio Code*.
1316

1417
2. For each microservice, rename `example.env` to `.env` and supply the needed secrets.
15-
> TODO: Is there a way to eliminate this friction?
18+
> TODO: Eliminate this friction.
1619
1720
3. Start all microservices in *development mode*.
1821

1922
docker-compose -f docker-compose.dev.yml \
2023
up -d --build
2124

22-
> Development mode is important for 2 reasons.
23-
> - Changes to a service's source files will automatically restart/rebuild the docker service to show the changes.
24-
> - You can attach a remote debugger from your IDE to the docker process for seemless debugging like placing breakpoints and watching variables.
25-
> - NOTE: When you edit a service's source files, the docker process will restart, severing your remote debugger connection. So, you'd need to reattach the debugger again.
26-
27-
4. Attach the IDE's debugger to the desired service. Follow these steps in Visual Studio Code: *shift+cmd+D > Select a debug configuration > F5*.
28-
> All Visual Studio Code debug configurations are stored in *.vscode/launch.json*. You can modify configs as you see fit.
25+
> In Development Mode
26+
>
27+
> - You can attach a remote debugger to a running service Docker for seemless debugging like placing breakpoints and watching variables.
28+
> - Changes to source files will automatically restart the corresponding docker service.
2929
30-
5. To view tracing information, access the Jaeger UI on http://localhost:16686
30+
4. Optionally, attach the IDE's debugger to a service as follows in Visual Studio Code: *shift+cmd+D > Select a debug configuration > F5*.
31+
> All vscode debug configurations are stored in *.vscode/launch.json*. You can modify configs as you see fit.
3132
32-
> In development, the tracing backend is a single service (*tracing-backend*) for simplicity, and traces are stored in-memory. However, in production, the tracing backend will setup as multiple services (running on multiple containers), and traces will be persisted in an external store like Elasticsearch.
33+
5. Visit http://localhost:16686 to view traces.
3334

3435
### Useful dev commands
3536

@@ -39,87 +40,53 @@ A test project for learning microservices observability through: **centralized l
3940
# stop all services
4041
docker-compose -f docker-compose.dev.yml down
4142

42-
# restart only all [or specific] service
43+
# restart all [or specific] service
4344
docker-compose -f docker-compose.dev.yml \
4445
up -d --no-deps --build [service-name]
4546

4647
# tail logs from all [or specific] service
4748
docker-compose -f docker-compose.dev.yml \
4849
logs -f [service-name]
50+
51+
# see how an image was built
52+
docker history <image-name>
4953

50-
## Production Setup
51-
52-
TODO
53-
54-
- Signup with an ELK SaaS provider like [Logz.io](logz.io) to obtain an authentication token. Then for each microservice, rename `example.env` to `.env` and supply the needed secrets.
55-
- Then log into your ELK SaaS and view your microservices logs.
56-
57-
## Project Documentation
54+
## Project Architecture
5855

59-
### System Architecture
56+
### Logging Infrastructure
6057

6158
![](docs/container-architecture.svg)
6259

63-
I wrote an accompanying [article](https://hackernoon.com/monitoring-containerized-microservices-with-a-centralized-logging-architecture-ba6771c1971a) explaining this architecture.
60+
Read this [article](https://hackernoon.com/monitoring-containerized-microservices-with-a-centralized-logging-architecture-ba6771c1971a) for more details.
6461

65-
## Notes
62+
### Tracing Infrastructure
6663

67-
- You can update a single service/container while the entire suite is running using the following command
64+
![Tracing Backend Architecture](docs/distributed-tracing/tracing-backend.svg)
6865

69-
docker-compose -f docker-compose.dev.yml \
70-
up -d --no-deps --build <service_name>
66+
Read this [article](#todo) for more details.
7167

72-
docker-compose -f docker-compose.prod.yml \
73-
up -d --no-deps --build <service_name>
68+
## Miscellaneous Notes
7469

75-
> `--build` recreates the container from its image/dockerfile and `--no-deps` ensures dependent services aren't affected.
70+
### TODO (Improvement Considerations)
7671

77-
- Some docker images on dockerhub don't list the dockerfile, so to figure out some information like which ports are exposed by default, you can run `docker history <image>`.
72+
- Research **jaeger-operator**
7873

79-
- TODO: research **jaeger-operator**
74+
- Name Duplication: The value of the `API_SERVER_ADDRESS` variable in *user-simulator/.env* depends on the service name `api-server` specified in *docker-compose.yml*. If we rename the service, we must also change the variable. Is there a way to make this DRY?
8075

81-
### Docker Networking
76+
- In the log-shipper container, I had to install a logz.io-specific plugin. Can't this step be eliminated since fluentd is capable of connecting to https endpoints without plugins?
8277

83-
By default each containerized process runs in an isolated network namespace. For inter-container communication, place them in the same network namespace...as seen in *docker-compose.yml*.
78+
- Use sub-second precision for fluentd timestamps (probably best to use nanoseconds.)
8479

8580
### Best practices
8681

8782
1. You can pass secrets for a microservice using the `env_file` attribute in *docker-compose.yml*.
8883
2. Microservices can communicate using their service names if they are in the same docker network.
8984

90-
### How do you debug an app running in a container (i.e breakpoints and watch variables etc.)?
91-
?
92-
- You can tail the logs from all services using `docker-compose [-f <file>] logs -f`.
93-
94-
### Improvement Considerations
95-
96-
1. **Name Duplication:** The value of the `API_SERVER_ADDRESS` variable in *user-simulator/.env* depends on the service name `api-server` specified in *docker-compose.yml*. If we rename the service, we must also change the variable. Is there a way to make this DRY?
97-
98-
2. In the log-shipper container, I had to install a logz.io-specific plugin. Can't this step be eliminated since fluentd is capable of connecting to https endpoints without plugins?
99-
100-
3. Use sub-second precision for fluentd timestamps (probably best to use nanoseconds.)
101-
102-
### Environment variables used by Jaeger components
103-
104-
1. [jaeger-client-node](https://github.com/jaegertracing/jaeger-client-node#environment-variables)
105-
106-
JAEGER_SERVICE_NAME
107-
JAEGER_SAMPLER_TYPE
108-
JAEGER_SAMPLER_PARAM
109-
JAEGER_AGENT_HOST
110-
JAEGER_AGENT_PORT
111-
JAEGER_ENDPOINT
112-
113-
2. Jaeger Agent
114-
TODO
115-
116-
3. Jaeger Collector (and a Storage Backend)
117-
TODO
85+
### Docker Networking
11886

119-
4. Jaeger Query Service and UI
120-
TODO
87+
By default each containerized process runs in an isolated network namespace. For inter-container communication, place them in the same network namespace.
12188

122-
## Some References
89+
### References
12390

12491
https://medium.com/lucjuggery/docker-in-development-with-nodemon-d500366e74df
12592
https://blog.risingstack.com/how-to-debug-a-node-js-app-in-a-docker-container/

0 commit comments

Comments
 (0)