{"uid":"cap_ctbBZFHKTTwcNY7Ker5ZV","slug":"telemetry-attribute-audit-5ca57302","name":"Telemetry Attribute Audit","description":"Audit telemetry attributes against a contract, and against the thing a schema cannot see: cardinality. Reports missing required attributes, undeclared attributes, an attribute appearing as two types across the batch, and an attribute whose distinct values exceed your limit - because in a metrics backend each distinct value is a separate series, and that is how an index or a bill explodes.","url":"https://api.zfinia.com/x402/v1/telemetry-attribute-contract-audit?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"records":{"type":"array","items":{"type":"object"},"maxItems":2000,"minItems":1},"contract":{"type":"object","properties":{"types":{"type":"object"},"optional":{"type":"array","items":{"type":"string","maxLength":256},"maxItems":500,"minItems":1},"required":{"type":"array","items":{"type":"string","maxLength":256},"maxItems":500,"minItems":1},"allow_undeclared":{"type":"boolean"}},"additionalProperties":false},"attribute_pointer":{"type":"string","maxLength":512},"cardinality_limit":{"type":"integer","minimum":1}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.12","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.12/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.12","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.12","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_V4qxsHxTpkO_UXfe-weql","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.12","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Audits a batch of telemetry records against a declared attribute contract, flagging missing required attributes, undeclared attributes, type conflicts, and high-cardinality attributes that could explode metrics backend costs.","exampleAgentPrompt":"Audit these 500 telemetry span records against my attribute contract — required fields are 'service.name', 'http.method', and 'trace_id', allow_undeclared is false, and flag any attribute whose distinct values exceed 100, since I'm worried about cardinality explosions in my metrics backend.","exampleUseCases":[{"title":"Pre-ingest cardinality guard for metrics pipeline","prompt":"Before I ingest these 1200 telemetry records into our metrics backend, check them against my contract — required attributes are 'env', 'service', and 'region', and flag any attribute that has more than 50 distinct values so I can catch anything that might create too many series."},{"title":"Attribute type conflict detection across spans","prompt":"I just collected a batch of 800 OpenTelemetry spans and I think some instrumentation libraries are sending 'http.status_code' as a string and others as an integer — can you audit the batch and tell me which attributes appear with conflicting types?"},{"title":"Contract compliance check for new service rollout","prompt":"We're rolling out a new service and I need to make sure its telemetry follows our org contract: 'team', 'service.name', and 'deployment.environment' are required, undeclared attributes are not allowed, and cardinality limit is 200 — can you audit these 300 sample spans?"}],"resultDescription":"Returns a structured audit report identifying: (1) required attributes missing from records, (2) undeclared attributes present but not in the contract, (3) attributes that appear with two or more conflicting types across the batch, and (4) attributes whose count of distinct values exceeds the specified cardinality limit — enabling teams to fix instrumentation before ingestion causes index bloat or runaway billing.","failureModes":["Empty or malformed records array returns validation error","Contract object with invalid type definitions causes rejection","Cardinality limit below 1 is rejected by schema","Batch exceeding 2000 records is refused","Attribute pointer referencing a non-existent path produces empty results","Missing required contract fields may produce partial audit output"],"whenToPreferThis":"Choose this endpoint when you need to enforce a declared attribute contract on telemetry data AND also need cardinality analysis in a single pass — it combines schema-level contract validation (missing, undeclared, type conflicts) with the cardinality check that static schema validators cannot perform. Prefer this over generic JSON schema validators when working with OpenTelemetry spans, metrics, or logs where high-cardinality attributes are a cost and performance risk.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T06:39:45.282Z","isFirstParty":false,"canonicalSlug":"telemetry-attribute-audit-5ca57302"}