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

Tenant RegExpression is not valid for valid X-Scope-OrgID header values #202

Open
1 task done
ecuzziol opened this issue Sep 3, 2023 · 1 comment
Open
1 task done
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed investigation needed The investigation is needed

Comments

@ecuzziol
Copy link

ecuzziol commented Sep 3, 2023

Which version of Serilog.Sinks.Grafana.Loki are you using?

v8.2.0-beta.1

Which version of .NET are you using?

4.8

Describe the bug

the new tenant property is not allowing some valid characters for X-Scope-OrgID like the - character.

The regexp used in the BaseLokiHttpClient is not correct

To Reproduce

set the tenant property with some string like mytest-tenant

Expected behavior

the configuration should be valid and we should not receive
System.ArgumentException: 'mytest-tenant' argument does not follow rule for Tenant ID

Log/SelfLog output or exception with stacktrace

No response

Application or code sample, which could be used to reproduce a bug

No response

Additional context

No response

I have read the documentation

@ecuzziol ecuzziol added the bug Something isn't working label Sep 3, 2023
@mishamyte
Copy link
Member

Hi @ecuzziol!

Thanks for that finding.

I remember, we had a discussion with a contributor about the validation and the next was used:

Tenant IDs can be any alphanumeric string that fits within the Go HTTP header limit (1MB).
Described in https://grafana.com/docs/loki/latest/operations/multi-tenancy/

If you know more accurate rules, I would be grateful for the pull request with a validation fix and link to those rules.

Thanks

@mishamyte mishamyte added the investigation needed The investigation is needed label Sep 3, 2023
@mishamyte mishamyte added the help wanted Extra attention is needed label Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed investigation needed The investigation is needed
Development

No branches or pull requests

2 participants