serilog-contrib / serilog-sinks-grafana-loki

A Serilog sink sending log events to Grafana Loki
MIT License
199 stars 30 forks source link

Default value of period is not corresponding the XML-doc #147

Open mishamyte opened 2 years ago

mishamyte commented 2 years ago

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

v8.0.1

Which version of .NET are you using?

net6.0

Describe the bug

According to XML-doc, default value for period is 2 sec. According to underlying code - 1 sec

To Reproduce

-

Expected behavior

XML-doc and code behavior are similar

Log/SelfLog output or exception with stacktrace

No response

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

No response

Additional context

No response

I have read the documentation

mishamyte commented 2 years ago

This was broken when dependency to Serilog.Sinks.Http was removed

snuup commented 3 weeks ago

Apparently the configuration value is also ignored:

.WriteTo.GrafanaLoki(
   "http://localhost:3100",
   period:TimeSpan.FromMilliseconds(200) // has no effect
 )
mishamyte commented 3 weeks ago

Apparently the configuration value is also ignored:

.WriteTo.GrafanaLoki(
   "http://localhost:3100",
   period:TimeSpan.FromMilliseconds(200) // has no effect
 )

Hi @snuup,

Thank you for the report. I feel like it's not ignored, but there is a tricky part there: https://github.com/serilog-contrib/serilog-sinks-grafana-loki/blob/master/src/Serilog.Sinks.Grafana.Loki/Infrastructure/ExponentialBackoffConnectionSchedule.cs#L46

That part of code existed from the beginning of fork and prob should be revisited for sure