morph: Add tracing for morph queries #1613
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1613
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "achuprov/frostfs-node:feat/morph_trace"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The trace is added only when a request is made to neo-go. If the data is in the cache, no entry will be added.
For example, the
object put
operation with disabledmorph cache
:Signed-off-by: Alexander Chuprov a.chuprov@yadro.com
56a463e558
to9e1925f70c
morph: Add tracing for morph queries in neo-goto morph: Add tracing for morph queries@ -166,3 +167,3 @@
}
func newCachedContainerStorage(v container.Source, ttl time.Duration, containerCacheSize uint32) ttlContainerStorage {
func newCachedContainerStorage(ctx context.Context, v container.Source, ttl time.Duration, containerCacheSize uint32) ttlContainerStorage {
In this case, it is necessary to use not the context from the
newCachedContainerStorage
method, but from the call:This tracing is created during the startup and initialization of the node. Do we want to explore the node startup process using tracing in the future?
func newCachedContainerStorage(ctx context.Context
- this startup context will be used for every request. I think it's wrong.fixed
@ -43,3 +46,3 @@
}
func (m *morphFrostfsIDCache) GetSubject(addr util.Uint160) (*client.Subject, error) {
func (m *morphFrostfsIDCache) GetSubject(ctx context.Context, addr util.Uint160) (*client.Subject, error) {
This assertion is violated:
If the data is in the cache, no entry will be added.
I forgot to remove these traces. They remained after I tested the cache functionality.
@ -56,3 +63,3 @@
}
subj, err := m.subjProvider.GetSubject(addr)
ctx, span1 := tracing.StartSpanFromContext(ctx, "subjProvider.GetSubject",
I would expect to see this span inside the subjProvider.
Already
35b711e9f9/pkg/morph/client/frostfsid/subject.go (L21)
9e1925f70c
to35b711e9f9
35b711e9f9
to84df5bea06
84df5bea06
to45d42d5a83
45d42d5a83
to493667a1b7
@ -124,3 +124,3 @@
func (fn *innerRingFetcherWithNotary) InnerRingKeys() ([][]byte, error) {
func (fn *innerRingFetcherWithNotary) InnerRingKeys(_ context.Context) ([][]byte, error) {
keys, err := fn.sidechain.NeoFSAlphabetList()
Does
NeoFSAlphabetList
make RPC call? If yes, then please add tracing span there. InnerRing keys could be request for every object request.Added
Great job!
493667a1b7
toca50693ac6
ca50693ac6
to716494c411
New commits pushed, approval review dismissed automatically according to repository settings
716494c411
to1f44f61238
@ -45,2 +48,3 @@
// storage.ErrNotFound error is returned.
func (c *Client) Get(cid []byte) (*containercore.Container, error) {
func (c *Client) Get(ctx context.Context, cid []byte) (*containercore.Container, error) {
_, span := tracing.StartSpanFromContext(ctx, "GetContainer",
Please, remove this span in favor of generic
TestInvoke
one.@ -208,1 +210,3 @@
func (s StaticClient) TestInvoke(prm TestInvokePrm) ([]stackitem.Item, error) {
func (s StaticClient) TestInvoke(ctx context.Context, prm TestInvokePrm) ([]stackitem.Item, error) {
_, span := tracing.StartSpanFromContext(ctx, prm.method,
trace.WithAttributes())
I think span name should be generic and attributes should contain method.
Different contracts may have methods with the same name.
I agree that this is conceptually correct. However, the Jaeger UI displays the operation name by default, while attributes are hidden. This makes the trace less visually clear.
What about the name format
Morph.TestInvoke.ContractName
?We should not make our decisions based on the default behaviour of some UI.
Having multiple
get
strings won't make things clear.Even though we do not have a contract name here, the event is
TestInvoke
, notget
orgetSubject
.Ideally, sth like
/morph/TestInvoke/netmap.snapshot
would be nice, but we can postpone this.@dstepanov-yadro other thoughts?
Looks ok to me, but we need to provide contract name somehow (another refactoring).
I think that if
TestInvoke
's parent span will be defined and it will be clear, then it is ok to have only TestInvoke span.1f44f61238
tofbd08932db
fbd08932db
toc64ffe2fb3
c64ffe2fb3
to2ef8c21e90
@ -64,12 +64,11 @@ func (m *morphFrostfsIDCache) GetSubject(addr util.Uint160) (*client.Subject, er
}
return nil, err
}
unrelated to the commit
@ -54,8 +55,7 @@ func (m *morphFrostfsIDCache) GetSubject(addr util.Uint160) (*client.Subject, er
hit = true
return result.subject, result.err
}
unnessesary change
Please, fix 2 issues and we will merge
2ef8c21e90
toeae9debc14
New commits pushed, approval review dismissed automatically according to repository settings
eae9debc14
to9b113c3156