Prerequisites
- An OpenTelemetry Collector Contrib build (
otelcol-contrib) that can reach your targets. - An ingest key in the Collector’s environment as
SQUASHER_API_KEY. See Create an ingest key.
Scrape your targets
Use the Prometheus receiver when the Collector can reach each target’s metrics endpoint. It takes standard Prometheus scrape configuration, service discovery, and relabeling.otel-collector-config.yaml
service.name from the scrape job. Use metric_relabel_configs to drop series
and labels that you do not query before you add more jobs.
Scrape with the Squasher Collector
The Squasher Collector can also scrape Prometheus endpoints on the same host or on its private network. It scrapes only the targets that you list. It opens no port: every scrape is an outbound request. It has no service discovery and no relabeling. Add aprometheus receiver to the Collector configuration, /etc/squasher-collector/config.yaml.
Then add it to the receivers of the metrics pipeline, and keep the receivers that are there:
config.yaml
service.name from job, and service.instance.id as
host:port. The receiver values in the example are the defaults. The Collector reads the Prometheus text
format and the OpenMetrics text format.
Each scrape also sends these metrics for the target, also when the scrape fails:
A scrape fails when the response is larger than
max_body_size, or has more samples than
sample_limit. It also fails with scrape_budget when the response bodies of the scrapes that
run at the same time would use more than max_in_flight_bytes. Other targets wait until fewer
than max_concurrent_scrapes scrapes run. To use service discovery or relabeling, use the OpenTelemetry Collector above.
Receive remote write
If a Prometheus server must push its data, use the Prometheus Remote Write receiver from Collector Contrib. It is alpha and accepts Remote Write 2.0 only.otel-collector-config.yaml
prometheus.yml
What Squasher keeps
Verify
- Start the Collector with
SQUASHER_API_KEYset, and check its logs for export failures. - In Squasher, select Logs in the sidebar and choose Metrics in the source menu.
- Find a known metric from
checkout-api, and check its service, unit, and labels.
Limits
- Squasher does not store summaries. Change them to histograms, or leave them out. The Squasher Collector changes them to gauges and sums for you.
- The Remote Write receiver does not accept summaries or classic histograms.
- The Prometheus Alertmanager connector receives alerts, not metric series.
Next steps
OpenTelemetry
See the endpoint and what Squasher does with each signal.
Kubernetes
Collect workload metrics with the Helm chart.