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

Loki Url is not validated on bootstrap #256

Open
1 task done
frsavard opened this issue May 8, 2024 · 3 comments
Open
1 task done

Loki Url is not validated on bootstrap #256

frsavard opened this issue May 8, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@frsavard
Copy link

frsavard commented May 8, 2024

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

v8.3.0

Which version of .NET are you using?

net8.0

Describe the bug

While trying to find out why I couldn't see anything in grafana, I deliberately put an invalid uri in WriteTo.GrafanaLoki(). Nothing happens, everything moves forward as if nothing had happened.

To Reproduce

using Serilog;
using Serilog.Sinks.Grafana.Loki;
using ILogger = Serilog.Core.Logger;

public static class Program
{
    public static async Task Main(string[] args)
    {
        ILogger logger = new LoggerConfiguration()
            .WriteTo.Console()
            //.WriteTo.GrafanaLoki("http://localhost:3100") // does not work
            .WriteTo.GrafanaLoki("this is not a valid uri") // should have reported an issue!!
            .CreateLogger();

        logger.Information("Starting web host"); // it logs on the console but not in Loki


Expected behavior

It should have reported the issue, either logging it or throw an exception.

Log/SelfLog output or exception with stacktrace

No output, no exception, this is the problem.

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

No response

Additional context

using Serilog;
using Serilog.Sinks.Grafana.Loki;
using ILogger = Serilog.Core.Logger;

public static class Program
{
    public static async Task Main(string[] args)
    {
        ILogger logger = new LoggerConfiguration()
            .WriteTo.Console()
            //.WriteTo.GrafanaLoki("http://localhost:3100") // does not work
            .WriteTo.GrafanaLoki("this is not a valid uri") // should have reported an issue!!
            .CreateLogger();

        logger.Information("Starting web host"); // it logs on the console but not in Loki


I have read the documentation

@frsavard frsavard added the bug Something isn't working label May 8, 2024
@mishamyte
Copy link
Member

Hi @frsavard,

I think it could be validated during the development process. So not sure it's high priority, but let's add that to the backlog

@mishamyte mishamyte added enhancement New feature or request and removed bug Something isn't working labels May 8, 2024
@mishamyte mishamyte changed the title Issue not reported Loki Url is not validated on bootstrap May 8, 2024
@mishamyte mishamyte added this to the Backlog milestone May 8, 2024
@frsavard
Copy link
Author

frsavard commented May 8, 2024

What is the way to find out what is happening and why Loki is not receiving anything? Is there any configuration, or a logger to activate to understand why it is not sending to http://localhost:3100?

@mishamyte
Copy link
Member

I think just a standard SelfLog could be useful.

Probably that could help you also: Common problems
?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants