postMetricsTracesWriteWithHttpInfo method
Append spans for your org
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.
Note: This method returns the HTTP Response.
Implementation
Future<Response> postMetricsTracesWriteWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/v1/metrics/traces/write';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}