Giter Site home page Giter Site logo

waldosch / squid-exporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from boynux/squid-exporter

0.0 0.0 0.0 271 KB

Squid Prometheus Exporter

Home Page: https://www.boynux.com/squid-exporter

License: MIT License

Dockerfile 3.64% Makefile 5.80% Go 90.56%

squid-exporter's Introduction

Build Status Go Report Card Maintainability

Squid Prometheus exporter

Exports squid metrics in Prometheus format

NOTE: From release 1.0 metric names and some parameters has changed. Make sure you check the docs and update your deployments accordingly!

New

  • Using environment variables to configure the exporter
  • Adding custom labels to metrics

Usage:

Simple usage:

squid-exporter -squid-hostname "localhost" -squid-port 3128

Configure Prometheus to scrape metrics from localhost:9301/metrics

- job_name: squid
  # squid-exporter is installed, grab stats about the local
  # squid instance.
  target_groups:
    - targets: ['localhost:9301']

To get all the parameteres, command line arguments always override default and environment variables configs:

squid-exporter -help

The following environment variables can be used to override default parameters:

SQUID_EXPORTER_LISTEN
SQUID_EXPORTER_METRICS_PATH
SQUID_HOSTNAME
SQUID_PORT
SQUID_LOGIN
SQUID_PASSWORD

Usage with docker:

Basic setup assuming Squid is running on the same machine:

docker run --net=host -d boynux/squid-exporter

Setup with Squid running on a different host

docker run -p 9301:9301 -d boynux/squid-exporter -squid-hostname "192.168.0.2" -squid-port 3128 -listen ":9301"

With environment variables

docker run -p 9301:9301 -d -e SQUID_PORT="3128" -e SQUID_HOSTNAME="192.168.0.2" -e SQUID_EXPORTER_LISTEN=":9301" boynux/squid-exporter

Build:

This project is written in Go, so all the usual methods for building (or cross compiling) a Go application would work.

If you are not very familiar with Go you can download the binary from releases.

Or build it for your OS:

go install https://github.com/boynux/squid-exporter

then you can find the binary in: $GOPATH/bin/squid-exporter

Features:

  • Expose Squid counters
    • Client HTTP
    • Server HTTP
    • Server ALL
    • Server FTP
    • Server Other
    • ICP
    • CD
    • Swap
    • Page Faults
    • Others
  • Histograms
  • Other metrics
  • Squid Authentication (Basic Auth)

FAQ:

  • Q: Metrics are not reported by exporter
  • A: That usually means the exporter cannot reach squid server or the config manager permissions are not set corretly. To debug and mitigate:
    • First make sure the exporter service can reach to squid server IP Address (you can use telnet to test that)
    • Make sure you allow exporter to query the squid server in config you will need something like this (172.20.0.0/16 is the network for exporter, you can also use a single IP if needed):
    #http_access allow manager localhost
    acl prometheus src 172.20.0.0/16
    http_access allow manager prometheus
    

Contribution:

Pull request and issues are very welcome.

Copyright:

MIT License

squid-exporter's People

Contributors

boynux avatar sachk avatar alexh-sauce avatar kintoandar avatar moreirfi avatar pharaujo avatar zbuchalski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.