diff --git a/morph/lib/storage.nix b/morph/lib/storage.nix index dc7e6c61867dda8c0ed0d3bf4e63a3f246b2e311..8b0b35db15edf609cdf696fee74955b24f1d65ea 100644 --- a/morph/lib/storage.nix +++ b/morph/lib/storage.nix @@ -51,15 +51,26 @@ in { promtail.extraScrapeConfigs = [ { job_name = "tahoe-corruption-advisories"; - static_configs = [ - { - labels = { - job = "tahoe-corruption-advisories"; - host = config.networking.hostName; - __path__ = "/storage/corruption-advisories/*"; - }; - } - ]; + static_configs = [{ + labels = { + job = "tahoe-corruption-advisories"; + host = config.networking.hostName; + __path__ = "/storage/corruption-advisories/*"; + }; + }]; + relabel_configs = [{ + source_labels = [ "filename" ]; + regex = "/storage/corruption-advisories/(.{24}).*"; + target_label = "filename_timestamp"; + }]; + pipeline_stages = [{ + timestamp = { + # Example: 2021-08-02T160728.654321--xyz123abc321xyz123abc321xy-4 + # i.e. not quite RFC3339Nano + source = "filename_timestamp"; + format = "2006-01-02T150405.999999"; + }; + }]; } ]; };