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

Feature:Add prometheus to monitor the gateway and grpc server #69

Merged
merged 5 commits into from
Feb 27, 2024

Conversation

mutezebra
Copy link
Contributor

@mutezebra mutezebra commented Feb 26, 2024

Etcd-related methods in discover package are not reused in order to meet customization needs
Even it have a lot of change but most change is from json file,don't worry
See pkg/prometheus/README.md for more datail #53

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the file use for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为git无法追踪文件夹,为了让这个文件夹被追踪以挂载到prometheus容器中,所以创建一个空文件。提前有这个文件夹存在的话也不必在代码中再去检查这个文件夹是否存在,以便于后续的json文件的生成。事实上prometheus是可以以静态文件的方式追踪grpc服务的metrics的,但是为了扩展性,我觉得以文件的动态发现的方式好一点。这样就不用手动的修改prometheus的配置文件从而实现服务的动态发现。

app/mapreduce/cmd/main.go Outdated Show resolved Hide resolved
app/gateway/rpc/init.go Show resolved Hide resolved
app/favorite/cmd/main.go Show resolved Hide resolved
consts/prometheus.go Show resolved Hide resolved
pkg/prometheus/etcd.go Show resolved Hide resolved
pkg/prometheus/handler.go Show resolved Hide resolved
Copy link
Owner

@CocaineCong CocaineCong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CocaineCong CocaineCong merged commit 17afc7e into CocaineCong:main Feb 27, 2024
1 check passed
@mutezebra mutezebra deleted the prometheus branch March 3, 2024 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants