<div dir="ltr"><div dir="ltr">Jean, there are two problems with the Ceilometer. I just opened the patches to resolve it:<br>- <a href="https://review.opendev.org/c/openstack/ceilometer/+/856305">https://review.opendev.org/c/openstack/ceilometer/+/856305</a></div><div dir="ltr">- <a href="https://review.opendev.org/c/openstack/ceilometer/+/856304">https://review.opendev.org/c/openstack/ceilometer/+/856304</a></div><div dir="ltr"><br></div><div>Without these patches, you might have problems to use Ceilometer with Non-OpenStack dynamic pollsters and barbican credentials.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 31, 2022 at 3:55 PM Rafael Weingärtner <<a href="mailto:rafaelweingartner@gmail.com">rafaelweingartner@gmail.com</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 dir="ltr">It is the RGW user that you have. This user must have the role that is needed to access the usage feature in RGW. If I am not mistaken, it required an admin user. <br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 31, 2022 at 1:54 PM Taltavull Jean-François <<a href="mailto:jean-francois.taltavull@elca.ch" target="_blank">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>
<div lang="FR">
<div>
<p class="MsoNormal"><span lang="EN-US">Thanks to your help, I am close to the goal. Dynamic pollster is loaded and triggered.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">But I get a “Status[403] and reason [Forbidden]” in ceilometer logs while requesting admin/usage.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I’m not sure to understand well the auth mechanism. Are we talking about keystone credentials, ec2 credentials, Rados GW user ?...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">For now, in testing phase, I use “authentication_parameters”, not barbican.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">-JF<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><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><span lang="EN-US">From:</span></b><span lang="EN-US"> Rafael Weingärtner <<a href="mailto:rafaelweingartner@gmail.com" target="_blank">rafaelweingartner@gmail.com</a>>
<br>
<b>Sent:</b> mardi, 30 août 2022 14:17<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] Pollster cannot get RadosGW metrics when API endpoints are based on URL instead of port number<u></u><u></u></span></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 none repeat scroll 0% 0%;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) none repeat scroll 0% 0%;padding:3.75pt 11.25pt">
<p class="MsoNormal" style="margin-bottom:7.5pt"><b><i><span style="font-size:10pt;font-family:"Arial",sans-serif;color:red">EXTERNAL MESSAGE
</span></i></b><span style="font-size:10pt;font-family:"Arial",sans-serif;color:black">- This email comes from
<b><span style="font-family:"Arial",sans-serif">outside ELCA companies</span></b>.</span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<div>
<p class="MsoNormal"><span style="font-size:10pt;color:white">Yes, you will need to enable the metric/pollster to be processed. That is done via "polling.yml"
</span><span style="font-size:10pt">file. Also, do not forget that you will need to configure Ceilometer to push this new metric. If you use Gnocchi as the backend, you will need to change/update the gnocchi resource YML file. That file maps resources and
metrics in the Gnocchi backend. The configuration resides in Ceilometer. You can create/define new resource types and map them to specific metrics. It depends on how you structure your solution.<br>
<br>
P.S. You do not need to use "authentication_parameters". You can use the barbican integration to avoid setting your credentials in a file.<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 Tue, Aug 30, 2022 at 9:11 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">
<div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Hello,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">I tried to define a Rados GW dynamic pollster and I can see, in Ceilometer logs, that it’s actually loaded. But it looks like it was not triggered, I see no trace
of ceilometer connection in Rados GW logs.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">My definition:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">- name: "dynamic.radosgw.usage"</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">
</span>sample_type: "gauge"<u></u><u></u></p>
<p class="MsoNormal"> unit: "B"<u></u><u></u></p>
<p class="MsoNormal">
<span lang="EN-US">value_attribute: "total.size"</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> url_path:
<a href="http://%3cFQDN%3e/object-store/swift/v1/admin/usage" target="_blank">http://<FQDN>/object-store/swift/v1/admin/usage</a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> module: "awsauth"</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> authentication_object: "S3Auth"</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> authentication_parameters: xxxxxxxxxxxxx,yyyyyyyyyyyyy,<FQDN></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> user_id_attribute: "admin"</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> project_id_attribute: "admin"</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> resource_id_attribute: "admin"</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> response_entries_key: "summary"</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Do I have to set an option in ceilometer.conf, or elsewhere, to get my Rados GW dynamic pollster triggered ?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">-JF</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<div style="border-style:none none none solid;border-width:medium medium medium 1.5pt;padding:0cm 0cm 0cm 4pt;border-color:currentcolor currentcolor currentcolor blue">
<div>
<div style="border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm;border-color:currentcolor">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Taltavull Jean-François
<br>
<b>Sent:</b> lundi, 29 août 2022 18:41<br>
<b>To:</b> 'Rafael Weingärtner' <<a href="mailto:rafaelweingartner@gmail.com" target="_blank">rafaelweingartner@gmail.com</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] Pollster cannot get RadosGW metrics when API endpoints are based on URL instead of port number</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Thanks a lot for your quick answer, Rafael !</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">I will explore this approach.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Jean-Francois</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<div style="border-style:none none none solid;border-width:medium medium medium 1.5pt;padding:0cm 0cm 0cm 4pt;border-color:currentcolor currentcolor currentcolor blue">
<div>
<div style="border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm;border-color:currentcolor">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Rafael Weingärtner <<a href="mailto:rafaelweingartner@gmail.com" target="_blank">rafaelweingartner@gmail.com</a>>
<br>
<b>Sent:</b> lundi, 29 août 2022 17:54<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] Pollster cannot get RadosGW metrics when API endpoints are based on URL instead of port number</span><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 none repeat scroll 0% 0%;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) none repeat scroll 0% 0%;padding:3.75pt 11.25pt">
<p class="MsoNormal" style="margin-bottom:7.5pt"><b><i><span style="font-size:10pt;font-family:"Arial",sans-serif;color:red">EXTERNAL MESSAGE
</span></i></b><span style="font-size:10pt;font-family:"Arial",sans-serif;color:black">- This email comes from
<b><span style="font-family:"Arial",sans-serif">outside ELCA companies</span></b>.</span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10pt;color:black">You could use a different approach. You can use Dynamic pollster [1], and create your own mechanism to collect data, without needing to
change Ceilometer code. Basically all hard-coded pollsters can be converted to a dynamic pollster that is defined in YML</span><span style="font-size:10pt">.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10pt">[1]
<a href="https://docs.openstack.org/ceilometer/latest/admin/telemetry-dynamic-pollster.html#the-dynamic-pollsters-system-configuration-for-non-openstack-apis" target="_blank">
https://docs.openstack.org/ceilometer/latest/admin/telemetry-dynamic-pollster.html#the-dynamic-pollsters-system-configuration-for-non-openstack-apis</a></span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span style="font-size:10pt"> </span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span style="font-size:10pt"> </span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10pt">On Mon, Aug 29, 2022 at 12:51 PM Taltavull Jean-François <<a href="mailto:jean-francois.taltavull@elca.ch" target="_blank">jean-francois.taltavull@elca.ch</a>>
wrote:</span><u></u><u></u></p>
</div>
<blockquote style="border-style:none none none solid;border-width:medium medium medium 1pt;padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)">
<p class="MsoNormal" style="margin-bottom:12pt"><span style="font-size:10pt">Hi All,<br>
<br>
In our OpenStack deployment, API endpoints are defined by using URLs instead of port numbers and HAProxy forwards requests to the right bakend after having ACLed the URL.<br>
<br>
In the case of our object-store service, based on RadosGW, the internal API endpoint is "<a href="https://%3cFQDN%3e/object-store/swift/v1/AUTH_%3ctenant_id%3e" target="_blank">https://<FQDN>/object-store/swift/v1/AUTH_<tenant_id></a>"<br>
<br>
When Ceilometer RadosGW pollster tries to connect to the RadosGW admin API with the object-store internal endpoint, the URL becomes
<a href="https://%3cFQDN%3e/admin" target="_blank">https://<FQDN>/admin</a>, as shown by HAProxy logs. This URL does not match any API endpoint from HAProxy point of view. The line of code that rewrites the URL is this one:
<a href="https://opendev.org/openstack/ceilometer/src/branch/stable/wallaby/ceilometer/objectstore/rgw.py#L81" target="_blank">
https://opendev.org/openstack/ceilometer/src/branch/stable/wallaby/ceilometer/objectstore/rgw.py#L81</a><br>
<br>
What would you think of adding a mechanism based on new Ceilometer configuration option(s) to control the URL rewriting ?<br>
<br>
Our deployment characteristics:<br>
- OpenStack release: Wallaby<br>
- Ceph and RadosGW version: 15.2.16<br>
- deployment tool: OSA 23.2.1 and ceph-ansible<br>
<br>
<br>
Best regards,<br>
Jean-Francois</span><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><span style="font-size:10pt"><br clear="all">
<br>
-- </span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10pt">Rafael Weingärtner</span><u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</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"><div dir="ltr">Rafael Weingärtner</div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Rafael Weingärtner</div></div></div>