spotify / XCMetrics

XCMetrics is the easiest way to collect Xcode build metrics and improve developer productivity.
https://xcmetrics.io
Other
1.1k stars 77 forks source link

Implement a BES metrics repository which proxies data to a BES backend #32

Closed zachgrayio closed 7 months ago

zachgrayio commented 3 years ago

Motivation:

We'd like to send build data to a gRPC endpoint based on Bazel's Build Event Stream. I assume this might be of value to other folks either migrating to build iOS projects with Bazel, or DevX teams supporting multiple build systems and interested in a unified solution.

This implementation is workable as-is for us and we'll be launching the alpha immediately. That said, this lives on our fork, and upstreaming isn't really a blocker for us, but we are happy to contribute it back if there is interest.

Implementation:

Based on the presence of XCMETRICS_BES_* env vars, the server now supports booting into "BES Proxy" mode in which it will send parsed xcactivity logs to the specified BES server instead of persisting to the database; this has limited the surface area of the changes to the addition of a new implementation of the MetricsRepository protocol.

As this PR also contains generated gRPC code, here's a list of the items to look at during review once the links are available.

Files to review:

BalestraPatrick commented 7 months ago

I believe this is a bit out of scope for XCMetrics at the moment. I don't think we have received many requests around this area, but I'm happy to re-evaluate if the situation changes.