lerna.management.stats.MetricsMultiTenantSupport.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lerna-management_2.13 Show documentation
Show all versions of lerna-management_2.13 Show documentation
A library that is useful for building applications that run on Lerna Stack.
The newest version!
package lerna.management.stats
import kamon.tag.TagSet
import lerna.util.tenant.Tenant
/** An object that provides extension methods related to multi-tenant features
*/
object MetricsMultiTenantSupport {
private[this] val tenantIdTagKey = "_tenant_id"
implicit class TagsOps(val tags: TagSet) extends AnyVal {
/** Create new TagSet including a tenant
* @param tenant A tenant
* @return new TagSet including the given tenant
*/
def withTenant(implicit tenant: Tenant): TagSet = tags.withTag(tenantIdTagKey, tenant.id)
}
}