-
Notifications
You must be signed in to change notification settings - Fork 143
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
Improve build and execution #2
Conversation
modified: .gitignore bin/
Add upstreams response time metrics
modified: bin/nginx-vts-exporter modified: nginx_vts_exporter.go
Change exported information for response time metrics
Fix readme style
Add SHA512 Hash for the binary file
Rebuild v0.0.3 version and regenerate SHA512 sum
Thanks for your contribution! I'll review this pr ASAP |
@@ -340,16 +350,17 @@ func fetchHTTP(uri string, timeout time.Duration) func() (io.ReadCloser, error) | |||
} | |||
|
|||
var ( | |||
listenAddress = flag.String("telemetry.address", ":9113", "Address on which to expose metrics.") | |||
listenAddress = flag.String("telemetry.address", ":9913", "Address on which to expose metrics.") |
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.
May we should keep compatible with the former listen port 9113?I'm wondering what's the purpose to change it?
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.
It was just a random port number, it is configurable with METRICS_ADDR Env variable if you run it inside a container.
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.
Yes, this was a random port number, and it's configurable. But it's better for us to keep the former default port number 9113, isn't it?
@@ -144,7 +150,7 @@ type Exporter struct { | |||
serverMetrics, upstreamMetrics, cacheMetrics map[string]*prometheus.GaugeVec | |||
} | |||
|
|||
func newServerMetric(metricName string, docString string, labels []string) *prometheus.GaugeVec { | |||
func newServerMetric(metricName string, docString string, labels []string, namespace string) *prometheus.GaugeVec { |
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.
the namespace here could also be a global variable
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.
This solves the problem when you want to run the vts-nginx-exporter on different Nginx instances and you have only one Prometheus scrapper.
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.
Yes, I totally agree. But the point here is we do not need pass the namespace as args, just use the global variable namespace
instead, this should avoid changing too many codes. What do you think? :)
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.
Well we can set the global variable namespace
from Env variable so we can use it anywhere without changing any function header.
Build process improvement:
Dockerized solution improvement :
Metrics:
Release:
Documentation