Skip to content

Collecting metrics from glance service seems to be broken #400

@gabrielcocenza

Description

@gabrielcocenza

I'm running the exporter into a xena OpenStack cloud and the exporter is failing to collect metrics from glance:

Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.329Z caller=utils.go:70 level=info msg="Start collect cache data" cloud=openstack service=image
Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.651Z caller=exporter.go:181 level=info msg="Adding metric to exporter" metric=images exporter=glance
Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.651Z caller=exporter.go:181 level=info msg="Adding metric to exporter" metric=image_bytes exporter=glance
Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.651Z caller=exporter.go:181 level=info msg="Adding metric to exporter" metric=image_created_at exporter=glance
Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.651Z caller=exporter.go:120 level=debug msg="No function handler set for metric" metric=image_created_at
Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.651Z caller=exporter.go:120 level=debug msg="No function handler set for metric" metric=up
Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.651Z caller=exporter.go:120 level=debug msg="No function handler set for metric" metric=openstack_metric_collect_seconds
Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.651Z caller=exporter.go:100 level=info msg="Collecting metrics for exporter" exporter=openstack_glance metrics=images
Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.791Z caller=exporter.go:126 level=error err="Failed to collect metric for exporter" exporter=glance error="failed to collect metric: images, error: json: cannot unmarshal string into Go struct field .images of type map[string]interface {}"
Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.791Z caller=exporter.go:100 level=info msg="Collecting metrics for exporter" exporter=openstack_glance metrics=image_bytes
Aug 30 19:52:14 juju-e67c1e-3-lxd-25 golang-openstack-exporter.service[55832]: ts=2024-08-30T19:52:14.817Z caller=exporter.go:126 level=error err="Failed to collect metric for exporter" exporter=glance error="failed to collect metric: image_bytes, error: json: cannot unmarshal string into Go struct field .images of type map[string]interface {}"

From the logs it seems that the exporter is facing issues with the data returned from the api.

Manually running the openstack cli to list images and etc are working fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    priorityPriority PR or Issue to help with tracking.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions