Skip to content

Original resource ID not long enough for Swift container names #1436

Closed
@Callum027

Description

@Callum027

Gnocchi only allows original resource IDs up to 255 characters long.

In Ceilometer the resource ID for an object storage container is created by appending the container name to the project ID with / as a separator. Since in Swift container names can be up to 256 characters long, this results in a maximum resource ID of length 289 characters.

This results in Ceilometer being unable to push object storage metrics to Gnocchi when container names are at least 223 characters long.

Given that Ceilometer has used this format for a long time I'm assuming that Gnocchi not accommodating the maximum possible length is unintentional, so I'm creating a bug report here.

Which version of Gnocchi are you using

Latest master.

How to reproduce your problem

  1. Create a Swift container name at least 223 characters long, and create an object of non-zero size so that it gets sampled.
  2. Allow Ceilometer to sample it using one of the object storage usage pollsters (e.g. storage.containers.objects.size).

What is the result that you get

In ceilometer-agent-notification.log:

2025-01-15 11:47:19.644 51 ERROR ceilometer.dispatcher.gnocchi [-] {u'reason': u"transformable resource id >255 max allowed characters @ data['9864e20f92ef47238becfe06b869d2ac_in.pressure.already.writing.call.spoken.carry.fish.honor.key.occasionally.dry.favorite.writer.trunk.above.essential.division.major.involved.disease.search.wagon.work.cloth.ability.earth.meant.related.elephant.tax.bad.mass.wrapped.bowl.cost.composition.luck']", u'cause': u'Invalid input', u'detail': [u'9864e20f92ef47238becfe06b869d2ac_in.pressure.already.writing.call.spoken.carry.fish.honor.key.occasionally.dry.favorite.writer.trunk.above.essential.division.major.involved.disease.search.wagon.work.cloth.ability.earth.meant.related.elephant.tax.bad.mass.wrapped.bowl.cost.composition.luck']} (HTTP 400): BadRequest: {u'reason': u"transformable resource id >255 max allowed characters @ data['9864e20f92ef47238becfe06b869d2ac_in.pressure.already.writing.call.spoken.carry.fish.honor.key.occasionally.dry.favorite.writer.trunk.above.essential.division.major.involved.disease.search.wagon.work.cloth.ability.earth.meant.related.elephant.tax.bad.mass.wrapped.bowl.cost.composition.luck']", u'cause': u'Invalid input', u'detail': [u'9864e20f92ef47238becfe06b869d2ac_in.pressure.already.writing.call.spoken.carry.fish.honor.key.occasionally.dry.favorite.writer.trunk.above.essential.division.major.involved.disease.search.wagon.work.cloth.ability.earth.meant.related.elephant.tax.bad.mass.wrapped.bowl.cost.composition.luck']} (HTTP 400)

What is result that you expected

Sample polled correctly, with the corresponding resource created in Gnocchi.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions