prometheus-community / prometheus-community/stackdriver_exporter

how we scrape log based metrics

Open
#138 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
295
Forks
117
Avg merge
9d 14h
Merged PRs (30d)
7

Description

Hi team ,

I try to scrape custom log based metrics and exporter doesn't do anything..

  • No scraping for below args

Args

--monitoring.metrics-type-prefixes=logging.googleapis.com/user/*
--monitoring.metrics-type-prefixes=logging.googleapis.com/user/my-custom-metric
level=info ts=2022-01-05T19:47:53.425Z caller=stackdriver_exporter.go:164 msg="Starting stackdriver_exporter" version="(version=0.11.0, branch=HEAD, revision=aafa2f0e851f2e07772a388dbf4590484513a19f)"
3
level=info ts=2022-01-05T19:47:53.425Z caller=stackdriver_exporter.go:165 msg="Build context" build_context="(go=go1.15.1, user=root@67413d69d3db, date=20200902-14:39:30)"
2
level=info ts=2022-01-05T19:47:53.425Z caller=stackdriver_exporter.go:166 msg="Using Google Cloud Project ID" projectID=<ProjectID >
1
level=info ts=2022-01-05T19:47:53.425Z caller=stackdriver_exporter.go:188 msg="Listening on" address=:9255
  • Scraper pods crashes with duplicate metric name error for below args

Args

--monitoring.metrics-type-prefixes=logging.googleapis.com
--monitoring.metrics-type-prefixes=logging.googleapis.com/user
panic: duplicate label names goroutine 128 [running]: github.com/prometheus/client_golang/prometheus.MustNewConstHistogram(...) /app/vendor/github.com/prometheus/client_golang/prometheus/histogram.go:620 github.com/prometheus-community/stackdriver_exporter/collectors.(*TimeSeriesMetrics).newConstHistogram(0xc00050fa08, 0xc0002e8000, 0x4d, 0x1a3388e8, 0xed967ec17, 0x0, 0xc000686100, 0xb, 0x10, 0xc0001e9440, ...) /app/collectors/monitoring_metrics.go:102 +0x228 github.com/prometheus-community/stackdriver_exporter/collectors.(*TimeSeriesMetrics).completeHistogramMetrics(0xc00050fa08) /app/collectors/monitoring_metrics.go:199 +0x1f0 github.com/prometheus-community/stackdriver_exporter/collectors.(*TimeSeriesMetrics).Complete(0xc00050fa08) /app/collectors/monitoring_metrics.go:162 +0x39 github.com/prometheus-community/stackdriver_exporter/collectors.(*MonitoringCollector).reportTimeSeriesMetrics(0xc00027e300, 0xc0001e8bd0, 0xc000770800, 0xc0000b78c0, 0xc0001e8bd0, 0x0) /app/collectors/monitoring_collector.go:404 +0x1465 github.com/prometheus-community/stackdriver_exporter/collectors.(*MonitoringCollector).reportMonitoringMetrics.func1.1(0xc0004aea50, 0xc00027e300, 0x1a338c07, 0xed967eb63, 0x0, 0x1a338c07, 0xed967ec8f, 0x0, 0xc000731a40, 0xc000770800, ...) /app/collectors/monitoring_collector.go:257 +0x6b6 created by github.com/prometheus-community/stackdriver_exporter/collectors.(*MonitoringCollector).reportMonitoringMetrics.func1 /app/collectors/monitoring_collector.go:231 +0x3f5

Can someone help on this one.. Thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two reported argument combinations and compare their scraping behavior. Start in collectors/monitoring_metrics.go around lines 102, 162, and 199, then trace the reporting path in collectors/monitoring_collector.go around lines 231, 257, and 404. Done means custom log-based metrics are handled and the duplicate metric-name panic no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, google-cloud, prometheus
Domain
cloud, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.