forked from OpenBankProject/OBP-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetrics_stream.proto
More file actions
52 lines (49 loc) · 2.37 KB
/
Copy pathmetrics_stream.proto
File metadata and controls
52 lines (49 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
syntax = "proto3";
package code.obp.grpc.metricsstream.g1;
// Server-side filters. Empty string = no filter on that field.
// Filters AND together: passing consumer_id + verb = events matching BOTH.
// url_substring matches if the event's url contains the given substring.
message StreamMetricsRequest {
string consumer_id = 1;
string user_id = 2;
string verb = 3;
string url_substring = 4;
string implemented_by_partial_function = 5;
string app_name = 6;
}
// Per-REST-call metric record, mirrors APIMetrics.saveMetric args and
// MetricJsonV600 (REST v6.0.0). Field names track REST v6.0.0 verbatim.
//
// `response_body` is intentionally omitted — can be large and contain PII;
// fetch via the REST /management/metrics endpoint if needed.
message MetricEvent {
string url = 1;
// ISO-8601 UTC, seconds precision — matches REST v6.0.0 (yyyy-MM-dd'T'HH:mm:ss'Z').
string date = 2;
int64 duration = 3;
string user_id = 4;
string username = 5;
string app_name = 6;
string developer_email = 7;
string consumer_id = 8;
string implemented_by_partial_function = 9;
string implemented_in_version = 10;
string verb = 11;
int32 status_code = 12;
string correlation_id = 13;
string source_ip = 14;
string target_ip = 15;
// Identifies which OBP instance (pod) served this request. Sourced from
// the `api_instance_id` prop — either a configured value suffixed with a
// per-JVM UUID, or a pure UUID if the prop is unset. See
// code.api.Constant.ApiInstanceId.
string api_instance_id = 16;
// OBP operation id, e.g. "OBPv6.0.0-getBanks". Matches MetricJsonV600.operation_id.
string operation_id = 17;
}
// Live tail of API metrics as they are written.
// History is served by the REST endpoint GET /management/metrics; this
// service delivers only new metrics via a Redis pub/sub channel.
service MetricsStreamService {
rpc StreamMetrics(StreamMetricsRequest) returns (stream MetricEvent);
}