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 Request: Make client hostname available in adguard_top_clients and adguard_processing_time_milliseconds_* metrics #28

Open
kondas opened this issue Jul 4, 2024 · 1 comment

Comments

@kondas
Copy link

kondas commented Jul 4, 2024

Hi! Thanks for the effort put in this great piece of software.
It would be really nice to have client hostnames available in the adguard_top_clients and adguard_processing_time_milliseconds_* metrics , like on the web dashboard.

@freefd
Copy link

freefd commented Sep 18, 2024

Hi team,

This feature could be easily implemented by resolving client's info within the /control/clients/find endpoint (https://github.com/AdguardTeam/AdGuardHome/blob/master/openapi/openapi.yaml#L935-L959)

Request example:

https://198.51.100.1/control/clients/find?ip0=198.51.100.42

Response example:

[
  {
    "198.51.100.42": {
      "disallowed": false,
      "disallowed_rule": "198.51.100.0/24",
      "whois_info": {
      },
      "safe_search": null,
      "blocked_services_schedule": null,
      "name": "Client-Host-Name",
      "blocked_services": null,
      "ids": [
        "198.51.100.42"
      ],
      "tags": null,
      "upstreams": null,
      "filtering_enabled": false,
      "parental_enabled": false,
      "safebrowsing_enabled": false,
      "safesearch_enabled": false,
      "use_global_blocked_services": false,
      "use_global_settings": false,
      "ignore_querylog": null,
      "ignore_statistics": null,
      "upstreams_cache_size": 0,
      "upstreams_cache_enabled": null
    }
  }
]

The name field value needs to be extracted and added as name label to the appropriate adguard_top_clients record, i.e.:

adguard_top_clients{client="198.51.100.42",name="Client-Host-Name",server="https://198.51.100.1"} 279

In the same way to proceed with adguard_processing_time_milliseconds_* metrics.

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

No branches or pull requests

2 participants