electrolux-oss / infrawallet

Backstage plugin that controls your cloud costs just in the way how you control your bank accounts
https://demo.infrawallet.io
Apache License 2.0
55 stars 4 forks source link

feat: category mapping rules support regular expressions #46

Closed gluckzhang closed 1 month ago

gluckzhang commented 2 months ago

Currently, we do a full string comparison in getCategoryByServiceName (https://github.com/electrolux-oss/infrawallet/blob/main/plugins/infrawallet-backend/src/service/functions.ts#L48C17-L48C41) for category mappings. It is better to support regular expressions there to categorize similar service names easily.

For example, in AWS different LLMs are considered as different services. For now, if we would like to categorize them into Artificial Intelligence, all of the names need to be added to category_mappings_default. If there is a new model, we need to update the mappings every single time.

A better approach is to categorize all the services whose names contain Bedrock to Artificial Intelligence.

image