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

[Question] Plan to enhance observability? #1564

Open
wi1dcard opened this issue Mar 12, 2024 · 3 comments
Open

[Question] Plan to enhance observability? #1564

wi1dcard opened this issue Mar 12, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@wi1dcard
Copy link

wi1dcard commented Mar 12, 2024

Hi Sekai and sing-box developers,

Thanks for making such a great tool. I've used sing-box for my home lab for several weeks. Complete integrations and the rigorous implementation really makes sing-box stand out from the crowd.

I'm curious that, do we have any plans for improving the observability of sing-box? Not only the clash dashboard compatibility, but also, for example, metrics, tracing, structured/JSON logs.

Here are some mature solution for golang, like Prometheus for metrics: https://github.com/prometheus/client_golang, and OpenTelemetry for tracing: https://opentelemetry.io/docs/languages/go/getting-started/.

I have to say that it could be a bit over kill to require "observability" for an app running on end-user's phones, laptops. But for people like me who run sing-box on a headless server, tracing and metrics can help a lot when address a network issue.

I used to built my own gateway based on Ubuntu, V2Ray, tproxy, ipset, iptables, and dnsmasq. I even made it unattended deployment with Ansible. However, eventually I gave up because of the over complexity and lack of observability. None of these has been made for "the" use case. Every time user complained "I can't open Google", connection reset by remote, I hardly cannot find the root cause in this ipset->dnsmasq->iptables->v2ray traffic chain. For me it is nightmare trying to identify where the connections go and why it didn't work.

Actually, I tried to build a Prometheus exporter to collect the stats from V2Ray API and exposes to Prometheus: https://github.com/wi1dcard/v2ray-exporter. But it was still not enough.

Anyway, long story short, if you'd like to enhance the observability, it would be very nice. Here is what I expected:

  1. JSON log
  2. More info in the log (for example print downloaded/uploaded bytes when a connection is closed, this is available in clash dashboard)
  3. Tracing (I saw there are pprof integration already, so this might not be that important?)
  4. Metrics (such as inbound/outbound bandwidth, number of connections, etc)

Please let me know your thoughts. Perhaps I can do some if it's on the plan.

@nekohasekai nekohasekai added the enhancement New feature or request label Mar 13, 2024
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

@github-actions github-actions bot added the Stale label May 13, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2024
@MaleicAcid
Copy link

+1 really need this

@dKenGuru
Copy link

Also +1
Sing-box need own stats AMD metrics for export for UI Panels, side graphs tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants