vexxhost / vexxhost/openstack_database_exporter

Potential duplicate volume metrics

Open Beginner friendly
#95 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
12
Forks
3
Avg merge
31m
Merged PRs (30d)
5

Description

In this query

If a volume has multiple volume attachments, the LEFT JOIN will make v.id (id of volume) lose its primary key property that it gets from the db; so it is not unique anymore. When you then construct the metric using those values, you end up with two identical metrics which will trigger a panic and crash the whole exporter.

Using:
LEFT JOIN volume_attachment va ON v.id = va.volume_id AND va.deleted = 0 AND va.attach_status = "attached"
Seems to fix it.

Contributor guide

No contributing guide indexed for this repository

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

Start with sql/cinder/queries.sql at the linked query around line 74 and inspect how multiple attached volume records affect the result. Reproduce a volume with multiple attachments, then verify the exporter produces unique metrics without panicking or crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
databases, observability
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.