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

Sending to Grafana Cloud Loki instance not working #76

Closed
fhirter opened this issue Sep 14, 2021 · 3 comments
Closed

Sending to Grafana Cloud Loki instance not working #76

fhirter opened this issue Sep 14, 2021 · 3 comments

Comments

@fhirter
Copy link

fhirter commented Sep 14, 2021

I'm trying to send logs to the SaaS Loki instance of grafana cloud.

the url ist like this:
https://<user id>:<api key>@logs-prod-us-central1.grafana.net,

the api key look like follows (notice the = in the end):
eyJrIjoiYzhmZTNiZDJhNDc1YTg4MTU5ZmRjZjRkM2M4YzVjM2NjZjQ3NzcyNSIsIm4iOiJ0ZXN0IiwiaWQiOjUxOTQ5MH0=

in batcher.js on line 30 a url object is created from this, adding '/loki/api/v1/push'. It seems that it is url_encoded in this step because when read back from the object the url now is like:
https://77571:<...>TQ5MH0%3D@logs-prod-us-central1.grafana.net/

can this be fixed or is there a way around this issue?

best, fabian

@fhirter fhirter closed this as completed Sep 14, 2021
@fhirter
Copy link
Author

fhirter commented Sep 14, 2021

sorry, I didn't realize that basic auth is needed for this.
this might be used as an example:

const lokiTransport = new LokiTransport({
    host: `https://logs-prod-us-central1.grafana.net`,
    batching: false,
    basicAuth: '<user id>:<api key>',
    labels: { job: '<job label>' },
    json: false,
});

@alwyntan
Copy link

alwyntan commented Nov 1, 2021

Hey @JaniAnttonen Is promtail neccessary for the transport to work with grafana cloud? I'm not seeing any logs.

@alwyntan
Copy link

alwyntan commented Nov 1, 2021

Hey @JaniAnttonen Is promtail neccessary for the transport to work with grafana cloud? I'm not seeing any logs.

The problem is in #80, downgraded to 6.0.1 and now logs are showing

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