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

document header options #104

Open
jburghardt opened this issue Mar 3, 2022 · 1 comment
Open

document header options #104

jburghardt opened this issue Mar 3, 2022 · 1 comment

Comments

@jburghardt
Copy link

It is possible to pass headers as options to the request. This should be documented in the Options part.

@jantoine1
Copy link

Oh man, this would have saved me several hours today. I request from the transport wasn't returning an HTTP error, even though it wasn't getting a successful HTTP response, and I couldn't tell because the transport isn't handling this as a failure. This is a separate issue here: #98

The failed HTTP error I was getting was a 401 "no org id". The reason for the failed HTTP response was because in a multi-tenant configuration, Loki requires the "X-Scope-OrgID" header to be set to the tenant ID. Using the undocumented "headers" option, one can set this like so:

new LokiTransport({
  headers: {
    "X-Scope-OrgID": "tenant1",
  },
  ...
});

Hopefully this helps others avoid the same confusion I ran into.

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

2 participants