grafana cloud: ECONNREFUSED error
AlessioGr opened this issue · 4 comments
I'm getting the following error:
Attempting to send log to Loki failed. Got an axios error, error code: 'ECONNREFUSED' message: connect ECONNREFUSED ::1:80
Both locally and when it's deployed on a real server. Has anyone experienced a similar issue? Do I maybe need to configure something in grafana cloud?
This is how I set it up in pino:
{
target: 'pino-loki',
options: {
options: {
batching: false,
host: 'https://logs-prod-012.grafana.net',
basicAuth: {
username: "602xxx",
password: "xxxxxxxxxxx", //api key
},
},
},
level: null,
}
Versions
"pino-loki": "^2.0.4",
"pino": "^8.14.1",
"express": "^4.18.2",
You have twice the "options" key, one nested in the other
options: {
options: {
You have twice the "options" key, one nested in the other
options: { options: {
Oh wow, how could I miss that! That's the problem with untyped code haha.
Thank you! It works now!
Yeah! I am currently working on the next version that will ship a specific interface that could be manually added for typing this
Added a little utility type for defining pino loki options :
import pino from 'pino'
// 👇
import type { LokiOptions } from 'pino-loki'
const transport = pino.transport<LokiOptions>({
target: "pino-loki",
options: {
// ...
},
});
const logger = pino(transport);