Skip to content

Conversation

@AGMETEOR
Copy link
Contributor

@AGMETEOR AGMETEOR commented Nov 27, 2025

  • Add versioning to builds
  • Add metrics similar/compatible to those of http-proxy

@AGMETEOR AGMETEOR changed the title Add versioning of builds Wireup metrics for sing-box Dec 1, 2025
@AGMETEOR AGMETEOR self-assigned this Dec 1, 2025
@AGMETEOR AGMETEOR marked this pull request as ready for review December 1, 2025 12:18
Copy link
Contributor

Copilot AI left a 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.io and proxy.connections naming 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.

Copy link
Collaborator

@garmr-ulfr garmr-ulfr left a 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.

@AGMETEOR AGMETEOR merged commit a39cb75 into main Dec 11, 2025
1 check passed
@AGMETEOR AGMETEOR deleted the verion-builds branch December 11, 2025 09:00
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

Successfully merging this pull request may close these issues.

3 participants