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

feat(telemetry): track local payments #2610

Closed
wants to merge 11 commits into from

Conversation

beniaminmunteanu
Copy link
Member

@beniaminmunteanu beniaminmunteanu commented Mar 26, 2024

Changes proposed in this pull request

This PR moves the amount metrics collection from the accounting service back to the ILP connector, as an extra middleware.

Context

All context is provided in the linked issue
fixes #2531 #2505

Checklist

Note

if you enable telemetry on the playground containers, you should be able to see the metrics output of your transactions here

beniaminmunteanu and others added 4 commits March 22, 2024 14:09
* ci: WIP new integration test workflow

no idea what the docker command will do...

* fix: deps not found, add debug step

* ci: add debug step

* ci: use docker compose (v2) instead of docker-compose (v1)

* chore: add setup from seed debug logs

* ci: rework jobs into steps

* chore: rm todo comment

* chore: rm debug log

* chore: shorten timeout in integration test

* refactor: move integreation test job to lint_test_build

* chore: test hostile cmd in ci, no setup host step

* Revert "chore: test hostile cmd in ci, no setup host step"

This reverts commit 5f529b2.
@beniaminmunteanu beniaminmunteanu self-assigned this Mar 26, 2024
@github-actions github-actions bot added type: tests Testing related pkg: backend Changes in the backend package. type: source Changes business logic labels Mar 26, 2024
Copy link

netlify bot commented Mar 26, 2024

Deploy Preview for brilliant-pasca-3e80ec ready!

Name Link
🔨 Latest commit 5e5b8f9
🔍 Latest deploy log https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/660c15126f041e00089588cc
😎 Deploy Preview https://deploy-preview-2610--brilliant-pasca-3e80ec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@mkurapov mkurapov left a comment

Choose a reason for hiding this comment

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

What would you like to do re: 'transactions_total' metric? Should we only call it if the receiver is at a remote rafiki?

packages/backend/src/index.ts Outdated Show resolved Hide resolved
test/integration/lib/config.ts Show resolved Hide resolved
@beniaminmunteanu
Copy link
Member Author

Based on these changes,
transactions_amount & transactions_total both fire on the sending side of a transaction, both for remote and local.

@mkurapov also brought up having 4 metrics, 2 for local and 2 for remote.
I created a separate issue for that, as this PR is meant to enable local payments tracking so that we can see rafiki.money amounts metrics

Copy link
Contributor

@mkurapov mkurapov left a comment

Choose a reason for hiding this comment

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

Looks good, just some test comments.

const collectAmountSpy = jest
.spyOn(telemetry, 'collectTelemetryAmount')
.mockImplementation(() => {
expect(nextCalled).toBe(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I understand, this ensures that next was called before the collectTelemetryAmount 👍

I was looking at some more of this, and this is something that exists in jest-extended, but not in the standard jest lib unfourtunately.
We can keep this test as is.

@beniaminmunteanu beniaminmunteanu force-pushed the 2531-telemetry-local-payments branch from 7095b15 to 566e1be Compare April 2, 2024 12:38
@beniaminmunteanu
Copy link
Member Author

closed in favor of #2626 (which is a fresh duplicate). Will delete this source branch once that one gets merged

@beniaminmunteanu beniaminmunteanu deleted the 2531-telemetry-local-payments branch April 3, 2024 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: backend Changes in the backend package. type: source Changes business logic type: tests Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Telemetry - Tracking Local Payments
3 participants