-
Notifications
You must be signed in to change notification settings - Fork 0
Wireup metrics for sing-box #62
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds versioning support to sing-box builds and integrates OpenTelemetry metrics compatible with http-proxy. The changes include a new OTEL metrics package, updates to existing metrics to use renamed metric names and add directional attributes, version information passed via build flags, and proxy configuration reading from INI files.
- Version information is now injected at build time via ldflags
- New OTEL package provides telemetry endpoint configuration and meter provider initialization
- Metrics updated to use
proxy.ioandproxy.connectionsnaming compatible with http-proxy - Geo-location tracking added via country code lookup from client IPs
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| otel/otel.go | New package for OTEL metrics initialization with customizable endpoint and resource attributes |
| metrics/metrics.go | Refactored to use renamed metrics (proxy.io, proxy.connections) and added geo-location lookup |
| metrics/conn.go | Updated to use new metric names and add direction attributes for read/write operations |
| metrics/packet_conn.go | Updated to use new metric names and add direction attributes for packet read/write |
| cmd/main.go | Added version variables, ProxyInfo struct, and OTEL initialization in pre-run hook |
| cmd/cmd_run.go | Added proxy info file reading function and version logging |
| go.mod | Updated Go version and added new dependencies for OTEL, geo-lookup, and INI parsing |
| go.sum | Checksum updates for new and updated dependencies |
| Dockerfile | Modified to accept build arguments for version injection |
| .github/workflows/push.yaml | Added build-args to inject version info during Docker builds |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
garmr-ulfr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the two comments, looks good.
Uh oh!
There was an error while loading. Please reload this page.