Skip to content

[-] improve Prometheus scrapping, fixes #749#790

Merged
pashagolub merged 1 commit intomasterfrom
749-fix-prometheus-scrapping
Jun 9, 2025
Merged

[-] improve Prometheus scrapping, fixes #749#790
pashagolub merged 1 commit intomasterfrom
749-fix-prometheus-scrapping

Conversation

@pashagolub
Copy link
Collaborator

First make sure all sinks do not modify measurement envelopes, since maps in it reference to the same map in memory. Add improved Prometheus handler in sink, so logs will be populated with all scrapping errors. Clean cached measurements after each scrape, there is no need in serving the same data as it will be ignored anyway. Make sure all non-numeric fields are treated as labels. This will pollute some metrics, e.g. settings. It's better to rewrite metric queries if the number of labels is too high.

First make sure all sinks do not modify measurement envelopes, since
maps in it reference to the same map in memory. Add improved Prometheus
handler in sink, so logs will be populated with all scrapping errors.
Clean cached measurements after each scrape, there is no need in serving
the same data as it will be ignored anyway. Make sure all non-numeric
fields are treated as labels. This will pollute some metrics, e.g.
settings. It's better to rewrite metric queries if the number of labels
is too high.
@pashagolub pashagolub self-assigned this Jun 9, 2025
@pashagolub pashagolub added bug Something isn't working sinks Where and how to store monitored data labels Jun 9, 2025
@pashagolub pashagolub merged commit fb7abf3 into master Jun 9, 2025
9 checks passed
@coveralls
Copy link

Pull Request Test Coverage Report for Build 15540919971

Details

  • 11 of 31 (35.48%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 60.188%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/sinks/prometheus.go 9 29 31.03%
Totals Coverage Status
Change from base Build 15536793877: -0.03%
Covered Lines: 2688
Relevant Lines: 4466

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working sinks Where and how to store monitored data

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants