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

Define custom Loki endpoint #54

Open
mihaj opened this issue Aug 17, 2021 · 1 comment
Open

Define custom Loki endpoint #54

mihaj opened this issue Aug 17, 2021 · 1 comment

Comments

@mihaj
Copy link

mihaj commented Aug 17, 2021

@josephwoodward can we extend the LokiRoutes with an additional method that will take a custom URL. We have a case where we do not use the default Loki push endpoint. Like this:

    public static class LokiRouteBuilder
    {
        public static string BuildPostUri(string host)
        {
            return host.Substring(host.Length - 1) != "/" ? $"{host}{PostDataUri}" : $"{host.TrimEnd('/')}{PostDataUri}";
        }

        public static string BuildPostUri(string host, string uri)
        {
            return host.Substring(host.Length - 1) != "/" ? $"{host}{uri}" : $"{host.TrimEnd('/')}{uri}";
        }

        public const string PostDataUri = "/api/prom/push";
    }

Let me know, and I can create a pull request.

@josephwoodward
Copy link
Owner

Hi @mihaj, sorry I missed your post here. Yes please, such a feature would be great!

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