Add loki #740

Merged
fyrchik merged 1 commits from achuprov/frostfs-node:loki into master 2023-11-14 19:01:06 +00:00
Collaborator
Related to: https://git.frostfs.info/TrueCloudLab/frostfs-dev-env/pulls/57 https://git.frostfs.info/TrueCloudLab/frostfs-observability/pulls/5 Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
achuprov force-pushed loki from 8b1120fcb6 to 0b3e1c8872 2023-10-23 08:45:29 +00:00 Compare
acid-ant reviewed 2023-10-24 06:57:26 +00:00
@ -0,0 +3,4 @@
import (
"os"
loki_config "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/loki"
Collaborator

loki_config -> lokiConfig

loki_config -> lokiConfig
@ -103,0 +108,4 @@
loki.IsEnabled,
)
l.Logger = zap.New(core)
Collaborator

Why not to move it in logger initialization and initialize core before l?

Why not to move it in logger initialization and initialize `core` before `l`?
achuprov force-pushed loki from 0b3e1c8872 to c0ebcefec7 2023-10-29 21:27:12 +00:00 Compare
fyrchik changed title from Add loki to WIP: Add loki 2023-10-30 07:03:07 +00:00

I am making it WIP until TrueCloudLab/frostfs-observability#5/ is merged

I am making it WIP until https://git.frostfs.info/TrueCloudLab/frostfs-observability/pulls/5/ is merged
achuprov force-pushed loki from c0ebcefec7 to 7c8591f83b 2023-11-02 10:49:53 +00:00 Compare
achuprov changed title from WIP: Add loki to Add loki 2023-11-02 11:04:33 +00:00
achuprov requested review from storage-core-developers 2023-11-02 11:04:48 +00:00
achuprov requested review from storage-core-committers 2023-11-02 11:05:18 +00:00
dstepanov-yadro approved these changes 2023-11-02 13:57:55 +00:00
acid-ant approved these changes 2023-11-03 08:55:44 +00:00
fyrchik reviewed 2023-11-06 06:53:48 +00:00
@ -576,0 +578,4 @@
log.Core(),
loggerconfig.ToLokiConfig(appCfg),
)
log.SetCore(lokiCore)

We wrap our core here and then use WrapCore insideSetCore but not actually wrap anything there, it seems wrong. Do we need this SetCore at all?

We _wrap_ our core here and then use `WrapCore` inside`SetCore` but not actually wrap anything there, it seems wrong. Do we need this `SetCore` at all?
Poster
Collaborator

fixed

fixed
fyrchik marked this conversation as resolved
achuprov force-pushed loki from b7531767e9 to b364c6dc44 2023-11-10 14:49:03 +00:00 Compare
achuprov force-pushed loki from b364c6dc44 to 08e7e76643 2023-11-10 14:52:07 +00:00 Compare
achuprov force-pushed loki from 08e7e76643 to 971746d617 2023-11-10 15:05:07 +00:00 Compare
fyrchik reviewed 2023-11-13 07:15:59 +00:00
@ -27,0 +37,4 @@
// ToLokiConfig extracts loki config.
func ToLokiConfig(c *config.Config) loki.Config {
hostname, _ := os.Hostname()
time.Sleep(time.Second * 5)

Why this line?

Why this line?
Poster
Collaborator

fixed

fixed
fyrchik reviewed 2023-11-13 07:27:03 +00:00
@ -580,1 +586,4 @@
)
log.Logger = log.Logger.WithOptions(zap.WrapCore(func(_ zapcore.Core) zapcore.Core {
return lokiCore

Now, what about using lokicore.New right inside this function? log.Core() is replaced with the argument (currently _)

Now, what about using `lokicore.New` right inside this function? `log.Core()` is replaced with the argument (currently `_`)
Poster
Collaborator

fixed

fixed
aarifullin approved these changes 2023-11-13 08:26:51 +00:00
achuprov force-pushed loki from 971746d617 to 196cf46663 2023-11-13 08:42:47 +00:00 Compare
fyrchik merged commit 364f835b7e into master 2023-11-14 19:01:06 +00:00
fyrchik referenced this issue from a commit 2023-11-14 19:01:07 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#740
There is no content yet.