Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metadata to sqes, cqes, and coroutines #90

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Conversation

dfarr
Copy link
Member

@dfarr dfarr commented Oct 20, 2023

Metadata holds on to a transaction id and tags. The transaction id can be used to track a request across our system with debug logging, for example.

./resonate dst run --log-level -4

level=DEBUG msg=api:enqueue sqe="SQE(metadata=Metadata(tid=3, tags=map[api:dst name:create-promise]), submission=CreatePromise(id=193, idempotencyKey=711, timeout=790, strict=true))"
level=DEBUG msg=api:dequeue sqe="SQE(metadata=Metadata(tid=3, tags=map[api:dst name:create-promise]), submission=CreatePromise(id=193, idempotencyKey=711, timeout=790, strict=true))"
level=DEBUG msg=scheduler:add coroutine="Coroutine(metadata=Metadata(tid=3, tags=map[api:dst name:create-promise]))"
level=DEBUG msg=aio:enqueue sqe="SQE(metadata=Metadata(tid=3, tags=map[aio:store api:dst name:create-promise]), submission=Store(transaction=Transaction(commands=[ReadPromise])))"
level=DEBUG msg=aio:dequeue cqe="CQE(metadata=Metadata(tid=3, tags=map[aio:store api:dst name:create-promise]), completion=Store(results=[ReadPromise]), error=<nil>)"
level=DEBUG msg=aio:enqueue sqe="SQE(metadata=Metadata(tid=3, tags=map[aio:store api:dst name:create-promise]), submission=Store(transaction=Transaction(commands=[CreatePromise])))"
level=DEBUG msg=aio:dequeue cqe="CQE(metadata=Metadata(tid=3, tags=map[aio:store api:dst name:create-promise]), completion=Store(results=[CreatePromise]), error=<nil>)"
level=INFO msg=DST t=0|2 tid=3 req="CreatePromise(id=193, idempotencyKey=711, timeout=790, strict=true)" res="CreatePromise(status=201, promise=Promise(id=193, state=PENDING, param=Value(headers=map[0:578.0 1:578.1], data=159), value=Value(headers=map[], data=), timeout=790, idempotencyKeyForCreate=711, idempotencyKeyForUpdate=<nil>))" err=<nil> ok=true
level=DEBUG msg=scheduler:rmv coroutine="Coroutine(metadata=Metadata(tid=3, tags=map[aio:store api:dst name:create-promise]))"

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Merging #90 (5d62744) into main (a819787) will increase coverage by 2.64%.
Report is 1 commits behind head on main.
The diff coverage is 71.60%.

@@            Coverage Diff             @@
##             main      #90      +/-   ##
==========================================
+ Coverage   64.54%   67.18%   +2.64%     
==========================================
  Files          55       57       +2     
  Lines        5816     5949     +133     
==========================================
+ Hits         3754     3997     +243     
+ Misses       1786     1667     -119     
- Partials      276      285       +9     
Files Coverage Δ
internal/aio/aio.go 70.49% <100.00%> (ø)
internal/aio/aio_dst.go 70.96% <100.00%> (ø)
internal/app/coroutines/createSubscription.go 78.78% <100.00%> (ø)
internal/app/coroutines/deleteSubscription.go 88.09% <100.00%> (ø)
internal/app/coroutines/echo.go 100.00% <100.00%> (ø)
internal/app/coroutines/notifiySubscriptions.go 69.18% <100.00%> (+50.51%) ⬆️
internal/app/coroutines/readSubscriptions.go 85.18% <100.00%> (ø)
internal/app/coroutines/searchPromises.go 89.74% <100.00%> (ø)
internal/app/coroutines/timeoutPromise.go 84.61% <100.00%> (+82.69%) ⬆️
internal/app/coroutines/timeoutPromises.go 91.66% <100.00%> (+0.55%) ⬆️
... and 21 more

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dfarr dfarr merged commit 99c7c5c into main Nov 2, 2023
4 checks passed
@dfarr dfarr deleted the feature/metadata branch November 2, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant