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: data api #57

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

feat: data api #57

wants to merge 8 commits into from

Conversation

jrasm91
Copy link
Contributor

@jrasm91 jrasm91 commented Dec 19, 2024

No description provided.

Copy link

github-actions bot commented Dec 19, 2024

🚀 Preview deployed to:

@jrasm91 jrasm91 force-pushed the feat/data-api branch 5 times, most recently from d5a4a3f to 36f2cd4 Compare December 19, 2024 20:05
@zackpollard zackpollard force-pushed the feat/data-api branch 3 times, most recently from bff8d15 to 43047c6 Compare January 9, 2025 12:00
@zackpollard zackpollard force-pushed the feat/data-api branch 2 times, most recently from df7a889 to 594ccc2 Compare January 9, 2025 12:17
Copy link
Contributor Author

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

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

LGTM

backend/src/index.ts Show resolved Hide resolved
Comment on lines +37 to +51
const send = async () => {
const response = await fetch(`${this.influxApiUrl}/write`, {
method: 'POST',
body: metrics,
headers: {
Authorization: `Token ${this.influxApiToken}`,
},
});
await response.body?.cancel();
if (response.status !== 204) {
throw new Error(`InfluxDB write failed with status ${response.status}`);
}
};

return send();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if we need to define this method and then call it right away. We can just remove the method wrapper in that case.

@@ -8,6 +8,5 @@ locals {
domain_prefix = "${local.domain_stage}${local.domain_env}"
domain = "data.${local.domain_prefix}immich.app"

monitoring_url = var.env == "prod" ? "https://cf-workers.monitoring.immich.cloud" : "https://cf-workers.monitoring.dev.immich.cloud"
monitoring_token = var.vmetrics_api_token
vmetrics_data_api_url = var.env == "prod" ? "https://data.immich.cloud" : "https://data.immich.cloud"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I assume this should be something else for dev

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.

3 participants