Open
Conversation
Contributor
Author
|
@sleep3r Нужно ревью, пожалуйста) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add embedded Prometheus monitoring to
mtproto-proxyand provide a ready-to-use Docker monitoring stack with Prometheus + Grafana.related #169
This PR adds:
/metricsendpoint on a dedicated configurable portWhat Changed
Embedded Prometheus endpoint
[monitoring]config section:enabledhostportmtproto-proxyGET /metricsin Prometheus text formatGlobal proxy metrics
mtproto_client_to_upstream_bytes_totalmtproto_upstream_to_client_bytes_totalMemory metrics
process_resident_memory_bytesprocess_virtual_memory_bytesprocess_cpu_seconds_totalprocess_open_fdsprocess_max_fdsmtproto_cgroup_memory_usage_bytesmtproto_cgroup_memory_limit_bytesThis works both on bare metal and in containers:
process_*metrics still workPer-user metrics
Pre-create per-user metric records from configured users and expose:
mtproto_user_connections_active{user="..."}mtproto_user_client_to_upstream_bytes_total{user="..."}mtproto_user_upstream_to_client_bytes_total{user="..."}Per-user byte counters are updated on the actual write path, so they match the semantics of global traffic totals.
Dashboard and docs
hack/dockerexample with:docker-compose.ymlprometheus.ymlWhy
This makes monitoring usable in the common Docker deployment model without relying on the existing Python dashboard stack.
Key goals:
Testing
Verified with:
zig build testzig buildjq emptydocker compose configNotes