fetch single metric

This commit is contained in:
boufni95 2025-01-17 17:54:50 +00:00
parent a4e9a23d74
commit db3c27c7f2
13 changed files with 137 additions and 19 deletions

View file

@ -172,7 +172,7 @@ service LightningPub {
option (nostr) = true;
}
rpc GetUsageMetrics(structs.Empty) returns (structs.UsageMetrics) {
rpc GetUsageMetrics(structs.UsageMetricReq) returns (structs.UsageMetrics) {
option (auth_type) = "Metrics";
option (http_method) = "post";
option (http_route) = "/api/reports/usage";

View file

@ -33,6 +33,17 @@ message ErrorStats {
ErrorStat past1m = 5;
}
message MetricsFile {
string app_id = 1;
string metrics_name = 2;
int64 page = 3;
}
message UsageMetricReq {
optional int64 limit = 1;
optional MetricsFile metrics_file = 2;
}
message UsageMetric {
int64 processed_at_ms = 1;
int64 parsed_in_nano = 2;