fix(logger/loki): Consistent stream labels (#304)

This commit is contained in:
iLLeniumStudios
2023-04-20 07:27:19 +02:00
committed by GitHub
parent d093805ef4
commit 373dd98655

View File

@@ -136,7 +136,7 @@ if service == 'loki' then
-- example `discord:blahblah,fivem:blahblah,license:blahblah` -> `{discord="blahblah",fivem="blahblah",license="blahblah"}`
local function convertDDTagsToKVP(tags)
if not tags or type(tags) ~= 'string' then
return {}
return {}
end
local tempTable = { string.strsplit(',', tags) } -- outputs a number index table wth k:v strings as values
local bTable = table.create(0, #tempTable) -- buffer table
@@ -191,8 +191,9 @@ if service == 'loki' then
-- initialise stream payload
local payload = {
stream = {
hostname = cache.resource,
service = event
server = hostname,
resource = cache.resource,
event = event
},
values = {
{