mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
The projection was 113 commits behind the document it claims to describe, and `generate.py --all --check` reported every one of the thirteen clients DRIFTED — the same +19 models in each, because they all fell behind the same emission. Regenerated in place from hanzo-inc/cloud openapi.yaml at 939b09d4 (sha256 087024f6…), which is the only description of this API that cannot name a route the binary does not serve. `--check` is clean across all thirteen after. .spec-lock moved with the code. The generator READS that file and never writes it — hanzoai/ci`s lane does — so a hand run leaves every lock naming the previous document. A lock that disagrees with the tree beside it is worse than no lock: the next `--check` without `--spec` fetches what production serves, compares it to a digest that was already wrong, and reports drift that is really staleness.
140 lines
11 KiB
C++
140 lines
11 KiB
C++
/**
|
|
* Hanzo Cloud API
|
|
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
*
|
|
* The version of the OpenAPI document: v1
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI-Generator 7.14.0.
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
/*
|
|
* MetricsApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_MetricsApi_H_
|
|
#define HANZO_API_MetricsApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
#include "hanzo/ModelBase.h"
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class MetricsApi
|
|
{
|
|
public:
|
|
|
|
explicit MetricsApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~MetricsApi();
|
|
|
|
/// <summary>
|
|
/// How many metric series this deployment holds for your org
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reports the native metrics store's live state for the calling tenant: the subsystem version, the resolved `org`, and `series` — the number of distinct series actually held right now, read out of the store rather than a constant. It is not a dependency probe and has nothing downstream to fail on: the store is in-process, so this answers 200 whenever the process is up. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`. This surface trusts the edge rather than re-deriving the org from a validated claim of its own, so it belongs behind the gateway and nowhere else.
|
|
/// </remarks>
|
|
pplx::task<void> getMetricsHealth(
|
|
) const;
|
|
/// <summary>
|
|
/// How many log records this deployment holds for your org
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reports the native log store's live state for the calling tenant: the subsystem version and `records`, the count actually held right now rather than a constant. Not a dependency probe — the store is in-process, so this answers 200 whenever the process is up. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`.
|
|
/// </remarks>
|
|
pplx::task<void> getMetricsLogsHealth(
|
|
) const;
|
|
/// <summary>
|
|
/// Search your org's logs by label, time and substring
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers `{count, records}`, newest first. `match` is the same `k=v,k2=v2` superset label matcher the metrics query uses; `contains` is a case-insensitive substring test against the record body; `start` and `end` are nanosecond bounds. A bound that is absent, empty or unparseable becomes 0, which means UNBOUNDED — a malformed `start` widens the search rather than failing it. `limit` caps the page and defaults to 100 when absent or non-positive, so an unfiltered read is never the whole ring. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`, so a search can only reach the org the edge asserted.
|
|
/// </remarks>
|
|
pplx::task<void> getMetricsLogsQuery(
|
|
) const;
|
|
/// <summary>
|
|
/// Read your org's series back over a time range
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers `{count, series}`, where `count` is the number of matching SERIES and each series carries the samples that fall inside the window. `name` selects one series name, and an absent or empty `name` returns every series the org holds. `match` is a `k=v,k2=v2` label matcher applied as a SUPERSET test: a series matches when it carries all the named labels with those values, extra labels and all. `start` and `end` are nanoseconds since the Unix epoch, and here is the rule worth knowing: a bound that is absent, empty or unparseable becomes 0, which this store reads as UNBOUNDED. A malformed `start` therefore silently widens the query instead of failing it. There is no limit parameter — the window and the matcher are the whole of what bounds the answer. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`, so a query can only ever read the org the edge asserted.
|
|
/// </remarks>
|
|
pplx::task<void> getMetricsQuery(
|
|
) const;
|
|
/// <summary>
|
|
/// How many spans this deployment holds for your org
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reports the native trace store's live state for the calling tenant: the subsystem version and `spans`, the count actually held right now. Not a dependency probe — the store is in-process, so this answers 200 whenever the process is up. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`.
|
|
/// </remarks>
|
|
pplx::task<void> getMetricsTracesHealth(
|
|
) const;
|
|
/// <summary>
|
|
/// Recent spans for your org over a time range
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers `{count, spans}`, newest first, filtered on each span's START time. `start` and `end` are nanosecond bounds where 0 — which is what an absent, empty or unparseable value becomes — means UNBOUNDED, so a malformed bound widens the listing instead of failing it. `limit` defaults to 100 when absent or non-positive. It lists SPANS, not traces: several spans of one trace each count separately and each take a slot against `limit`. Assembling one trace is /v1/metrics/traces/trace. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`.
|
|
/// </remarks>
|
|
pplx::task<void> getMetricsTracesQuery(
|
|
) const;
|
|
/// <summary>
|
|
/// Every span of one trace — the waterfall
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers `{spans}`: every span the org holds for the trace id in `id`, in the order they were appended, which is what a waterfall view renders. Unlike the other reads there is no count, no time range and no limit — a trace is addressed by id or not at all. An id with no spans answers an EMPTY list, never a 404: the store cannot tell a trace that never existed from one whose spans retention has already dropped, so it does not pretend to. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`, and a trace id belonging to another org is simply not in this org's store.
|
|
/// </remarks>
|
|
pplx::task<void> getMetricsTracesTrace(
|
|
) const;
|
|
/// <summary>
|
|
/// Ingest a MetricBatch — the same payload the ZAP transport carries
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Writes every sample in a luxfi/metric `MetricBatch` into the calling org's store and answers `{written}`: the number of SAMPLES stored, not families and not metrics. This is the exact wire shape the ZAP `MsgMetricBatch` transport carries, so the HTTP endpoint and the optional ZAP push receiver share one code path and one meaning — the transport is an optimisation, never a different contract. A counter or gauge lands as one sample. A histogram or summary contributes DERIVED `<name>_sum` and `<name>_count` series, so one metric can write more than one sample and `written` can exceed the number of metrics you sent. The batch's own `TimestampNs` stamps every sample it carries. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`; each org gets its own store, WAL-durable under the deployment's data dir. A body that does not decode is 400.
|
|
/// </remarks>
|
|
pplx::task<void> postMetricsBatch(
|
|
) const;
|
|
/// <summary>
|
|
/// Append structured log records for your org
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Takes `{records:[{t, level, body, labels}]}`, appends each one, and answers `{written}`. Bodies are stored verbatim; `labels` are the indexed dimensions a query filters on, so what you do not label you can only find by substring. `t` is NANOSECONDS since the Unix epoch. A record sent without one is stored at 0 and then falls outside any query carrying a lower bound — the usual reason a successful write does not read back. Retention is a bounded ring, 1048576 records per org, oldest evicted first. No record is validated or rejected, so `written` is the number of records SENT; only a body that does not decode at all is 400. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`; each org's records live in its own WAL-durable store.
|
|
/// </remarks>
|
|
pplx::task<void> postMetricsLogsWrite(
|
|
) const;
|
|
/// <summary>
|
|
/// Append spans for your org
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Takes `{spans:[{traceId, spanId, parentId, name, startNs, endNs, attrs}]}`, appends each, and answers `{written}` — the number of spans sent. Every span is indexed by its trace id as it lands, which is what makes the waterfall read possible without a second store. Times are NANOSECONDS since the Unix epoch. Retention is a bounded ring of 1048576 spans per org: past that the OLDEST are evicted to keep the newest 1048576, and the trace index is rebuilt — so a long-lived trace can lose its early spans while its later ones survive, and a waterfall read is best-effort against retention, not a guarantee. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`. A body that does not decode is 400.
|
|
/// </remarks>
|
|
pplx::task<void> postMetricsTracesWrite(
|
|
) const;
|
|
/// <summary>
|
|
/// Append samples to your org's named, labelled series
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Takes `{series:[{name, labels, samples:[{t, v}]}]}`, appends every sample, creating each series on first write, and answers `{written}` — again counting SAMPLES, so three series of ten samples is 30. A series is identified by its name PLUS its whole label set, so adding one label makes a different series rather than annotating an existing one. Timestamps `t` are NANOSECONDS since the Unix epoch; a sample sent without one is stored at 0 and is then excluded by any query that sets a lower bound, which is the usual reason a write that reported success does not read back. Retention is per series and bounded — past 65536 samples the oldest are evicted. The tenant is the gateway-minted `X-Org-Id` header, falling back to the deployment brand and then `default`. A body that does not decode is 400; nothing else is validated or rejected.
|
|
/// </remarks>
|
|
pplx::task<void> postMetricsWrite(
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_MetricsApi_H_ */
|
|
|