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

Option for only exporting varnish metrics #21

Closed
wants to merge 3 commits into from
Closed

Option for only exporting varnish metrics #21

wants to merge 3 commits into from

Conversation

nipuntalukdar
Copy link
Contributor

Added a command line parameter for -no-go-metrics to switch on or off exporting go runtime and http handler metrics.

@nipuntalukdar
Copy link
Contributor Author

Added changes for adding varnish environment and ip address as labels to the metrics. This will be useful when we collect metrics from multiple varnish servers.

@jonnenauha
Copy link
Owner

jonnenauha commented Oct 29, 2017

Was going to merge before the last commit. But now this is getting a bit messy.

What is the use case for env labels from command line? IP address is automatically available to you from prometheus and you can add labels to the scrape config like "production" "staging". That is a feature of prometheus already, attaching labels that will be useful to you when creating queries to certain servers. I don't see the benefit of doing it in the exporter? It seems the code adds the labels into all exported mertics, that is exactly what the prometheus yml config is for :)

Here is a example. IP address is already in the standard instance.

  - targets: [ '<ip1>:9131', '<ip2>:9131' ]
    labels:
      service: 'varnish'
      frontend_for: 'proxy'
      whatever_data_you_need: 'dev'
      kind: 'stable' // or production or whatever you need

If you have multiple servers, you make multiple entries to the prom config with different labels. Its a lot convenient than going to the server and configuring them there.

@nipuntalukdar
Copy link
Contributor Author

Will update and create a new pull requests. I didn't know about the options for automatically adding the labels for ip etc.:) as I am new to Prometheus.

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