Updates to Elastic logging

This commit is contained in:
Ske
2021-06-10 14:21:05 +02:00
parent ae9ed0f4ee
commit ae82bb4168
18 changed files with 150 additions and 97 deletions

View File

@@ -16,6 +16,7 @@ using Serilog.Context;
namespace PluralKit.Bot
{
// TODO: phase this out; it currently still handles metrics but that needs to be moved to Myriad probably?
public class DiscordRequestObserver: IObserver<KeyValuePair<string, object>>
{
private readonly IMetrics _metrics;
@@ -77,6 +78,8 @@ namespace PluralKit.Bot
{
var endpoint = GetEndpointName(response.RequestMessage);
// (see phase-out notice at top of file)
/*
using (LogContext.PushProperty("Elastic", "yes?"))
{
if ((int) response.StatusCode >= 400)
@@ -101,6 +104,7 @@ namespace PluralKit.Bot
response.ReasonPhrase,
activity.Duration.TotalMilliseconds);
}
*/
if (IsDiscordApiRequest(response))
{