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

Improve build and execution #2

Merged
merged 28 commits into from
Dec 28, 2016
Merged

Improve build and execution #2

merged 28 commits into from
Dec 28, 2016

Conversation

mrmm
Copy link
Contributor

@mrmm mrmm commented Dec 24, 2016

Build process improvement:

  • Run the build process inside a container

Dockerized solution improvement :

  • Make image configurable using env vars
  • Shrink Image size from 251.2 MB to 12.17 MB

Metrics:

  • Add response time metric

Release:

  • Added bin directory and SHA512 sum for the binary

Documentation

  • Detailled metrics explanation
  • How to configure the image
  • How to build the images

mrmm added 28 commits December 24, 2016 00:47
	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
Add SHA512 Hash for the binary file
Rebuild v0.0.3 version and regenerate SHA512 sum
@sysulq
Copy link
Owner

sysulq commented Dec 27, 2016

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.")
Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Owner

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 {
Copy link
Owner

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

Copy link
Contributor Author

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.

Copy link
Owner

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? :)

Copy link
Contributor Author

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.

@sysulq sysulq merged commit ea3f8c9 into sysulq:master Dec 28, 2016
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.

2 participants