Feat: Update the logger config to show the parent_id

This commit is contained in:
Manendra Pal Singh
2026-01-28 21:29:37 +05:30
parent a42159ddb4
commit 8948479dea
9 changed files with 104 additions and 13 deletions

View File

@@ -53,6 +53,9 @@ const (
// ContextKeyModuleID is the context key for storing and retrieving the model ID from a request context.
ContextKeyModuleID ContextKey = "module_id"
// ContextKeyParentID is the context key for storing and retrieving the parent ID from a request context
ContextKeyParentID ContextKey = "parent_id"
)
var contextKeys = map[string]ContextKey{
@@ -60,6 +63,7 @@ var contextKeys = map[string]ContextKey{
"message_id": ContextKeyMsgID,
"subscriber_id": ContextKeySubscriberID,
"module_id": ContextKeyModuleID,
"parent_id": ContextKeyParentID,
}
// ParseContextKey converts a string into a valid ContextKey.
@@ -100,6 +104,8 @@ const (
RoleGateway Role = "gateway"
// RoleRegistery represents the Registry that maintains network participant details.
RoleRegistery Role = "registery"
// RoleCDS represents the CDS for that network
RoleCDS Role = "cds"
)
var validRoles = map[Role]bool{
@@ -107,6 +113,7 @@ var validRoles = map[Role]bool{
RoleBPP: true,
RoleGateway: true,
RoleRegistery: true,
RoleCDS: true,
}
// UnmarshalYAML implements custom YAML unmarshalling for Role to ensure only valid values are accepted.
@@ -184,4 +191,4 @@ type Message struct {
// Response represents the main response structure.
type Response struct {
Message Message `json:"message"`
}
}