Releases: serilog-contrib/serilog-sinks-grafana-loki
Releases · serilog-contrib/serilog-sinks-grafana-loki
v8.0.0-beta.0
Implemented:
- Unify labels behavior to simplify understanding (redesign log level data)
- Use LokiJsonTextFormatter as default formatter
- Possibility to translate properties to a part of message
- Missing filtrationMode bloats Loki labels
- Redesign concept of mapping to labels
- Add possibility to customize renaming strategy
Breaking changes:
LokiJsonTextFormatteris used as a default text formatter. Removed propertyoutputTemplate- Removed interface
ILabelAwareTextFormatter - Redesigned approach of mapping properties to labels: removed
filtrationModeandfiltrationLabels, addedpropertiesAsLabels - Properties, mapped to the labels won't be passed to the text formatter
- Redesigned behavior of log level data (
levellabel): removedcreateLevelLabel - Added
IReservedPropertyRenamingStrategyandreservedPropertyRenamingStrategyconfiguration property
v7.1.1
v7.1.0
v7.1.0-beta.0
v7.0.2
v7.0.1
v7.0.0
Implemented:
- Do not create level label by default
- Indexed placeholders in message template are translated to label keys that are not accepted by Loki
- Add NRT to the sink
Breaking changes:
- Now
levellabel is not created by default
To keep previous behavior set createLevelLabel to true at sink configuration
.WriteTo.GrafanaLoki(
"http://localhost:3100",
createLevelLabel: true){
"Name": "GrafanaLoki",
"Args": {
"uri": "http://localhost:3100",
"createLevelLabel": true
}
}v6.0.1
v6.0.0
Implemented:
- Remove dependency from Serilog.Sinks.Http and implement infrastructure code
- Implement client, which will use gzip for logs compression
Breaking changes:
- Deprecated dependency
Serilog.Sinks.Http - Replaced
IHttpClientwithILokiHttpClient
Migration guide:
You will have to migrate your code if you've implemented your own version ofILokiHttpClient. The signature of methodILokiHttpClient.PostAsync(before upgradeIHttpClient.PostAsynchas changed from Task PostAsync(string, HttpContent) to Task PostAsync(string, Stream).
Before upgrade:
public class CustomLokiHttpClient : IHttpClient
{
// Code removed for brevity...
public async Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content)
{
// Here you probably have some code updating the content,
// and then you send the request
return await httpClient.PostAsync(requestUri, content)
}
}After update:
public class CustomLokiHttpClient : ILokiHttpClient
{
// Code removed for brevity...
public async Task<HttpResponseMessage> PostAsync(string requestUri, Stream contentStream)
{
using var content = new StreamContent(contentStream);
// Here you probably have some code updating the content,
// and then you send the request
return await httpClient.PostAsync(requestUri, content)
}
}v6.0.0-beta.0
Implemented:
- Remove dependency from Serilog.Sinks.Http and implement infrastructure code
- Implement client, which will use gzip for logs compression
Breaking changes:
- Deprecated dependency
Serilog.Sinks.Http - Replaced
IHttpClientwithILokiHttpClient
Migration guide:
You will have to migrate your code if you've implemented your own version ofILokiHttpClient. The signature of methodILokiHttpClient.PostAsync(before upgradeIHttpClient.PostAsynchas changed from Task PostAsync(string, HttpContent) to Task PostAsync(string, Stream).
Before upgrade:
public class CustomLokiHttpClient : IHttpClient
{
// Code removed for brevity...
public async Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content)
{
// Here you probably have some code updating the content,
// and then you send the request
return await httpClient.PostAsync(requestUri, content)
}
}After update:
public class CustomLokiHttpClient : ILokiHttpClient
{
// Code removed for brevity...
public async Task<HttpResponseMessage> PostAsync(string requestUri, Stream contentStream)
{
using var content = new StreamContent(contentStream);
// Here you probably have some code updating the content,
// and then you send the request
return await httpClient.PostAsync(requestUri, content)
}
}