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

Tear out environment hits data from the Lagoon API #3135

Open
seanhamlin opened this issue May 11, 2022 · 1 comment
Open

Tear out environment hits data from the Lagoon API #3135

seanhamlin opened this issue May 11, 2022 · 1 comment
Labels
1-api-auth API & Authentication subsystem 4-metrics-alerting Metrics & Alerting subsytem

Comments

@seanhamlin
Copy link
Contributor

This appears to be a vestigial from a time when there was a billing system directly integrated into Lagoon.

https://github.com/uselagoon/lagoon/blob/main/services/api/src/models/environment.ts#L180-L543

The hits data sends 2 queries to ElasticSearch (or OpenSearch) and then aggregates by hour, and attempts to fill in the gaps. This is a complex operation, and does not work at scale (I was running it over 449 environments using the Lagoon API). Confusing, when it does not work, the API just returns 0 hits, and no error messages. So the data is wrong, and you have no way of knowing if this is the case.

The API is scoped to platform administrators only, so impact will be limited.

Proposal

Tear out this ElasticSearch querying in an API functionality from Lagoon. I would be a fan of Lagoon storing aggregated data, e.g. hits per day per environment, and a new Lagoon API that could surface that information. But that could come later.

@seanhamlin seanhamlin added 1-api-auth API & Authentication subsystem 4-metrics-alerting Metrics & Alerting subsytem labels May 11, 2022
@tobybellwood
Copy link
Member

Having tight lagoon<>OpenSearch bonds is undesirable, will progress this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-api-auth API & Authentication subsystem 4-metrics-alerting Metrics & Alerting subsytem
Projects
None yet
Development

No branches or pull requests

2 participants