Skip to content

Commit 2608d17

Browse files
committed
Doc
Add readme and json format of container
1 parent 2f2d0e3 commit 2608d17

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# sysdig-monitor
2+
3+
sysdig-monitor uses [sysdig](https://github.com/draios/sysdig) to track container events and exports information about running containers(file system, network, system call)
4+
5+
## Install
6+
7+
Before using this tool, you have to [install sysdig](https://github.com/draios/sysdig/wiki/How-to-Install-Sysdig-for-Linux) first.
8+
9+
To use sysdig-monitor, you can just build it from source:
10+
```
11+
go build -mod vendor
12+
```
13+
Or you can download from release page.
14+
15+
## Usage
16+
17+
Use `./sysdig-monitor` to start the monitor, now sysdig-monitor is running on **http://localhost:port**, or use can use `--port` flag to set another port.
18+
19+
Now you can start some containers on your host as you wish.
20+
21+
To list all containers running on the host, you can visit **localhost:port/container/** (not **localhost:port/container**) in your web browser, or use `curl` to fetch the result. The result will be in json format as below
22+
```json
23+
{
24+
container-id: name,
25+
...
26+
}
27+
```
28+
29+
To get all the information about a container, visit **localhost:port/container/:id** in your web browser or use `curl localhost:port/container/:id | jq` to get a more user-friendly result. The result will be in json format. Visit [here](/docs/format.md) to read about the format.
30+
31+
API **localhost:port/metrics** is also available, which exports some useful metrics in promethuse-style

docs/format.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# container status json format
2+
3+
```json
4+
{
5+
"id": id, //container id
6+
"name": name, //container name
7+
"individual_calls": { //different types of system call
8+
"name1": {
9+
"calls": 123, // total invoke times
10+
"total_time" : 456 // total latency in nanoseconds
11+
},
12+
...
13+
},
14+
"total_calls": 123, // total system calls
15+
"io_calls_more_than_1ms": [
16+
{
17+
"file_name": "/home/test.txt",
18+
"latency": 123 // also nanoseconds
19+
}
20+
...
21+
],
22+
"io_calls_more_than_10ms":[],
23+
"io_calls_more_than_100ms":[],
24+
"file_total_read_in": 222, //Total bytes the container read from file system
25+
"file_total_write_out": 222,
26+
"net_total_read_in": 333, //Total bytes the container read from network
27+
"net_total_write_out": 333,
28+
"active_connections": [
29+
{
30+
"source_ip": ,
31+
"dest_ip": ,
32+
"source_port": ,
33+
"dest_port": ,
34+
"type": "ipv4",
35+
"write_out": ,
36+
"read_in":
37+
},
38+
...
39+
],
40+
"accessed_layers": [
41+
{
42+
"dir": "/var/lib/docker/overlay2/40f635eb604ff721234ddd0c10433377dd487419b85a1ed0c292d697b01a64a7/diff",
43+
"accessed_files": {
44+
"/etc/bash.bashrc": {
45+
"write_out": ,
46+
"read_in":
47+
}
48+
...
49+
},
50+
"layer_write_out": ,
51+
"layer_read_in":
52+
}
53+
...
54+
]
55+
}
56+
```

0 commit comments

Comments
 (0)