All Projects → foomo → Pagespeed_exporter

foomo / Pagespeed_exporter

Licence: mit
Prometheus pagespeed exporter

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Pagespeed exporter

Postgresql exporter
A Prometheus exporter for some postgresql metrics
Stars: ✭ 26 (-82.55%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Iperf3 exporter
Simple server that probes iPerf3 endpoints and exports results via HTTP for Prometheus consumption
Stars: ✭ 30 (-79.87%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Json Exporter
Prometheus exporter which fetches JSON from a URL and exports one of the values as gauge metrics
Stars: ✭ 26 (-82.55%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Statsd exporter
StatsD to Prometheus metrics exporter
Stars: ✭ 608 (+308.05%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Sidekiq Prometheus Exporter
All the basic metrics of Sidekiq with pluggable contribs prepared for Prometheus
Stars: ✭ 129 (-13.42%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Snmp exporter
SNMP Exporter for Prometheus
Stars: ✭ 705 (+373.15%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Prometheus To Cloudwatch
Utility for scraping Prometheus metrics from a Prometheus client endpoint and publishing them to CloudWatch
Stars: ✭ 127 (-14.77%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Kube State Metrics
Add-on agent to generate and expose cluster-level metrics.
Stars: ✭ 3,433 (+2204.03%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Citrix Adc Metrics Exporter
Export metrics from Citrix ADC (NetScaler) to Prometheus
Stars: ✭ 67 (-55.03%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Promcord
📊 Analyze your entire discord guild in grafana using prometheus. Message, User, Game and Voice statistics...
Stars: ✭ 39 (-73.83%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Bigbluebutton Exporter
Prometheus exporter for BigBlueButton
Stars: ✭ 117 (-21.48%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Tomcat exporter
A Prometheus exporter for Apache Tomcat
Stars: ✭ 99 (-33.56%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Haproxy exporter
Simple server that scrapes HAProxy stats and exports them via HTTP for Prometheus consumption
Stars: ✭ 465 (+212.08%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Redis exporter
Prometheus Exporter for Redis Metrics. Supports Redis 2.x, 3.x, 4.x, 5.x and 6.x
Stars: ✭ 2,092 (+1304.03%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Consul exporter
Exporter for Consul metrics
Stars: ✭ 323 (+116.78%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Unifiedmetrics
Fully-featured metrics collection agent for Minecraft servers. Supports Prometheus and InfluxDB. Dashboard included out-of-box.
Stars: ✭ 29 (-80.54%)
Mutual labels:  metrics, prometheus, prometheus-exporter
s3 exporter
Exports Prometheus metrics about S3 buckets and objects
Stars: ✭ 65 (-56.38%)
Mutual labels:  metrics, prometheus, prometheus-exporter
resoto
Resoto - Find leaky resources, manage quota limits, detect drift, and clean up!
Stars: ✭ 562 (+277.18%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Kafka exporter
Kafka exporter for Prometheus
Stars: ✭ 996 (+568.46%)
Mutual labels:  metrics, prometheus, prometheus-exporter
Systemd exporter
Exporter for systemd unit metrics
Stars: ✭ 82 (-44.97%)
Mutual labels:  metrics, prometheus, prometheus-exporter

Prometheus Exporter for Google Pagespeed Online Metrics

Travis CI

Examples

To start the example with the default dashboard (docker-compose required)

$ git clone [email protected]:foomo/pagespeed_exporter.git
$ cd pagespeed_exporter/example
$ docker-compose up -d

After that, the application should be running on localhost:3000 with username admin and password s3cr3t.

The provided dashboard (Pagespeed) will be loaded with data after the first scrape.

Dashboard

The dashboard can be found at grafana

Understanding Metrics

Prometheus exporter for google pagespeed metrics

Building And Running

Building

$ make

Examples

To run pagespeed exporter we need to obtain the google api key for the pagespeed. Instructions how to create a key for pagespeed can be found here

pagespeed_exporter <arguments>

$ pagespeed_exporter -api-key {KEY} -targets https://google.com,https://prometheus.io -listener :80

Exporter Target Specification

Targets can be configured in either plaintext

https://github.com/foomo/pagespeed_exporter
https://mysite.com/test?test=true

Or via JSON which adds additional parameters

// URL can't be invalid
// Strategy can only be mobile/desktop
// If strategy is not specified, both desktop & mobile will be used
// Parameters are passed down to google pagespeed api

{"url":"https://github.com/foomo/pagespeed_exporter","campaign":"test","locale":"en","source":"source"}

{"url":"https://mysite.com/test?test=true","strategy":"mobile"}

Configuration specification in JSON and plain is supported both in command line & prometheus configuration

Exporter configuration

Configuration of targets can be done via docker and via prometheus

Flag Variable Description Default Required
-api-key PAGESPEED_API_KEY sets the google API key used for pagespeed False
-targets PAGESPEED_TARGETS comma separated list of targets to measure False
-t NONE multi-value target array (check docker comp) False
-listener PAGESPEED_LISTENER sets the listener address for the exporters :9271 False
-parallel PAGESPEED_PARALLEL sets the execution of targets to be parallel false False
-pushGatewayUrl PUSHGATEWAY_URL sets the pushgateway url to send the metrics False
-pushGatewayJob PUSHGATEWAY_JOB sets the pushgateway job name pagespeed_exporter False

Note: google api key is required only if scraping more than 2 targets/second

Note: exporter can be run without targets, and later targets provided via prometheus

Pushing metrics via push gateway

If you don't want to change the prometheus scrape_configs, you can send the metrics using push gateway using a batch job. Just configure the pushgateway url and use the /probe endpoint with query parameter target and the metrics will be send to prometheus.

curl http://localhost:9271/probe?target=https://www.example.com

Exporter Target Configuration (VIA PROMETHEUS)

Example configuration with simple and complex values

(Examples can ve found in the example folder)

  - job_name: pagespeed_exporter_probe
      metrics_path: /probe
      # Re-Label configurations so that we can use them
      # to configure the pagespeed exporter
      relabel_configs:
        - source_labels: [__address__]
          target_label: __param_target
        - source_labels: [__param_target]
          target_label: instance
        - target_label: __address__
          replacement: "pagespeed_exporter:9271"
      static_configs:
        - targets:
            - 'https://example.com/' # Example PLAIN
            - '{"url":"https://example.com/","campaign":"test","locale":"en","source":"source"}'  
            - '{"url":"https://example.com/mobileonly","strategy":"mobile"}'                    

Docker

$ docker run -p "9271:9271" --rm foomo/pagespeed_exporter -api-key {KEY} -t https://google.com,https://prometheus.io

or

$ docker run -p "9271:9271" --rm \
    --env PAGESPEED_API_KEY={KEY} \
    --env PAGESPEED_TARGETS=https://google.com,https://prometheus.io \
    foomo/pagespeed_exporter

Prometheus & Docker Compose

Check out the docker-compose folder

Kubernetes/Helm

You can install the included Helm chart to your k8s cluster with:

$ helm install helm/pagespeed-exporter

And then, to quickly test it:

$ kubectl get pods
pagespeed-exporter-riotous-dragonfly-6b99955999-hj2kw   1/1     Running   0          1m

$ kubectl exec -ti pagespeed-exporter-riotous-dragonfly-6b99955999-hj2kw -- sh
# apk add curl
# curl localhost:9271/metrics
pagespeed_lighthouse_audit_score{audit="first-contentful-paint",host="https://www.google.com",path="/",strategy="mobile"} 1
pagespeed_lighthouse_audit_score{audit="first-contentful-paint",host="https://www.google.com",path="/webhp",strategy="desktop"} 1
pagespeed_lighthouse_audit_score{audit="first-contentful-paint",host="https://www.google.com",path="/webhp",strategy="mobile"} 1
...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].