<div dir="ltr"><div>I am not understanding. Your expression to obtain the value is ". | value['usage'] | value.get('rgw.main',{'size':0}) | value['size']". That assumes a response with a "value" entry in the JSON; then, you get the 'rgw.main' attribute, and then, you get the size. <br></div><div><br></div><div><br></div><div><br></div><div>So, you are working with samples that are similar to the following:</div>```<br>{<br>   "bucket":"huge",<br>   "num_shards":11,<br>   "tenant":"08bb8ee9c5bd41248025268ee1aea481",<br>   "zonegroup":"d28c435f-57a5-49ca-91e8-481a2ced1f18",<br>   "placement_rule":"default-placement",<br>   "explicit_placement":{<br>      "data_pool":"",<br>      "data_extra_pool":"",<br>      "index_pool":""<br>   },<br>   "id":"ba604862-46ad-4cf1-a554-7da4e7168ac3.27108481.3",<br>   "marker":"ba604862-46ad-4cf1-a554-7da4e7168ac3.27108481.3",<br>   "index_type":"Normal",<br>   "owner":"08bb8ee9c5bd41248025268ee1aea481$08bb8ee9c5bd41248025268ee1aea481",<br>   "ver":"0#1,1#1,2#1,3#1,4#1,5#1,6#1,7#2,8#1,9#1,10#1",<br>   "master_ver":"0#0,1#0,2#0,3#0,4#0,5#0,6#0,7#0,8#0,9#0,10#0",<br>   "mtime":"2022-10-26T11:32:05.185527Z",<br>   "creation_time":"2022-10-26T11:32:05.181022Z",<br>   "max_marker":"0#,1#,2#,3#,4#,5#,6#,7#,8#,9#,10#",<br>   "usage":{<br>      "rgw.main":{<br>         "size":8461984,<br>         "size_actual":8462336,<br>         "size_utilized":8461984,<br>         "size_kb":8264,<br>         "size_kb_actual":8264,<br>         "size_kb_utilized":8264,<br>         "num_objects":1<br>      }<br>   },<br>   "bucket_quota":{<br>      "enabled":false,<br>      "check_on_raw":true,<br>      "max_size":-1,<br>      "max_size_kb":0,<br>      "max_objects":-1<br>   }<br>}<br><div>```</div><div><br></div><div>These samples are probably coming from an API with "usage" JSON attribute, and that is why it works with your expression.<br></div><div><br></div><div>To answer your initial question, Ceilometer dynamic pollster will work with whatever you have in the response. If data comes in a bucket fashion, each sample is going to represent a bucket. If you want to group/aggregate that data in a project/tenant fashion you might need to do some working. Either using a different API, or doing some groupby in Gnocchi with the aggregates API.</div><div><br></div><div>Furthermore, what about the "admin/usage" instead of the "admin/bucket?stats=True" . The admin API will bring data grouped in a user fashion.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 28, 2022 at 9:46 AM Taltavull Jean-François <<a href="mailto:jean-francois.taltavull@elca.ch">jean-francois.taltavull@elca.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-4455669362024972640">





<div style="overflow-wrap: break-word;" lang="FR">
<div class="m_-4455669362024972640WordSection1">
<p class="MsoNormal"><span lang="EN-US">See below. Hope this will help !<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span>[[{'bucket': 'huge', 'num_shards': 11, 'tenant': '08bb8ee9c5bd41248025268ee1aea481', 'zonegroup': 'd28c435f-57a5-49ca-91e8-481a2ced1f18', 'placement_rule': 'default-placement', 'explicit_placement':
 {'data_pool': '', 'data_extra_pool': '', 'index_pool': ''}, 'id': 'ba604862-46ad-4cf1-a554-7da4e7168ac3.27108481.3', 'marker': 'ba604862-46ad-4cf1-a554-7da4e7168ac3.27108481.3', 'index_type': 'Normal', 'owner': '08bb8ee9c5bd41248025268ee1aea481$08bb8ee9c5bd41248025268ee1aea481',
 'ver': '0#1,1#1,2#1,3#1,4#1,5#1,6#1,7#2,8#1,9#1,10#1', 'master_ver': '0#0,1#0,2#0,3#0,4#0,5#0,6#0,7#0,8#0,9#0,10#0', 'mtime': '2022-10-26T11:32:05.185527Z', 'creation_time': '2022-10-26T11:32:05.181022Z', 'max_marker': '0#,1#,2#,3#,4#,5#,6#,7#,8#,9#,10#',
 'usage': {'rgw.main': {'size': 8461984, 'size_actual': 8462336, 'size_utilized': 8461984, 'size_kb': 8264, 'size_kb_actual': 8264, 'size_kb_utilized': 8264, 'num_objects': 1}}, 'bucket_quota': {'enabled': False, 'check_on_raw': True, 'max_size': -1, 'max_size_kb':
 0, 'max_objects': -1}}, {'bucket': 'empty', 'num_shards': 11, 'tenant': '08bb8ee9c5bd41248025268ee1aea481', 'zonegroup': 'd28c435f-57a5-49ca-91e8-481a2ced1f18', 'placement_rule': 'default-placement', 'explicit_placement': {'data_pool': '', 'data_extra_pool':
 '', 'index_pool': ''}, 'id': 'ba604862-46ad-4cf1-a554-7da4e7168ac3.27142035.4', 'marker': 'ba604862-46ad-4cf1-a554-7da4e7168ac3.27142035.4', 'index_type': 'Normal', 'owner': '08bb8ee9c5bd41248025268ee1aea481$08bb8ee9c5bd41248025268ee1aea481', 'ver': '0#1,1#1,2#1,3#1,4#1,5#1,6#1,7#1,8#1,9#1,10#1',
 'master_ver': '0#0,1#0,2#0,3#0,4#0,5#0,6#0,7#0,8#0,9#0,10#0', 'mtime': '2022-10-26T11:31:40.229337Z', 'creation_time': '2022-10-26T11:31:40.224401Z', 'max_marker': '0#,1#,2#,3#,4#,5#,6#,7#,8#,9#,10#', 'usage': {}, 'bucket_quota': {'enabled': False, 'check_on_raw':
 True, 'max_size': -1, 'max_size_kb': 0, 'max_objects': -1}}, {'bucket': 'photos', 'num_shards': 11, 'tenant': '08bb8ee9c5bd41248025268ee1aea481', 'zonegroup': 'd28c435f-57a5-49ca-91e8-481a2ced1f18', 'placement_rule': 'default-placement', 'explicit_placement':
 {'data_pool': '', 'data_extra_pool': '', 'index_pool': ''}, 'id': 'ba604862-46ad-4cf1-a554-7da4e7168ac3.27108481.2', 'marker': 'ba604862-46ad-4cf1-a554-7da4e7168ac3.27108481.2', 'index_type': 'Normal', 'owner': '08bb8ee9c5bd41248025268ee1aea481$08bb8ee9c5bd41248025268ee1aea481',
 'ver': '0#2,1#1,2#1,3#3,4#1,5#1,6#1,7#1,8#1,9#1,10#1', 'master_ver': '0#0,1#0,2#0,3#0,4#0,5#0,6#0,7#0,8#0,9#0,10#0', 'mtime': '2022-10-24T11:54:18.320141Z', 'creation_time': '2022-10-24T11:54:18.315194Z', 'max_marker': '0#,1#,2#,3#,4#,5#,6#,7#,8#,9#,10#',
 'usage': {'rgw.main': {'size': 14, 'size_actual': 4096, 'size_utilized': 14, 'size_kb': 1, 'size_kb_actual': 4, 'size_kb_utilized': 1, 'num_objects': 1}}, 'bucket_quota': {'enabled': False, 'check_on_raw': True, 'max_size': -1, 'max_size_kb': 0, 'max_objects':
 -1}}, {'bucket': 'big', 'num_shards': 11, 'tenant': '08bb8ee9c5bd41248025268ee1aea481', 'zonegroup': 'd28c435f-57a5-49ca-91e8-481a2ced1f18', 'placement_rule': 'default-placement', 'explicit_placement': {'data_pool': '', 'data_extra_pool': '', 'index_pool':
 ''}, 'id': 'ba604862-46ad-4cf1-a554-7da4e7168ac3.27100595.1', 'marker': 'ba604862-46ad-4cf1-a554-7da4e7168ac3.27100595.1', 'index_type': 'Normal', 'owner': '08bb8ee9c5bd41248025268ee1aea481$08bb8ee9c5bd41248025268ee1aea481', 'ver': '0#2,1#1,2#1,3#1,4#1,5#1,6#1,7#1,8#1,9#1,10#1',
 'master_ver': '0#0,1#0,2#0,3#0,4#0,5#0,6#0,7#0,8#0,9#0,10#0', 'mtime': '2022-10-24T13:28:45.864925Z', 'creation_time': '2022-10-24T13:28:45.860346Z', 'max_marker': '0#,1#,2#,3#,4#,5#,6#,7#,8#,9#,10#', 'usage': {'rgw.main': {'size': 249, 'size_actual': 4096,
 'size_utilized': 249, 'size_kb': 1, 'size_kb_actual': 4, 'size_kb_utilized': 1, 'num_objects': 1}}, 'bucket_quota': {'enabled': False, 'check_on_raw': True, 'max_size': -1, 'max_size_kb': 0, 'max_objects': -1}}]<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div style="border-color:currentcolor currentcolor currentcolor blue;border-style:none none none solid;border-width:medium medium medium 1.5pt;padding:0cm 0cm 0cm 4pt">
<div>
<div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>From:</b> Rafael Weingärtner <<a href="mailto:rafaelweingartner@gmail.com" target="_blank">rafaelweingartner@gmail.com</a>>
<br>
<b>Sent:</b> vendredi, 28 octobre 2022 12:27<br>
<b>To:</b> Taltavull Jean-François <<a href="mailto:jean-francois.taltavull@elca.ch" target="_blank">jean-francois.taltavull@elca.ch</a>><br>
<b>Cc:</b> openstack-discuss <<a href="mailto:openstack-discuss@lists.openstack.org" target="_blank">openstack-discuss@lists.openstack.org</a>><br>
<b>Subject:</b> Re: [Ceilometer] RADOS GW metrics : cannot get radosgw.objects.size metric<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<table style="width:100%;border-collapse:collapse" width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="width:5.25pt;background:red;padding:0.75pt" width="7">
<p class="MsoNormal" style="margin-bottom:7.5pt"><span style="font-size:10pt;color:red"> </span><u></u><u></u></p>
</td>
<td style="background:rgb(255,235,156);padding:3.75pt 11.25pt">
<p class="MsoNormal" style="margin-bottom:7.5pt"><strong><i><span style="font-size:10pt;font-family:"Arial",sans-serif;color:red">EXTERNAL MESSAGE
</span></i></strong><span style="font-size:10pt;font-family:"Arial",sans-serif;color:black">- This email comes from
<strong><span style="font-family:"Arial",sans-serif">outside ELCA companies</span></strong>.</span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<div>
<p class="MsoNormal"><span style="font-size:10pt">Can you show us the json you are trying to process with Ceilometer? Then,we can move on from there. You can post here a minimalistic version of the json output.<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:10pt"><u></u> <u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10pt">On Fri, Oct 28, 2022 at 4:32 AM Taltavull Jean-François <<a href="mailto:jean-francois.taltavull@elca.ch" target="_blank">jean-francois.taltavull@elca.ch</a>> wrote:<u></u><u></u></span></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-bottom:12pt"><span style="font-size:10pt">Hello,<br>
<br>
I can ask the question another way: what's the difference between 'radosgw.containers.objects.size' and 'radosgw.objects.size' metrics ?<br>
<br>
Thanks,<br>
<br>
JF<br>
<br>
> -----Original Message-----<br>
> From: Taltavull Jean-François<br>
> Sent: lundi, 24 octobre 2022 16:26<br>
> To: openstack-discuss <<a href="mailto:openstack-discuss@lists.openstack.org" target="_blank">openstack-discuss@lists.openstack.org</a>><br>
> Subject: [Ceilometer] RADOS GW metrics : cannot get radosgw.objects.size<br>
> metric<br>
> <br>
> Hello,<br>
> <br>
> I'm trying to get the 'radosgw.objects.size' metric, that is the total bucket<br>
> objects size per tenant. I expected to get one sample per tenant but I get one<br>
> sample per bucket instead, as with the 'rados.containers.objects.size' metric.<br>
> <br>
> Here is my pollster definition:<br>
> '''<br>
> - name: "radosgw.objects.size"<br>
>   sample_type: "gauge"<br>
>   unit: "B"<br>
>   value_attribute: ". | value['usage'] | value.get('rgw.main',{'size':0}) |<br>
> value['size']"<br>
>   url_path: "FQDN/admin/bucket?stats=True"<br>
>   module: "awsauth"<br>
>   authentication_object: "S3Auth"<br>
>   authentication_parameters: my_access_key,my_secret_key,FQDN<br>
>   user_id_attribute: "owner | value.split('$') | value[0]"<br>
>   project_id_attribute: "tenant"<br>
>   resource_id_attribute: "id"<br>
> '''<br>
> <br>
> I tried with "resource_id_attribute: "tenant" but it does not work better.<br>
> <br>
> Any idea ? Is there something wrong in the pollster definition ?<br>
> <br>
> Regards,<br>
> Jean-Francois<u></u><u></u></span></p>
</blockquote>
</div>
<p class="MsoNormal"><span style="font-size:10pt"><br clear="all">
<br>
-- <u></u><u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10pt">Rafael Weingärtner<u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>

</div></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Rafael Weingärtner</div></div>