SigNoz / signoz

SigNoz is an open-source observability platform native to OpenTelemetry with logs, traces and metrics in a single application. An open-source alternative to DataDog, NewRelic, etc. 🔥 🖥. 👉 Open source Application Performance Monitoring (APM) & Observability tool
https://signoz.io
Other
18.3k stars 1.17k forks source link

unable to export logs using otlploghttp #5456

Open chr1shung opened 1 month ago

chr1shung commented 1 month ago

I have SigNoz deployed on my localhost using docker compose and I believe it's working normally (I can export trace to it). And I have something similar to below in my testing program:

func main() {
        shutdown := initLogging()
        defer func() { _ = shutdown(context.Background()) }()
        slog.Info("Hello World")
}

func initLogging() func(context.Context) error {
    logExporter, err := otlploghttp.New(context.Background(), otlploghttp.WithInsecure())
    if err != nil {
        // handle error
    }

    processor := log.NewBatchProcessor(logExporter)
    logProvider = log.NewLoggerProvider(
        log.WithProcessor(processor),
    )

    global.SetLoggerProvider(logProvider)
    slog.SetDefault(otelslog.NewLogger("app_name", otelslog.WithLoggerProvider(logProvider)))

        return logProvider.Shutdown
}

But when I run the program there's no log entries on the SigNoz dashboard. Does SigNoz only support export log via log files or am I mis-configuring anything ? thanks for the help.

welcome[bot] commented 1 month ago

Thanks for opening this issue. A team member should give feedback soon. In the meantime, feel free to check out the contributing guidelines.