Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for tenant, fields, and shouldComputeMulti Fields in OpenTSDBTarget #672

Open
guanyuding opened this issue Aug 16, 2024 · 0 comments

Comments

@guanyuding
Copy link

What you expected to happen?

The library should be able to support tenant, fields, and shouldComputeMulti parameters.

What happened?

I have made some local modifications to the code to better handle multi-value metrics and support different tenants. The changes include:

tenant: Added a tenant attribute to the OpenTSDBTarget class to support multi-tenancy. This allows specifying different tenants for various metrics.

shouldComputeMulti: Introduced a shouldComputeMulti attribute to indicate whether multi-computation should be performed based on the metrics.

fields: Added a fields attribute to manage multiple fields dynamically within the OpenTSDBTarget class.

class OpenTSDBTarget(object):
    ...
    tenant = attr.ib(default="default")
    shouldComputeMulti = attr.ib(default=False, validator=instance_of(bool))
    fields = attr.ib(default=attr.Factory(list))
    def to_json_data(self):
        return {
            'tenant':self.tenant,
            'shouldComputeMulti':self.shouldComputeMulti,
            'fields':self.fields,
        }

Do you plan to support these fields (tenant, shouldComputeMulti, fields), or is there an alternative approach to achieve this requirement?
thank you so much.

How to reproduce it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant