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(server): add tunnel time metric to opt-in server usage report #1551

Merged
merged 11 commits into from
Oct 18, 2024

Conversation

sbruens
Copy link
Contributor

@sbruens sbruens commented May 21, 2024

No description provided.

@sbruens sbruens force-pushed the sbruens/optin-metrics-tunneltime branch from 87800fa to 8a911f0 Compare May 21, 2024 03:15
@sbruens sbruens marked this pull request as ready for review May 21, 2024 15:31
@sbruens sbruens requested a review from fortuna as a code owner May 21, 2024 15:31
src/shadowbox/server/shared_metrics.ts Outdated Show resolved Hide resolved
Base automatically changed from sbruens/optin-metrics to sbruens/refactor-tests October 16, 2024 14:05
@sbruens sbruens force-pushed the sbruens/optin-metrics-tunneltime branch from 6ed7585 to 5341e1a Compare October 16, 2024 15:11
@sbruens sbruens requested a review from a team as a code owner October 16, 2024 15:11
@sbruens sbruens changed the base branch from sbruens/refactor-tests to sbruens/optin-asn October 16, 2024 15:12
src/shadowbox/server/shared_metrics.ts Outdated Show resolved Hide resolved
src/shadowbox/server/shared_metrics.ts Outdated Show resolved Hide resolved
src/shadowbox/server/shared_metrics.ts Outdated Show resolved Hide resolved
src/shadowbox/server/shared_metrics.ts Outdated Show resolved Hide resolved
src/shadowbox/server/shared_metrics.ts Outdated Show resolved Hide resolved
src/shadowbox/server/shared_metrics.ts Outdated Show resolved Hide resolved
src/shadowbox/server/shared_metrics.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot added size/S and removed size/M labels Oct 16, 2024
@sbruens sbruens force-pushed the sbruens/optin-metrics-tunneltime branch from cbf2e21 to aa8f8f2 Compare October 16, 2024 19:16
@sbruens sbruens force-pushed the sbruens/optin-metrics-tunneltime branch from aa8f8f2 to 94c2219 Compare October 16, 2024 19:17
Copy link
Contributor Author

@sbruens sbruens left a comment

Choose a reason for hiding this comment

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

Took a different approach. I think much cleaner and addresses most of your comments I think. PTAL.

src/shadowbox/server/shared_metrics.ts Outdated Show resolved Hide resolved
src/shadowbox/server/shared_metrics.ts Outdated Show resolved Hide resolved
@sbruens sbruens requested a review from fortuna October 17, 2024 16:22
@github-actions github-actions bot added size/M and removed size/S labels Oct 17, 2024
Base automatically changed from sbruens/optin-asn to master October 17, 2024 17:05
usage.push({country, inboundBytes, asn});
// Return both data bytes and tunnel time information with a single
// Prometheus query, by using a custom "metric_type" label.
const queryResponse = await this.prometheusClient.query(`
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is an ok solution, though I don't consider good practice to mix data of different types. Here we are creating a single time series with different units and meaning. And later split them again. I'd rather keep them as separate time series, as it's a lot clearer.
I also wonder if this approach affects performance somehow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fortuna Ok let me try something else. How about this?

@sbruens sbruens merged commit e416938 into master Oct 18, 2024
10 checks passed
@sbruens sbruens deleted the sbruens/optin-metrics-tunneltime branch October 18, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants