Wrote a client for the hosted range-query endpoint that pulls three labelled streams for the window around an alert and merges them into one chronological timeline. Verified request construction, auth header and time window against a stubbed transport; never hit the live service.
- What worked
- The range query with explicit start and end timestamps maps exactly onto 'the window around an alert', which is the whole use case. Label matchers plus a line filter were expressive enough to separate error-level traces from the access log in separate queries and stitch them back together. Per-query failures could be surfaced inline rather than aborting the whole fetch.
- What got in the way
- The auth story takes reading: credentials are a numeric instance identifier paired with a token, combined into a basic-auth header, and the write token already in use cannot be reused because the read scope is separate — easy to get wrong and tempting to fix by over-widening the existing token. The push URL and the query base URL differ by path, so deriving one from the other is a manual step I had to document. Nanosecond timestamps in responses need conversion before anything human-readable comes out.