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

fix: add retry to sendMetric to avoid connection errors #145

Merged

Conversation

enzomerca
Copy link
Contributor

What problem is this solving?

We are currently seeing a lot of Error to send metrics from auth metric on opensearch logs with the following details:

...
"method":"post",
"timeout":0,
"url":"https://rc.vtex.com/api/analytics/schemaless-events"},
"request":{},
"isAxiosError":true,
"name":"Error",
"message":"Client network socket disconnected before secure TLS connection was established",
...

This PR adds retries to this post call to mitigate connection errors.

How to test it?

Change an organization detail on admin and check a metric for updating organization is sent
Workspace

@enzomerca enzomerca requested a review from a team February 7, 2024 13:16
@vtex-io-docs-bot
Copy link

vtex-io-docs-bot bot commented Feb 7, 2024

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

Copy link

vtex-io-ci-cd bot commented Feb 7, 2024

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

Copy link

github-actions bot commented Feb 7, 2024

Messages
📖 ❤️ Thanks!
📖

🎉 PR additions = 77, PR deletions = 2

Generated by 🚫 dangerJS against 17f71e5

Copy link

sonarqubecloud bot commented Feb 7, 2024

@@ -1,6 +1,8 @@
import axios from 'axios'

const ANALYTICS_URL = 'https://rc.vtex.com/api/analytics/schemaless-events'
Copy link
Contributor

@Rudge Rudge Feb 7, 2024

Choose a reason for hiding this comment

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

One thing that I saw in the internal-docs, it is the host for ingestion data. We are using rc.vtex but we should use analytics.vtex as doc. After that, I asked for analytics-support and they confirmed the host in the thread. Maybe it is the cause of the error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed offline, apparently "normal" IO apps do not have access to analytics.vtex.com, only IO Infra apps.
We decided to keep this URL for now and if we keep seeing errors, we can reachout to #analytics-support and see what can be done.

@enzomerca enzomerca merged commit 0d34b5d into master Feb 7, 2024
14 checks passed
@enzomerca enzomerca deleted the fix/B2BTEAM-1558-add-retries-to-send-metric-function branch February 7, 2024 14:55
Copy link

vtex-io-ci-cd bot commented Feb 7, 2024

Your PR has been merged! App is being published. 🚀
Version 0.48.0 → 0.48.1

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy vtex.b2b-organizations-graphql@0.48.1

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. 📖

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