Skip to content
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 .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- id: profiles
name: Determine test profiles
run: |
profiles=$(ls deploy/tests/cases | jq -R -s -c 'split("\n")[:-1]')
profiles=$(ls config/tests/cases | jq -R -s -c 'split("\n")[:-1]')
echo $profiles
echo "::set-output name=matrix::$profiles"

Expand Down
28 changes: 14 additions & 14 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project_name: mongodb-query-exporter

builds:
- id: cli
- id: main
main: cmd/main.go
binary: mongodb-query-exporter
goos:
Expand All @@ -12,10 +12,10 @@ builds:
- CGO_ENABLED=0

archives:
- id: cli
- id: main
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
builds:
- cli
- main

checksum:
name_template: 'checksums.txt'
Expand All @@ -35,11 +35,11 @@ sboms:

dockers:
- image_templates:
- ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-amd64
dockerfile: Dockerfile
use: buildx
ids:
- cli
- main
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.title={{ .ProjectName }}
Expand All @@ -51,12 +51,12 @@ dockers:
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=MIT
- image_templates:
- "ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-arm64v8"
- "ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-arm64v8"
goarch: arm64
dockerfile: Dockerfile
use: buildx
ids:
- cli
- main
build_flag_templates:
- --platform=linux/arm64/v8
- --label=org.opencontainers.image.title={{ .ProjectName }}
Expand All @@ -69,14 +69,14 @@ dockers:
- --label=org.opencontainers.image.licenses=MIT

docker_manifests:
- name_template: ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}
- name_template: ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}
image_templates:
- ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-arm64v8
- ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-amd64
- ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-arm64v8
- name_template: ghcr.io/raffis/{{ .ProjectName }}:latest
image_templates:
- ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-arm64v8
- ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-amd64
- ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-arm64v8

signs:
- cmd: cosign
Expand All @@ -96,9 +96,9 @@ docker_signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
artifacts: images
artifacts: all
output: true
args:
- 'sign'
- '${artifact}'
- --yes
- --yes
15 changes: 3 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,28 +81,19 @@ CLUSTER=kind
kind-test: ## Deploy including test
kind load docker-image ${IMG} --name ${CLUSTER}
kubectl --context kind-${CLUSTER} -n mongo-system delete pods --all
kustomize build deploy/tests/cases/${TEST_PROFILE} --enable-helm | kubectl --context kind-${CLUSTER} apply -f -
kustomize build config/tests/cases/${TEST_PROFILE} --enable-helm | kubectl --context kind-${CLUSTER} apply -f -
kubectl --context kind-${CLUSTER} -n mongo-system wait --for=jsonpath='{.status.conditions[1].reason}'=PodCompleted pods -l app.kubernetes.io/managed-by!=Helm -l verify=yes --timeout=3m
kustomize build deploy/tests/cases/${TEST_PROFILE} --enable-helm | kubectl --context kind-${CLUSTER} delete -f -
kustomize build config/tests/cases/${TEST_PROFILE} --enable-helm | kubectl --context kind-${CLUSTER} delete -f -

.PHONY: deploy
deploy:
cd deploy/exporter && $(KUSTOMIZE) edit set image ghcr.io/raffis/mongodb-query-exporter=${IMG}
$(KUSTOMIZE) build deploy/exporter | kubectl apply -f -
$(KUSTOMIZE) build config/base | kubectl apply -f -

.PHONY: undeploy
undeploy: ## Undeploy exporter from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy-test
deploy-test:
cd deploy/test && $(KUSTOMIZE) edit set image ghcr.io/raffis/mongodb-query-exporter=${IMG}
$(KUSTOMIZE) build deploy/test | kubectl apply -f -

.PHONY: undeploy-test
undeploy-test: ## Undeploy exporter from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/test | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: all style fmt build test vet

# go-install-tool will 'go install' any package $2 and install it to $1
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Prometheus MongoDB query exporter
[![release](https://github.com/raffis/mongodb-query-exporter/actions/workflows/release.yaml/badge.svg)](https://github.com/raffis/mongodb-query-exporter/actions/workflows/release.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/raffis/mongodb-query-exporter/v2)](https://goreportcard.com/report/github.com/raffis/mongodb-query-exporter/v2)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/raffis/mongodb-query-exporter/v2)](https://pkg.go.dev/github.com/raffis/mongodb-query-exporter/v2)
[![Go Report Card](https://goreportcard.com/badge/github.com/raffis/mongodb-query-exporter/v3)](https://goreportcard.com/report/github.com/raffis/mongodb-query-exporter/v3)
[![Coverage Status](https://coveralls.io/repos/github/raffis/mongodb-query-exporter/badge.svg?branch=master)](https://coveralls.io/github/raffis/mongodb-query-exporter?branch=master)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/mongodb-query-exporter)](https://artifacthub.io/packages/search?repo=mongodb-query-exporter)

Expand Down
2 changes: 1 addition & 1 deletion chart/mongodb-query-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ keywords:
name: mongodb-query-exporter
sources:
- https://github.com/raffis/mongodb-query-exporter
version: 3.0.2
version: 4.0.0
4 changes: 4 additions & 0 deletions chart/mongodb-query-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,7 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.topologySpreadConstraints | nindent 8 }}
{{- end }}
42 changes: 0 additions & 42 deletions chart/mongodb-query-exporter/templates/podsecuritypolicy.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions chart/mongodb-query-exporter/templates/role.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions chart/mongodb-query-exporter/templates/rolebinding.yaml

This file was deleted.

18 changes: 8 additions & 10 deletions chart/mongodb-query-exporter/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
image:
pullPolicy: IfNotPresent
repository: ghcr.io/raffis/mongodb-query-exporter
tag:


affinity: {}

topologySpreadConstraints: []

chartLabels: true

labels: {}
Expand All @@ -10,11 +18,6 @@ extraArgs:

fullnameOverride: ""

image:
pullPolicy: IfNotPresent
repository: ghcr.io/raffis/mongodb-query-exporter
tag:

imagePullSecrets: []

livenessProbe:
Expand Down Expand Up @@ -156,11 +159,6 @@ serviceAccount:
# fullname template.
name:

# Creates a PodSecurityPolicy and the role/rolebinding
# allowing the serviceaccount to use it
podSecurityPolicy:
enabled: false

# Prometheus operator ServiceMonitor
serviceMonitor:
enabled: false
Expand Down
11 changes: 5 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"os/user"
"time"

"github.com/raffis/mongodb-query-exporter/v2/collector"
"github.com/raffis/mongodb-query-exporter/v2/config"
v1 "github.com/raffis/mongodb-query-exporter/v2/config/v1"
v2 "github.com/raffis/mongodb-query-exporter/v2/config/v2"
v3 "github.com/raffis/mongodb-query-exporter/v2/config/v3"
"github.com/raffis/mongodb-query-exporter/v3/internal/collector"
"github.com/raffis/mongodb-query-exporter/v3/internal/config"
v1 "github.com/raffis/mongodb-query-exporter/v3/internal/config/v1"
v2 "github.com/raffis/mongodb-query-exporter/v3/internal/config/v2"
v3 "github.com/raffis/mongodb-query-exporter/v3/internal/config/v3"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand Down Expand Up @@ -41,7 +41,6 @@ var (
panic(err)
}

//reg := prometheus.NewRegistry()
prometheus.MustRegister(c)
promCollector = c
_ = c.StartCacheInvalidator()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
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/raffis/mongodb-query-exporter/v2
module github.com/raffis/mongodb-query-exporter/v3

go 1.20

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion config/config.go → internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/raffis/mongodb-query-exporter/v2/collector"
"github.com/raffis/mongodb-query-exporter/v3/internal/collector"
)

// Config defaults
Expand Down
6 changes: 3 additions & 3 deletions config/v1/config.go → internal/config/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/raffis/mongodb-query-exporter/v2/collector"
"github.com/raffis/mongodb-query-exporter/v2/config"
"github.com/raffis/mongodb-query-exporter/v2/x/zap"
"github.com/raffis/mongodb-query-exporter/v3/internal/collector"
"github.com/raffis/mongodb-query-exporter/v3/internal/config"
"github.com/raffis/mongodb-query-exporter/v3/internal/x/zap"

"go.mongodb.org/mongo-driver/mongo/options"
)
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions config/v2/config.go → internal/config/v2/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/raffis/mongodb-query-exporter/v2/collector"
"github.com/raffis/mongodb-query-exporter/v2/config"
"github.com/raffis/mongodb-query-exporter/v2/x/zap"
"github.com/raffis/mongodb-query-exporter/v3/internal/collector"
"github.com/raffis/mongodb-query-exporter/v3/internal/config"
"github.com/raffis/mongodb-query-exporter/v3/internal/x/zap"

"go.mongodb.org/mongo-driver/mongo/options"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"testing"

"github.com/raffis/mongodb-query-exporter/v2/x/zap"
"github.com/raffis/mongodb-query-exporter/v3/internal/x/zap"
"github.com/tj/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions config/v3/config.go → internal/config/v3/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/raffis/mongodb-query-exporter/v2/collector"
"github.com/raffis/mongodb-query-exporter/v2/config"
"github.com/raffis/mongodb-query-exporter/v2/x/zap"
"github.com/raffis/mongodb-query-exporter/v3/internal/collector"
"github.com/raffis/mongodb-query-exporter/v3/internal/config"
"github.com/raffis/mongodb-query-exporter/v3/internal/x/zap"

"go.mongodb.org/mongo-driver/mongo/options"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"testing"

"github.com/raffis/mongodb-query-exporter/v2/x/zap"
"github.com/raffis/mongodb-query-exporter/v3/internal/x/zap"
"github.com/tj/assert"
)

Expand Down
File renamed without changes.