-
Notifications
You must be signed in to change notification settings - Fork 46
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
Overhaul stats: Segregated metrics for each tracker running on a different socket address #1263
Comments
I've just realized all trackers of the same type use the same events sender and metrics repository. I mean, there is only one stats event sender and stats metrics repository service for all HTTP tracker or UDP tracker. That means counters for are for all trackers. There is no way to get metrics for each socket. If we want to enable/disable stats for all server at the same time we need to introduce new section in the configuration file. That would be global configuration for all UDP or HTTP trackers. For example: [core]
#tracker_usage_statistics = true <- remove this
[udp_trackers]
tracker_usage_statistics = true <- global config for all UDP trackers
[http_trackers]
tracker_usage_statistics = true <- global config for all HTTP trackers
[[udp_trackers]]
bind_address = "0.0.0.0:6969"
tracker_usage_statistics = true
[udp_trackers.cookie_lifetime]
secs = 120
nanos = 0
[[http_trackers]]
bind_address = "0.0.0.0:7070"
tracker_usage_statistics = true
[http_api]
bind_address = "0.0.0.0:1212"
[http_api.access_tokens]
admin = "***"
[health_check_api]
bind_address = "127.0.0.1:1313" We need to decide if:
Assuming we want both (metrics per socket and aggregate metrics per tracker tpye):
The current ones would be aggregate metrics. We can get the individualized metrics per sockets by adding new metadata (socket address) to the event. We need to change the event from: pub enum Event {
Connect { ip: IpAddr }
Announce { ip: IpAddr }
Scrape { ip: IpAddr }
} to: pub enum Event {
Connect { client_ip: IpAddr, server_socket_addr: SocketAddr }
Announce { client_ip: IpAddr, server_socket_addr: SocketAddr }
Scrape { client_ip: IpAddr, server_socket_addr: SocketAddr }
} cc @da2ce7 |
In today's meeting @da2ce7 and I agreed on:
|
Hi @da2ce7 one question, so far we have been using events only to generate the stats. However after our discussion today I think events might be used for different purposes in the future. For example, to decouple some part of the application. I think we need to:
I don't thing it's going to be cause performance issues because we always check if we have to send the event and I was even considering implementing an events sender that does nothing (null object pattern). I think in general we have to decouple the stats terminology from the events. Right now events are only created for stats, but we should split the statistic modules into two modules:
What do you thing? Relates to: #1343 |
Relates to: #1341 (comment)
Depends on: #1385
While I was reviewing the
tracker-core
package documentation I've realized we have thetracker_usage_statistics
config option in the core configuration:That value enables or disables the statistics.
I've recently moved the statistics out of the tracker core package. Therefore It does not make sense to have that config option there because there is nothing related to statistics tin the
tracker-core
package now.That value is used in the app bootstrap:
The same config option enables stats in both the UDP and HTTP trackers.
The current config omitting irrelevant values:
Maybe we should create two new values for UDP and HTTP trackers. However in the current configuration there is not a place to put generic configuration for all HTTP trackers or all UDP trackers.
We can only add a config option per instance.
NOTE: That you can run more than one HTTP and/or UDP trackers.
If we do that the config could be:
Where you can enable/disable stats for each instance.
cc @da2ce7
The text was updated successfully, but these errors were encountered: