NLnetLabs / routinator

An RPKI Validator and RTR server written in Rust
https://nlnetlabs.nl/projects/routing/routinator/
BSD 3-Clause "New" or "Revised" License
470 stars 71 forks source link

Add timestamp to each API response #596

Closed AlexanderBand closed 3 years ago

AlexanderBand commented 3 years ago

Provide a date/timestamp to each API response to offer contextual information on the age of a result, e.g. the RPKI validty was x based on a validation run done at moment y.

ties commented 3 years ago

For reference, the .metadata in the JSON output of my rpki-client instance looks like

# .metadata
{
  "buildmachine": "fdd4a0acfce8",
  "buildtime": "2021-07-19T16:05:45Z",
  "elapsedtime": "80",
  "usertime": "65",
  "systemtime": "9",
  "roas": 24780,
  "failedroas": 0,
  "invalidroas": 0,
  "certificates": 15359,
  "failcertificates": 0,
  "invalidcertificates": 0,
  "tals": 1,
  // Not sure if this is space-separated or an array
  "talfiles": "/etc/pki/tals/ripe.tal",
  "manifests": 15359,
  "failedmanifests": 2,
  "stalemanifests": 1,
  "crls": 15356,
  "gbrs": 2,
  "repositories": 15358,
  "vrps": 132795,
  "uniquevrps": 132793,
  "cachedir_del_files": 233,
  "cachedir_del_dirs": 24
}

If identical fields are included it may be nice to name them identically :)

partim commented 3 years ago

I agree in principle, but (a) OctoRPKI already uses ‘generated’ albeit with a Unix timestamp, and (b) I think ‘buildtime’ is misleading. I certainly ignored it at first because I thought it was the time the binary was build.

ties commented 3 years ago

(b) I think ‘buildtime’ is misleading. I certainly ignored it at first because I thought it was the time the binary was build.

Me too - same for build machine..