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