Skip to content

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

Open
@guanyuding

Description

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?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions