8000 Fix messaging metrics by stnguyen90 · Pull Request #8674 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix messaging metrics #8674

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

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Fix messaging metrics #8674

merged 2 commits into from
Sep 17, 2024

Conversation

stnguyen90
Copy link
Contributor
@stnguyen90 stnguyen90 commented Sep 17, 2024

What does this PR do?

Because $deliveryErrors is an array, adding an int to it here:

->addMetric(METRIC_MESSAGES, ($deliveredTotal + $deliveryErrors))

results in a fatal error:

image

We need to get a count before using it in metrics.

In addition, this PR ensure the Messaging provider is set in the metric rather than having:

+-----+----------------------------------+-------------------------+-------------------------+--------------+-----------------------------+---------+--------+-------------------------+--------+
| _id | _uid                             | _createdAt              | _updatedAt              | _permissions | metric                      | region  | value  | time                    | period |
+-----+----------------------------------+-------------------------+-------------------------+--------------+-----------------------------+---------+--------+-------------------------+--------+
|  40 | 743a569db21234b4d6a5d99d1a4569bf | 2024-09-17 19:10:35.878 | 2024-09-17 19:10:35.878 | []           | messages.email.             | default |      1 | 2024-09-17 19:00:00.000 | 1h     |
|  41 | dc1b97c8c61a35583838b5cf7f5b6507 | 2024-09-17 19:10:35.880 |
8000
 2024-09-17 19:10:35.880 | []           | messages.email.             | default |      1 | 2024-09-17 00:00:00.000 | 1d     |
|  42 | 2e76cb7a791f2a551c4d914e6c1d18d7 | 2024-09-17 19:10:35.882 | 2024-09-17 19:10:35.882 | []           | messages.email.             | default |      1 | NULL                    | inf    |
|  43 | 1baad8294fb1bcf8c15770575c2a5028 | 2024-09-17 19:10:35.885 | 2024-09-17 19:10:35.885 | []           | messages.email..sent        | default |      1 | 2024-09-17 19:00:00.000 | 1h     |
|  44 | 8105546c780aa595f837f84ce68a2ed8 | 2024-09-17 19:10:35.887 | 2024-09-17 19:10:35.887 | []           | messages.email..sent        | default |      1 | 2024-09-17 00:00:00.000 | 1d     |
|  45 | 59365e4664102fdb1347e523c4516c75 | 2024-09-17 19:10:35.889 | 2024-09-17 19:10:35.889 | []           | messages.email..sent        | default |      1 | NULL                    | inf    |

Test Plan

Manually tested locally and I was able to successfully send a message:

image

Logs also don't show any error:

image

and stats are populating:

image

Related PRs and Issues

None

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

`$deliveryErrors` is an array so we need to get a count before using it
in metrics.
@stnguyen90 stnguyen90 marked this pull request as ready for review September 17, 2024 19:03
Copy link

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
libexpat 2.6.2-r0 CVE-2024-45490 CRITICAL
libexpat 2.6.2-r0 CVE-2024-45491 CRITICAL
libexpat 2.6.2-r0 CVE-2024-45492 CRITICAL
py3-setuptools 68.2.2-r0 CVE-2024-6345 HIGH
py3-setuptools-pyc 68.2.2-r0 CVE-2024-6345 HIGH
pyc 3.11.9-r0 CVE-2024-6232 HIGH
pyc 3.11.9-r0 CVE-2024-7592 HIGH
python3 3.11.9-r0 CVE-2024-6232 HIGH
python3 3.11.9-r0 CVE-2024-7592 HIGH
python3-pyc 3.11.9-r0 CVE-2024-6232 HIGH
python3-pyc 3.11.9-r0 CVE-2024-7592 HIGH
python3-pycache-pyc0 3.11.9-r0 CVE-2024-6232 HIGH
python3-pycache-pyc0 3.11.9-r0 CVE-2024-7592 HIGH
github.com/docker/docker v27.1.0+incompatible CVE-2024-41110 CRITICAL
stdlib 1.21.11 CVE-2024-34156 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

Copy link
github-actions bot commented Sep 17, 2024

✨ Benchmark results

  • Requests per second: 1,384
  • Requests with 200 status code: 249,109
  • P99 latency: 0.082900788

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,384 1,398
200 249,109 251,613
P99 0.082900788 0.080418674

@stnguyen90 stnguyen90 changed the title fix(messaging): use count of delivery errors for metrics Fix messaging metrics Sep 17, 2024
Copy link

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
libexpat 2.6.2-r0 CVE-2024-45490 CRITICAL
libexpat 2.6.2-r0 CVE-2024-45491 CRITICAL
libexpat 2.6.2-r0 CVE-2024-45492 CRITICAL
py3-setuptools 68.2.2-r0 CVE-2024-6345 HIGH
py3-setuptools-pyc 68.2.2-r0 CVE-2024-6345 HIGH
pyc 3.11.9-r0 CVE-2024-6232 HIGH
pyc 3.11.9-r0 CVE-2024-7592 HIGH
python3 3.11.9-r0 CVE-2024-6232 HIGH
python3 3.11.9-r0 CVE-2024-7592 HIGH
python3-pyc 3.11.9-r0 CVE-2024-6232 HIGH
python3-pyc 3.11.9-r0 CVE-2024-7592 HIGH
python3-pycache-pyc0 3.11.9-r0 CVE-2024-6232 HIGH
python3-pycache-pyc0 3.11.9-r0 CVE-2024-7592 HIGH
github.com/docker/docker v27.1.0+incompatible CVE-2024-41110 CRITICAL
stdlib 1.21.11 CVE-2024-34156 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

@stnguyen90 stnguyen90 merged commit dfeca25 into 1.6.x Sep 17, 2024
25 checks passed
@stnguyen90 stnguyen90 deleted the fix-messaging-metrics branch September 17, 2024 19:55
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.

2 participants
0