iits-consulting / otc-prometheus-exporter

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

Better Namespace Completion #7

Closed zeljkobekcic closed 1 year ago

zeljkobekcic commented 1 year ago

Currently we are always prefixing SYS. to every namespace if it is not already prefixed. This is incorrect!

According to the Cloud Eye documentation there is a small-ish list of services (https://docs.otc.t-systems.com/cloud-eye/api-ref/appendix/services_interconnected_with_cloud_eye.html#ces-03-0059)

Please change the logic in such a way that these namespaces are translated via a map where the key is the short hand notation and the value the full namespace.

Example:

ECS -> SYS.ECS
BMS -> SERVICE.BMS

If the short form is not present in the translation, then don't translate it and just skip it.

The logic should be implemented in the internal/config.go where we read the env variables and the mappings should just be added to the existing ones in internal/otc_constants.go. The given example is already present in code.

Also try to add some tests for the code.

Create a branch feature-better-namespace-completion for this task.