API Explorer 1 endpoints

Get Top Callers

GET /obp/v7.0.0/management/traffic/top-callers

OBPv7.0.0-getTrafficSources Roles: CanGetTrafficSources Rate-LimitsSystem

Where the traffic on this OBP-API instance is coming from: the busiest Consumers, the busiest client IP addresses, and the busiest pairs of caller and endpoint, over the last window minutes (1, 5 or 15; default 5).

  • consumers: requests that authenticated a Consumer, by Consumer.
  • addresses: every request, authenticated or not, by client IP address, with the Consumers seen from it.
  • callers_and_endpoints: by caller (the Consumer when one was authenticated, otherwise the IP address) and endpoint. The endpoint is an operation id, unmatched for paths no endpoint serves (one value for all of them), refused:LIMITER for requests refused before routing, or other.

Each list shows at most 50 rows, busiest first. Counts are estimates: requests is within error of the true count. status_*, refused and unmatched are exact from when the row started being tracked in each minute.

How it is counted. Each minute has three tables of fixed size (200 Consumers, 200 addresses, 500 pairs), kept with the Space-Saving algorithm of Ahmed Metwally, Divyakant Agrawal and Amr El Abbadi ("Efficient Computation of Frequent and Top-k Elements in Data Streams", ICDT 2005), which refines the frequent-items algorithm of Jayadev Misra and David Gries (1982). Any caller with more than 1/200 of a minute's requests is guaranteed to appear. Minutes are merged into the window as mergeable summaries (Agarwal, Cormode, Huang, Phillips, Wei and Yi, PODS 2012). 15 minutes are kept.

Each instance counts only its own traffic, in memory. Behind a load balancer the response describes the instance that answered (api_instance_id). Nothing is written to the database or to Prometheus, and IP addresses are forgotten after 15 minutes. IP addresses are personal data: this Role should be granted only to people who handle incidents.

User Authentication is Required. The User must be logged in. The Application must also be authenticated.

JSON response body fields (25)
addresses
api_instance_id
api_instance_id
application_name
application_name
caller
caller
caller_kind
caller_kind
callers_and_endpoints
callers_and_endpoints
consumer_id
7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh
consumer_ids
consumer_ids
consumers
endpoint
endpoint
endpoints
endpoints
error
error
first_seen
first_seen
ip_address
198.51.100.42
last_ip_address
last_ip_address
last_seen
last_seen
max_duration_ms
max_duration_ms
mean_duration_ms
mean_duration_ms
refused
refused
requests
requests
status_2xx
status_2xx
status_4xx
status_4xx
status_5xx
status_5xx
unmatched
unmatched
window_minutes
window_minutes
Example success response
{
  "api_instance_id": "obp_4f6b3c2a-9d1e-4b7a-8c5f-2e1d0a9b8c7d",
  "window_minutes": 5,
  "consumers": [
    {
      "consumer_id": "7uy8a7e4-6d02-40e3-a129-0b2bf89de8uh",
      "application_name": "Mobile Banking App",
      "requests": 12400,
      "error": 0,
      "status_2xx": 12310,
      "status_4xx": 85,
      "status_5xx": 5,
      "refused": 0,
      "unmatched": 0,
      "endpoints": [
        "OBPv7.0.0-getBanks",
        "OBPv6.0.0-getCoreAccountById"
      ],
      "last_ip_address": "198.51.100.23",
      "first_seen": "1100-01-01T01:01:01Z",
      "last_seen": "1100-01-01T01:01:01Z"
    }
  ],
  "addresses": [
    {
      "ip_address": "203.0.113.42",
      "requests": 52400,
      "error": 300,
      "status_2xx": 1200,
      "status_4xx": 51100,
      "status_5xx": 100,
      "refused": 0,
      "unmatched": 38000,
      "endpoints": [
        "unmatched",
        "OBPv1.4.0-getResourceDocsObp"
      ],
      "consumer_ids": [],
      "first_seen": "1100-01-01T01:01:01Z",
      "last_seen": "1100-01-01T01:01:01Z"
    }
  ],
  "callers_and_endpoints": [
    {
      "caller_kind": "ip",
      "caller": "203.0.113.42",
      "endpoint": "unmatched",
      "requests": 38000,
      "error": 250,
      "status_2xx": 0,
      "status_4xx": 38000,
      "status_5xx": 0,
      "refused": 0,
      "mean_duration_ms": 3,
      "max_duration_ms": 41,
      "last_seen": "1100-01-01T01:01:01Z"
    }
  ]
}
Possible errors (4)
  • OBP-20001: User not logged in. Authentication is required!
  • OBP-20006: User is missing one or more roles:
  • OBP-10067: Invalid window. Use window=1, 5 or 15 (minutes).
  • OBP-50000: Unknown Error.
Implemented by OBPv7.0.0 getTrafficSources