-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add more services #33
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
Conversation
Signed-off-by: Tadas Sutkaitis <[email protected]>
Signed-off-by: Tadas Sutkaitis <[email protected]>
Signed-off-by: Tadas Sutkaitis <[email protected]>
Signed-off-by: Tadas Sutkaitis <[email protected]>
Signed-off-by: Tadas Sutkaitis <[email protected]>
Signed-off-by: Tadas Sutkaitis <[email protected]>
Signed-off-by: Tadas Sutkaitis <[email protected]>
Signed-off-by: Tadas Sutkaitis <[email protected]>
Signed-off-by: Tadas Sutkaitis <[email protected]>
Signed-off-by: Tadas Sutkaitis <[email protected]>
mnaser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
round 1, can you do the splits for the resources like the other ones please?
| openstack_glance_image_bytes{id="1bea47ed-f6a9-463b-b423-14b9cca9ad27",name="cirros-0.3.2-x86_64-disk",tenant_id="5ef70662f8b34079a6eddb8da9d75fe8"} 1.3167616e+07 | ||
| openstack_glance_image_bytes{id="781b3762-9469-4cec-b58d-3349e5de4e9c",name="F17-x86_64-cfntools",tenant_id="5ef70662f8b34079a6eddb8da9d75fe8"} 4.76704768e+08 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think upstream tests have these flipped, I've wanted to try and keep them identical. Would it work to flip them?
| -- name: GetImageCount :one | ||
| SELECT | ||
| COUNT(*) as count | ||
| FROM | ||
| images | ||
| WHERE | ||
| deleted = 0; No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This query is neve used, so let's remove/drop it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you "massage" this to be similar to the other ones like how it has no keys and constraints and the primary key is on the field itself?
| } | ||
|
|
||
| for _, image := range images { | ||
| // Convert size from nullable int64 to float64, defaulting to 0 if null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can drop this comment, it's pretty clear :)
| keystonedb "github.com/vexxhost/openstack_database_exporter/internal/db/keystone" | ||
| ) | ||
|
|
||
| const Subsystem = "identity" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this to keystone.go?
| groupsDesc = prometheus.NewDesc( | ||
| prometheus.BuildFQName(collector.Namespace, Subsystem, "groups"), | ||
| "groups", | ||
| nil, | ||
| nil, | ||
| ) | ||
|
|
||
| projectInfoDesc = prometheus.NewDesc( | ||
| prometheus.BuildFQName(collector.Namespace, Subsystem, "project_info"), | ||
| "project_info", | ||
| []string{ | ||
| "description", | ||
| "domain_id", | ||
| "enabled", | ||
| "id", | ||
| "is_domain", | ||
| "name", | ||
| "parent_id", | ||
| "tags", | ||
| }, | ||
| nil, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
groups.go
| projectsDesc = prometheus.NewDesc( | ||
| prometheus.BuildFQName(collector.Namespace, Subsystem, "projects"), | ||
| "projects", | ||
| nil, | ||
| nil, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
projects.go
| regionsDesc = prometheus.NewDesc( | ||
| prometheus.BuildFQName(collector.Namespace, Subsystem, "regions"), | ||
| "regions", | ||
| nil, | ||
| nil, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regions.go
| usersDesc = prometheus.NewDesc( | ||
| prometheus.BuildFQName(collector.Namespace, Subsystem, "users"), | ||
| "users", | ||
| nil, | ||
| nil, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
users.go
| func NewIdentityCollector(db *sql.DB, logger *slog.Logger) *IdentityCollector { | ||
| return &IdentityCollector{ | ||
| db: db, | ||
| logger: logger, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queries can live here so you dont have to call every function with it
|
@mnaser I splitted everything to separate PRs + added some changes. |
No description provided.