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

Telemetry stats event for self hosted instance on midnight #1471

Merged
merged 7 commits into from
Feb 27, 2024

Conversation

akhilmhdh
Copy link
Member

@akhilmhdh akhilmhdh commented Feb 26, 2024

Description 📣

  1. For self hosted infisical a stats event will be captured at every midnight to understand our users and no other telemetry event will be captured.
  2. While making this change had to update server config to use redis and found out a major race condition that could happen

On fresh bootup in replication there could be two server cfg rows created, rare but possible. Thus we keep server cfg with an id of 00000 and then fetch that one always.

  1. Fixed another one while working on instance id, that @DanielHougaard reported to once that the zod generated db schema asks for value even when default is provided. The change is instead of zod.infer -> zod.input for insert and update. That's the schema changes most

Type ✨

  • Bug fix
  • New feature
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@akhilmhdh akhilmhdh added the 🧨 backend This would need backend changes. label Feb 26, 2024
@akhilmhdh akhilmhdh self-assigned this Feb 26, 2024
@maidul98
Copy link
Collaborator

In the future, please try to separate into separate PRs. The shorter the PR, the quicker it is to review

@akhilmhdh
Copy link
Member Author

@maidul98 yah but this one was depending on the other change. All the changes are related to this PR. Except the schema file auto generated changes the PR is small

Copy link
Collaborator

@maidul98 maidul98 left a comment

Choose a reason for hiding this comment

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

Noticed a few typos, I use https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker and it works great, you should use it too.

I also saw that you removed created/updated at fields from config api and it looks like these fields are not used by the frontend so it should be fine to be breaking.

Made some other minor edits but otherwise looks good!

const startTelemetryCheck = async () => {
// this is a fast way to check its cloud or not
if (appCfg.LICENSE_SERVER_KEY) return;
// clear previous job
Copy link
Collaborator

Choose a reason for hiding this comment

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

LICENSE_SERVER_KEY is only supplied for enterprise self host. I had switched it to INFISICAL_CLOUD

@maidul98 maidul98 merged commit 8d8e23a into Infisical:main Feb 27, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧨 backend This would need backend changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants