Skip to content

feat: add metric and log to track dropped samples #301

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

itatabitovski
Copy link

@itatabitovski itatabitovski commented Apr 12, 2025

Introduce new metric graphite_dropped_samples_total to track any samples that are dropped either because of the explicit mapping config drop action or because of the --graphite.mapping-strict-match flag.

Also log a warning for each dropped metric.

It may make sense to split the dropping reasons and track them separately.

❯ echo 'xxxxxxx.xxxd 1234 123213' | nc -w1 127.0.0.1 9109
❯ ./graphite_exporter --graphite.mapping-strict-match
time=2025-04-12T10:58:18.816+02:00 level=INFO source=main.go:84 msg="Starting graphite_exporter" version_info="(version=0.16.0, branch=dropped-metrics, revision=04e6da143c01cbaede1f005107235da44ca465d6)"
time=2025-04-12T10:58:18.817+02:00 level=INFO source=main.go:85 msg="(go=go1.23.6, platform=linux/amd64, user=ilin@nuc, date=20250412-08:24:17, tags=unknown)"
time=2025-04-12T10:58:18.817+02:00 level=INFO source=tls_config.go:347 msg="Listening on" address=[::]:9108
time=2025-04-12T10:58:18.817+02:00 level=INFO source=tls_config.go:350 msg="TLS is disabled." http2=false address=[::]:9108
time=2025-04-12T10:58:27.907+02:00 level=WARN source=collector.go:159 msg="Dropped line" line="xxxxxxx.xxxd 1234 123213"
❯ curl -s localhost:9108/metrics | grep dropped_sa
# HELP graphite_dropped_samples_total Total count of samples dropped
# TYPE graphite_dropped_samples_total counter
graphite_dropped_samples_total 1

@matthiasr
@pedro-stanaka

Signed-off-by: Ilin Tatabitovski <itatabitovski@gmail.com>
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.

1 participant