LogAnalyticsIndex
Upgrades resolution from “an id plus a date/hour hint” to a bare id with nothing else: queries the workspace for the pointer log line the recorder itself wrote, reads its cassette_key straight off that record, and fetches the object at that key.
Declines (returns null) when no workspace is configured, or the query legitimately returns no matching pointer — both are “nothing to find here”, not a broken index. A pointer that is found but whose object has since expired throws instead of declining: the pointer outliving the cassette is a designed property (a lifecycle rule can prune the blob long before log retention expires), and “the request failed * and a cassette existed for it, but it is gone now” is a materially different, more useful answer than a plain “not found” — worth surfacing, not swallowing into a decline.
Synopsis
Section titled “Synopsis”final readonly class LogAnalyticsIndex implements CassetteIndexInterface
| Implements | CassetteIndexInterface |
| Source | Index/LogAnalyticsIndex.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(AzureMonitorQueryClientInterface|null $queryClient, ObjectStoreClientInterface|null $objectClient = null, int $lookbackHours = 720, CassetteCodec $codec = new CassetteCodec(…)): mixed
Only ever used to fetch the object a
pointer names, so it is not required when $queryClient is null — and building one
for an index that will decline every call means constructing a blob client and its
credential for nothing, on every resolution attempt.
| Parameter | Type | Description |
|---|---|---|
$queryClient | AzureMonitorQueryClientInterface` | “null` |
$objectClient | ObjectStoreClientInterface` | “null` |
$lookbackHours | int | |
$codec | CassetteCodec |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
resolve(CassetteId $id, IndexHints $hints): ?Cassette | Returns null when this index has nothing to try for the given id/hints — not configured, no matching hint present, or a legitimate zero-result lookup. |
resolve()
Section titled “resolve()”public function resolve(CassetteId $id, IndexHints $hints): ?Cassette
Returns null when this index has nothing to try for the given id/hints — not configured, no matching hint present, or a legitimate zero-result lookup.
That is the designed “try the next index in the chain” signal, not an error. A genuine failure (a malformed hint, a broken query, an auth error, or a pointer whose payload has already expired) throws CassetteIndexException instead, so a misconfigured or broken index never masquerades as “not found here.”
| Parameter | Type | Description |
|---|---|---|
$id | CassetteId | |
$hints | IndexHints |
Returns ?Cassette