refactor(agent-v2): rename telemetry endpoint to /api/agent/telemetry

Place the new V2 ingest route under the existing /api/agent/* namespace
(where all other agent-writes live: register-session, ingest, config,
upload-url) instead of the orphan /api/telemetry/* bucket. Agent writes
vs. admin/web reads is the thematic split used throughout the repo —
/api/sessions/* is reserved for read-side and admin action routes.

Constant renamed TelemetryBatch → IngestTelemetry to mirror the legacy
IngestEvents pattern; semantic successor, heterogeneous TelemetryItem[]
payload replacing per-type ingest once Legacy is decommissioned.

No wire-format or handler changes — URL string only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Oliver Kieselbach
2026-04-21 02:56:18 +02:00
parent a0d0178353
commit 941e03cf32
4 changed files with 8 additions and 7 deletions
@@ -13,7 +13,7 @@ namespace AutopilotMonitor.Agent.V2.Core.Tests.Transport
public sealed class BackendTelemetryUploaderTests
{
private const string BaseUrl = "https://backend.test";
private const string ExpectedEndpoint = "https://backend.test/api/telemetry/batch";
private const string ExpectedEndpoint = "https://backend.test/api/agent/telemetry";
private static readonly DateTime At = new DateTime(2026, 4, 20, 10, 0, 0, DateTimeKind.Utc);
private static TelemetryItem NewEventItem(long id, string sessionId = "S1", string tenantId = "T1") =>
@@ -19,7 +19,7 @@ namespace AutopilotMonitor.Agent.V2.Core.Transport.Telemetry
/// <summary>
/// Produktions-<see cref="IBackendTelemetryUploader"/>. Plan §2.7a / §4.x M4.4.2.
/// <para>
/// HTTP-Skelett gegen <c>POST /api/telemetry/batch</c>. Sendet einen Batch von
/// HTTP-Skelett gegen <c>POST /api/agent/telemetry</c>. Sendet einen Batch von
/// <see cref="TelemetryItem"/>s als JSON-Array; Backend routet pro Item nach
/// <see cref="TelemetryItemKind"/> in die Ziel-Tabelle (Events / Signals /
/// DecisionTransitions) und dedupliziert via (<c>PartitionKey</c>, <c>RowKey</c>).
@@ -61,7 +61,7 @@ namespace AutopilotMonitor.Agent.V2.Core.Transport.Telemetry
if (string.IsNullOrEmpty(baseUrl)) throw new ArgumentException("BaseUrl is mandatory.", nameof(baseUrl));
if (string.IsNullOrEmpty(tenantId)) throw new ArgumentException("TenantId is mandatory.", nameof(tenantId));
_endpointUrl = baseUrl.TrimEnd('/') + Constants.ApiEndpoints.TelemetryBatch;
_endpointUrl = baseUrl.TrimEnd('/') + Constants.ApiEndpoints.IngestTelemetry;
_tenantId = tenantId;
_manufacturer = manufacturer;
_model = model;
@@ -8,7 +8,7 @@ namespace AutopilotMonitor.Agent.V2.Core.Transport.Telemetry
/// <summary>
/// Abstraction über den Backend-Aufruf zur Batch-Telemetry-Übertragung. Plan §2.7a.
/// <para>
/// Produktionsimplementierung in <c>BackendApiClient</c> (ruft <c>POST /api/telemetry/batch</c>).
/// Produktionsimplementierung in <c>BackendTelemetryUploader</c> (ruft <c>POST /api/agent/telemetry</c>).
/// Tests verwenden einen Fake-Uploader — der Orchestrator ist HTTP-agnostisch.
/// </para>
/// </summary>
@@ -140,10 +140,11 @@ namespace AutopilotMonitor.Shared
public const string ValidateBootstrapCode = "/api/bootstrap/validate/{code}";
// V2 Agent generic telemetry transport (Plan §2.7a).
// Backend routes per TelemetryItem.Kind to Events / Signals / DecisionTransitions tables.
// Single endpoint for Event + Signal + DecisionTransition batch ingest; replaces the
// Sibling of IngestEvents under /api/agent/* — same Agent-writes namespace, heterogeneous
// TelemetryItem[] payload (Event + Signal + DecisionTransition). Backend routes per
// TelemetryItem.Kind to Events / Signals / DecisionTransitions tables. Replaces the
// per-type IngestEvents path once the Legacy Agent is decommissioned (v11.1+).
public const string TelemetryBatch = "/api/telemetry/batch";
public const string IngestTelemetry = "/api/agent/telemetry";
// MCP/Agent API search endpoints
public const string SearchSessions = "/api/search/sessions";