iits-consulting / otc-prometheus-exporter

GNU General Public License v3.0
8 stars 1 forks source link

feat: Add resource name resolutions for ELB, DCS, VPC #39

Closed DrDJIng closed 6 months ago

DrDJIng commented 9 months ago

This PR is for resource name resolution for ELB, DCS, and VPC resources.

ELB didn't seem to be functioning, so I replaced the the client with the new openstack v3 client, which successfully retrieves the resource names.

DCS was a simple addition of a DCS openstack client.

VPC, however, required some workarounds. There was no working VPC client, so I use the vpcep client and replaced the endpoints and resourcebases so that it points at the correct endpoint for bandwidths and public ips. This also required another change to pass the entire config into the FetchResourceIdToNameMapping function so that the projectId can be used in the endpoint remapping.

If the openstack clients then gain vpc client or bandwidth/publicip clients, this can be simply replaced.

zeljkobekcic commented 8 months ago

Sorry for the delay, I will take a look at it now.

DrDJIng commented 7 months ago

Sorry it's been a while from me as well!

Yeah, I admit the endpoint manipulation isn't the most elegant solution but I needed to get it to work somehow. I think solving the problem in the otc gopher base would be the best solution, but it's a workaround in the meantime.

Perhaps an issue and a comment with the issue link in the code itself could be used as a reminder to fix it once the original problem is solved?

It depends on whether expanded resource name resolution functionality is a priority feature or not, I guess?

zeljkobekcic commented 7 months ago

I am fine with this PR, just replace the hard coded "eu-de". Once this is done I am gonna merge this.

This PR here asks about the client for VPC: https://github.com/opentelekomcloud/gophertelekomcloud/issues/626

Sorry for the delayed answer.

DrDJIng commented 6 months ago

I hope I didn't miss anything! Definitely wouldn't have thought that NewNetworkV1 was the way to go.

Sorry it took me a couple of weeks! Been a busy time

zeljkobekcic commented 6 months ago

The feature looks great and I would love to merge it. You just need to merge main into your branch @DrDJIng