-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/customize log and lift test coverage (#28)
* complete the structure of influxlog * add cache tests * refactor influx db writer
- Loading branch information
Showing
18 changed files
with
651 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,41 @@ | ||
{ | ||
order http_cache before reverse_proxy | ||
admin 0.0.0.0:7777 | ||
debug | ||
} | ||
|
||
:9991 { | ||
reverse_proxy { | ||
to localhost:9995 | ||
} | ||
|
||
http_cache { | ||
cache_type in_memory | ||
match_path / | ||
|
||
} | ||
|
||
log { | ||
output influxlog { | ||
addr http://localhost:8086 | ||
token "user:pass1234" | ||
organization "" | ||
bucket telegraf | ||
# For influxDB 1.8 the token should follow the rule below | ||
# https://github.com/influxdata/influxdb-client-go#influxdb-18-api-compatibility | ||
} | ||
level debug | ||
} | ||
|
||
|
||
} | ||
|
||
:9995 { | ||
header Cache-control "public" | ||
root * /tmp/caddy-benchmark | ||
file_server | ||
|
||
log { | ||
level info | ||
} | ||
} |
This file contains 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,88 @@ | ||
version: "3.7" | ||
|
||
services: | ||
influxdb: | ||
image: influxdb:1.8.1 | ||
volumes: | ||
- influxdb:/var/lib/influxdb | ||
- ./example/influxdb_monitor/influxdb.conf:/etc/influxdb/influxdb.conf | ||
environment: | ||
- INFLUXDB_ADMIN_USER=admin | ||
- INFLUXDB_ADMIN_PASSWORD=pass1234 | ||
- INFLUXDB_USER=user | ||
- INFLUXDB_USER_PASSWORD=pass1234 | ||
|
||
restart: always | ||
networks: | ||
- influxdata | ||
|
||
|
||
ports: | ||
- "8086:8086" | ||
- "8082:8082" | ||
|
||
# telegraf to collects the syslog | ||
telegraf: | ||
image: telegraf:1.15.1 | ||
environment: | ||
- HOSTNAME=songa-telegraf | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- ./example/influxdb_monitor/telegraf.conf:/etc/telegraf/telegraf.conf | ||
|
||
restart: always | ||
|
||
networks: | ||
- influxdata | ||
|
||
depends_on: | ||
- influxdb | ||
|
||
chronograf: | ||
image: chronograf:1.8.4 | ||
environment: | ||
- RESOURCES_PATH=/usr/share/chronograf/resources | ||
volumes: | ||
- chronograf:/var/lib/chronograf | ||
ports: | ||
- "8888:8888" | ||
|
||
restart: always | ||
|
||
networks: | ||
- influxdata | ||
|
||
depends_on: | ||
- influxdb | ||
- telegraf | ||
|
||
# in the future add the grafana log panel | ||
|
||
# cdp to write the log as syslog | ||
cdp: &cdp-source | ||
image: golang:1.14.2 | ||
container_name: cdp | ||
volumes: | ||
- cdp:/go/ | ||
- go-build-cache:/root/.cache/go-build | ||
- .:${PROJECT_PATH} | ||
|
||
command: > | ||
sh -c "echo 'spin up caddy proxy cache...' && | ||
cd ${PROJECT_PATH} && | ||
go run $PROJECT_PATH/cmd/main.go run --config example/influxdb_monitor/Caddyfile" | ||
ports: | ||
- "9991:9991" | ||
environment: | ||
- PROJECT_PATH=${PROJECT_PATH} | ||
|
||
|
||
volumes: | ||
cdp: | ||
go-build-cache: | ||
influxdb: | ||
chronograf: | ||
|
||
networks: | ||
influxdata: |
Oops, something went wrong.