Skip to content

Commit

Permalink
Rename project to gcp-idleness-exporter (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
7onn authored May 1, 2022
1 parent 6ec833b commit fa38de8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
USERNAME: devbytom
PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERFILE: "Dockerfile"
IMAGE_NAME: "devbytom/gcp-idle-resources-metrics"
IMAGE_NAME: "devbytom/gcp-idleness-exporter"
TAG_NAME: ${{ github.sha }}
LATEST: "true"
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
USERNAME: devbytom
PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKERFILE: "Dockerfile"
IMAGE_NAME: "devbytom/gcp-idle-resources-metrics"
IMAGE_NAME: "devbytom/gcp-idleness-exporter"
TAG_NAME: ${{ github.ref }}
LATEST: "true"
2 changes: 1 addition & 1 deletion .promu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
go:
version: 1.18
repository:
path: github.com/7onn/gcp-idle-resources-metrics
path: github.com/7onn/gcp-idleness-exporter
build:
binaries:
- name: server
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gcp-idle-resources-metrics
# gcp-idleness-exporter
Identify unused resources at Google Cloud Platform through Prometheus' metrics


Expand Down Expand Up @@ -56,14 +56,14 @@ cp ~/.config/gcloud/application_default_credentials.json ./credentials.json

chmod 444 credentials.json

docker build -t gcp-idle-resources-metrics .
docker build -t gcp-idleness-exporter .

docker run -it --rm --network=host \
-v $(pwd)/credentials.json:/credentials.json \
-e GOOGLE_APPLICATION_CREDENTIALS=/credentials.json \
-e GCP_PROJECT_ID= \
-e GCP_REGIONS=us-east1,us-central1,southamerica-east1 \
gcp-idle-resources-metrics
gcp-idleness-exporter
```
Check the exported [metrics](http://localhost:5000/metrics).

Expand All @@ -77,10 +77,10 @@ helm search repo 7onn

Export its default values
```bash
helm show values 7onn/gcp-idle-resources-metrics > values.yaml
helm show values 7onn/gcp-idleness-exporter > values.yaml
```

Edit the values according to your needs then install the application
```bash
helm upgrade -i gcp-idle-resources-metrics --values values.yaml 7onn/gcp-idle-resources-metrics
helm upgrade -i gcp-idleness-exporter --values values.yaml 7onn/gcp-idleness-exporter
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/7onn/gcp-idle-resources-metrics
module github.com/7onn/gcp-idleness-exporter

go 1.18

Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"

"cloud.google.com/go/compute/metadata"
"github.com/7onn/gcp-idle-resources-metrics/collector"
"github.com/7onn/gcp-idleness-exporter/collector"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/promlog"
Expand Down Expand Up @@ -125,7 +125,7 @@ func main() {

promlogConfig := &promlog.Config{}
flag.AddFlags(kingpin.CommandLine, promlogConfig)
kingpin.Version(version.Print("gcp-idle-resources-metrics"))
kingpin.Version(version.Print("gcp-idleness-exporter"))
kingpin.CommandLine.UsageWriter(os.Stdout)
kingpin.HelpFlag.Short('h')
kingpin.Parse()
Expand All @@ -141,10 +141,10 @@ func main() {
if *disableDefaultCollectors {
collector.DisableDefaultCollectors()
}
level.Info(logger).Log("msg", "Starting gcp-idle-resources-metrics", "version", version.Info())
level.Info(logger).Log("msg", "Starting gcp-idleness-exporter", "version", version.Info())
level.Info(logger).Log("msg", "Build context", "build_context", version.BuildContext())
if user, err := user.Current(); err == nil && user.Uid == "0" {
level.Warn(logger).Log("msg", "gcp-idle-resources-metrics is running as root user. This exporter is designed to run as unpriviledged user, root is not required.")
level.Warn(logger).Log("msg", "gcp-idleness-exporter is running as root user. This exporter is designed to run as unpriviledged user, root is not required.")
}

// Detect Project ID
Expand Down

0 comments on commit fa38de8

Please sign in to comment.