Skip to content
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

Fix crash on linux #48

Merged
merged 1 commit into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/coretemp-exporter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WORKDIR /app/
COPY --chown=nonroot $BINARY_PATH /app/coretemp-exporter
COPY --chown=nonroot LICENSE /app/LICENSE

EXPOSE 80
EXPOSE 8181
ENTRYPOINT ["/app/coretemp-exporter"]

# Standardized Docker Image Labels
Expand Down
2 changes: 1 addition & 1 deletion cmd/coretemp-exporter/Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ COPY build/bin/windows_amd64/coretemp-exporter.exe /app/coretemp-exporter.exe
COPY LICENSE /app/LICENSE

USER ContainerUser
EXPOSE 80
EXPOSE 8181
ENTRYPOINT ["/app/coretemp-exporter.exe"]

# Standardized Docker Image Labels
Expand Down
9 changes: 7 additions & 2 deletions cmd/coretemp-exporter/coretemp-exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

var (
endpoint = flag.String("endpoint", ":8081", "Endpoint to serve metrics via HTTP.")
endpoint = flag.String("endpoint", ":8181", "Endpoint to serve metrics via HTTP.")
interval = flag.Duration("interval", time.Second, "Polling interval for temperature information")
logFile = flag.String("log", "", "ndjson (newline delimited json) log file")
console = flag.Bool("console", true, "Indicates that records should be printed to console.")
Expand All @@ -39,11 +39,16 @@ func init() {
func main() {
flag.Parse()

svcCmd := ""
if svc != nil {
svcCmd = *svc
}

internal.Run(&internal.Args{
Endpoint: *endpoint,
Interval: *interval,
Log: *logFile,
Console: *console,
ServiceControlCommand: *svc,
ServiceControlCommand: svcCmd,
})
}
8 changes: 8 additions & 0 deletions install/compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ services:
environment:
- METRICS_STORAGE_TYPE=prometheus
- PROMETHEUS_SERVER_URL=http://prometheus:9090
coretemp-exporter:
image: ghcr.io/jeremyje/coretemp-exporter:v0.5.1
hostname: coretemp-exporter
restart: always
networks:
- coretemp-net
ports:
- 8181:8181
volumes:
prom_data:
networks:
Expand Down
3 changes: 2 additions & 1 deletion install/compose/prometheus/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ scrape_configs:
scheme: http
static_configs:
- targets:
- host.docker.internal:8080
- host.docker.internal:8181
- coretemp-exporter:8181