diff --git a/VERSION b/VERSION index 0fccf7dc..eb91d716 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.37.0-dev \ No newline at end of file +v0.37.1-dev \ No newline at end of file diff --git a/pkg/batch/batch.go b/pkg/batch/batch.go index e1adeb10..8c5c7519 100644 --- a/pkg/batch/batch.go +++ b/pkg/batch/batch.go @@ -49,6 +49,7 @@ func (b *Batch) Add(ls model.LabelSet, t time.Time, line string) { b.Bytes += len(line) // Append the entry to an already existing stream (if any) + // Not efficient string building. labels := ls.String() if stream, ok := b.Streams[labels]; ok { stream.add(t, line) diff --git a/pkg/client/multi_tenant_client.go b/pkg/client/multi_tenant_client.go index cb058e53..b4aba932 100644 --- a/pkg/client/multi_tenant_client.go +++ b/pkg/client/multi_tenant_client.go @@ -36,8 +36,8 @@ const ( MultiTenantClientsSeparator = ";" ) -// NewMultiTenantClientWrapper returns Loki client which support more than one tenant id specified -// under `_gardener_multitenamt_id__` labale separated with semicolumn. +// NewMultiTenantClientWrapper returns Loki client which supports more than one tenant id specified +// under `_gardener_multitenamt_id__` label. The tenants are separated by semicolon. func NewMultiTenantClientWrapper(clientToWrap types.LokiClient, copyLabelSet bool) types.LokiClient { return &multiTenantClient{ lokiclient: clientToWrap, diff --git a/pkg/client/multi_tenant_client_test.go b/pkg/client/multi_tenant_client_test.go index 417776c7..7e36a7d5 100644 --- a/pkg/client/multi_tenant_client_test.go +++ b/pkg/client/multi_tenant_client_test.go @@ -114,6 +114,12 @@ var _ = Describe("Multi Tenant Client", func() { s: "test1", wantedTenants: []model.LabelValue{"operator", "user"}, }), + ginkotable.Entry("Handle record with __gardener_multitenant_id__ reserved label with one empty. Separator \" ; \" and leading and trailing spaces.", handleArgs{ + ls: model.LabelSet{"hostname": "test", "__gardener_multitenant_id__": " operator ; ; user "}, + t: time.Now(), + s: "test1", + wantedTenants: []model.LabelValue{"operator", "user"}, + }), ginkotable.Entry("Handle record with __gardener_multitenant_id__ and __tenant_id__ reserved labels.", handleArgs{ ls: model.LabelSet{"hostname": "test", "__tenant_id__": "pinokio", "__gardener_multitenant_id__": "operator; user"}, t: time.Now(),