Skip to content

Commit bf18645

Browse files
authored
Update usage instructions
1 parent 0f4a6f2 commit bf18645

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

README.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@ Used in https://github.com/PacktPublishing/Mastering-Distributed-Tracing/tree/ma
44

55
Published on Docker Hub: https://hub.docker.com/r/yurishkuro/microsim/tags
66

7+
## Usage
8+
9+
To see all command line options:
10+
11+
```shell
12+
docker run yurishkuro/microsim -h
13+
```
14+
15+
`microsim` uses OpenTelemetry SDK to export traces. By default it will try to send them to `https://localhost:4318/v1/traces` (with TLS enabled). This can be changed by setting environment variables supported by the SDK:
16+
* `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` to point to a different host/port/endpoint.
17+
* `OTEL_EXPORTER_OTLP_ENDPOINT` to point to a different host/port (will still use default `/v1/traces` endpoint).
18+
* `OTEL_EXPORTER_OTLP_INSECURE=true` if you just want to switch default URL to `http` instead of `https`.
19+
20+
Note that when we run `microsim` as a container, the `localhost` refers to the container's inner network namespace, so it will not be able to reach the collector even if it's running on the same host. You might see an error like this:
21+
22+
```
23+
2024/07/02 18:06:07 traces export: Post "https://localhost:4318/v1/traces": dial tcp [::1]:4318: connect: connection refused
24+
```
25+
26+
To work around that, refer to the IP address of the host instead:
27+
28+
```shell
29+
docker run --env OTEL_EXPORTER_OTLP_ENDPOINT=http://{YOUR_IP_ADDRESS}:4318/ \
30+
yurishkuro/microsim -w=1 -r=1
31+
```
32+
733
## Design
834

935
The tool takes a configuration file that describes the "architecture" of your desired system, such as services,
@@ -31,31 +57,6 @@ docker run yurishkuro/microsim -o | jq
3157

3258
![UML diagram of configuration](model/uml-diagram.png)
3359

34-
## Usage
35-
36-
To see all command line options:
37-
38-
```shell
39-
docker run yurishkuro/microsim -h
40-
```
41-
42-
`microsim` uses OpenTelemetry SDK to export traces. By default it will try to send them to `https://localhost:4318/v1/traces` (with TLS enabled). This can be changed by setting environment variables supported by the SDK:
43-
* `OTEL_EXPORTER_OTLP_ENDPOINT` to point to a different host/port.
44-
* `OTEL_EXPORTER_OTLP_INSECURE=true` if you just want to switch default URL to `http` instead of `https`.
45-
46-
Note that when we run `microsim` as a container, the `localhost` refers to the container's inner network namespace, so it will not be able to reach the collector even if it's running on the same host. You might see an error like this:
47-
48-
```
49-
2024/07/02 18:06:07 traces export: Post "https://localhost:4318/v1/traces": dial tcp [::1]:4318: connect: connection refused
50-
```
51-
52-
To work around that, refer to the IP address of the host instead:
53-
54-
```shell
55-
docker run --env OTEL_EXPORTER_OTLP_ENDPOINT=https://{YOUR_IP_ADDRESS}:4318/v1/traces \
56-
yurishkuro/microsim -w=1 -r=1
57-
```
58-
5960
## License
6061

6162
MIT license.

0 commit comments

Comments
 (0)