Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

trace the scope name as a JSON object #45

Closed
wants to merge 2 commits into from
Closed

Conversation

marten-seemann
Copy link
Contributor

This allows for easy filtering using standard JSON tooling (e.g. jq) to filter for a specific scope.

The idea behind this is that we get rid of the conversion step to get an event log (#43).

Builds on top of #44.

This allows for easy filtering using standard JSON tooling (e.g. jq) to
filter for a specific scope.
@marten-seemann marten-seemann requested a review from vyzo June 7, 2022 09:24
if s.SpanID > 0 {
class = addToClass(class, "span")
}
return json.Marshal(struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's super annoying that standard library encoding/json still doesn't allow allocation-free marshaling of arbitrary structs. At leasts it's a stack allocation though.

Copy link
Collaborator

@vyzo vyzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure i like this, but i can be convinced.

ps = newResourceScope(l, nil, fmt.Sprintf("%s.peer:%s", s.name, p), s.rcmgr.trace, s.rcmgr.metrics)
sn := s.name
sn.Peer = p
ps = newResourceScope(l, nil, sn, s.rcmgr.trace, s.rcmgr.metrics)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, whats the name here?

ps = newResourceScope(l, nil, fmt.Sprintf("%s.peer:%s", s.name, p), s.rcmgr.trace, s.rcmgr.metrics)
sn := s.name
sn.Peer = p
ps = newResourceScope(l, nil, sn, s.rcmgr.trace, s.rcmgr.metrics)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants