-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update kafka monitor * database exception monitor
- Loading branch information
Showing
24 changed files
with
2,106 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM gcr.io/distroless/static:nonroot | ||
ARG TARGETARCH | ||
COPY bin/service-exceptionmonitor-$TARGETARCH /manager | ||
|
||
ENTRYPOINT ["/manager"] |
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,55 @@ | ||
IMG ?= ghcr.io/labring/sealos-exceptionmonitor-service:latest | ||
|
||
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) | ||
ifeq (,$(shell go env GOBIN)) | ||
GOBIN=$(shell go env GOPATH)/bin | ||
else | ||
GOBIN=$(shell go env GOBIN) | ||
endif | ||
|
||
# only support linux, non cgo | ||
PLATFORMS ?= linux_arm64 linux_amd64 | ||
GOOS=linux | ||
CGO_ENABLED=0 | ||
GOARCH=$(shell go env GOARCH) | ||
|
||
GO_BUILD_FLAGS=-trimpath -ldflags "-s -w" | ||
|
||
.PHONY: all | ||
all: build | ||
|
||
##@ General | ||
|
||
# The help target prints out all targets with their descriptions organized | ||
# beneath their categories. The categories are represented by '##@' and the | ||
# target descriptions by '##'. The awk commands is responsible for reading the | ||
# entire set of makefiles included in this invocation, looking for lines of the | ||
# file as xyz: ## something, and then pretty-format the target and help. Then, | ||
# if there's a line with ##@ something, that gets pretty-printed as a category. | ||
# More info on the usage of ANSI control characters for terminal formatting: | ||
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters | ||
# More info on the awk command: | ||
# http://linuxcommand.org/lc3_adv_awk.php | ||
|
||
.PHONY: help | ||
help: ## Display this help. | ||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
||
##@ Build | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f $(SERVICE_NAME) | ||
|
||
.PHONY: build | ||
build: ## Build service-hub binary. | ||
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) go build $(GO_BUILD_FLAGS) -o bin/manager main.go | ||
|
||
.PHONY: docker-build | ||
docker-build: build | ||
mv bin/manager bin/service-exceptionmonitor-${TARGETARCH} | ||
docker build -t $(IMG) . | ||
|
||
.PHONY: docker-push | ||
docker-push: | ||
docker push $(IMG) |
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,54 @@ | ||
# RESTServer | ||
|
||
## Description | ||
|
||
restserver for database monitoring | ||
|
||
## Getting Started | ||
|
||
### Running on the cluster | ||
|
||
1. Build and push your image to the location specified by `IMG`: | ||
|
||
```sh | ||
make docker-build docker-push IMG=<some-registry>/sealos-cloud-database-monitor:tag | ||
``` | ||
|
||
2. Deploy the restserver: | ||
|
||
```sh | ||
kubectl apply -f deploy/manifests/ | ||
``` | ||
|
||
### How it works | ||
|
||
To enable the database frontend application to retrieve monitoring data, you need to modify the environment variable `MONITOR_URL` of the frontend deployment to the corresponding address of the restserver. | ||
|
||
Additionally, to configure the data source, you need to set the environment variable `VM_SERVICE_HOST` of the restserver deployment to the correct address. | ||
|
||
``` | ||
e.g. | ||
http://prometheus.sealos.svc.cluster.local | ||
``` | ||
|
||
## License | ||
|
||
Copyright 2023. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
||
you may not use this file except in compliance with the License. | ||
|
||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
|
||
distributed under the License is distributed on an "AS IS" BASIS, | ||
|
||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
|
||
See the License for the specific language governing permissions and | ||
|
||
limitations under the License. |
Oops, something went wrong.