Adapter Sidecar Pattern
An adapter translates what a process emits into a platform contract. Uniform syntax does
not imply uniform meaning: two duration metrics may include different work. The specialist
decision is whether translation is justified, where it belongs, and how to detect plausible
but incorrect output when either contract changes.
Workflow
- Establish the contract before the parser. Obtain representative source samples with
producer image/version and capture conditions, the consumer schema/protocol and version,
field meanings and units, and the current collection path. Inspect source/configuration
where available; do not infer semantics from field names alone. For placement, obtain
producer changeability, collector capabilities/access, replica counts and resource constraints.
For failures, obtain timestamps, parser errors, backlog and upstream collection status.
- Handle missing evidence explicitly. Request the smallest missing sample or contract
needed for a decision. Continue with a conditional design, but do not invent a production
parser, health predicate, resource budget or confirmed diagnosis. Label supplied facts,
inferred explanations and untested hypotheses separately; name a check that could refute
each consequential hypothesis.
- Choose the least costly adequate placement. Before adding a container or revisiting
log collection, read adapter-or-node-agent.md.
Workload-specific parsing and pod metadata alone do not require a sidecar. Record the
constraint that the existing collector or producer cannot satisfy. Use
sidecar-pattern
for container mechanics only once per-pod placement is justified.
- Specify translation and failure behavior. When implementing, reviewing or diagnosing
an adapter, read coupling-and-failure.md. Map source
fields to output meaning, including absent/invalid values, enrichment provenance, and
compatibility ownership. Define what consumers see on malformed input, stale collection
and overload; never silently convert missing data to a successful zero or healthy state.
- Verify semantics and the failure path. Use producer-version fixtures and consumer
tooling to check both valid output and its meaning. Include the relevant failure injection
(format drift, source outage, restart or sink outage). Record actual results separately
from proposed checks. Parser acceptance alone cannot prove correctness.
Rules
- Compare changing a controlled producer or using existing instrumentation with recurring
adapter maintenance; ownership makes change possible, not automatically cheaper.
- Parsing may target a documented versioned API or an informal log layout. Record which,
the supported producer/adapter combinations, and who tests upgrades. Do not assume either
stability or absence of ownership.
- Enrichment needs an authoritative source and an unambiguous association to the record.
Never fabricate request context or infer it from temporal proximity. Missing information
stays missing unless the output contract explicitly defines a fallback with provenance.
- Treat translation as a data boundary: redact secrets before export or quarantine, restrict
file/endpoint access, authenticate remote sinks, and bound record size, parser work and
output amplification. Test hostile input without copying real secrets into fixtures.
- Version the mapping and test consumer compatibility. Emit schema metadata only through a
mechanism the target protocol supports; adding a field does not force consumers to reject
incompatible data.
Deliverable
For a small review, a concise finding is enough: evidence (or gap), consequence, proposed
adjustment and confirming/refuting check. For a design or implementation, also provide the
placement rationale, field/semantic mapping, failure policy and compatibility tests. State
what ran and what remains unverified; do not claim a deployment fix from static analysis.
When evaluating this skill's decisions, use
validation-cases.md. These are behavioral evaluation
prompts, distinct from tests of an adapter implementation.
1---2name: adapter-sidecar-pattern3description: Choose and review Kubernetes telemetry adapters when a legacy or vendor process emits incompatible metrics, logs or health signals, when deciding between per-pod translation and a node agent, or when an application upgrade silently changes parsed telemetry. Covers translation contracts, evidence-backed enrichment and failure behavior. Excludes in-process interface adaptation (gof-adapter), container mechanics (sidecar-pattern), probe configuration (kubernetes-service-lifecycle) and telemetry instrumentation design.4---56# Adapter Sidecar Pattern78An adapter translates what a process emits into a platform contract. Uniform syntax does9not imply uniform meaning: two duration metrics may include different work. The specialist10decision is whether translation is justified, where it belongs, and how to detect plausible11but incorrect output when either contract changes.1213## Workflow14151. **Establish the contract before the parser.** Obtain representative source samples with16 producer image/version and capture conditions, the consumer schema/protocol and version,17 field meanings and units, and the current collection path. Inspect source/configuration18 where available; do not infer semantics from field names alone. For placement, obtain19 producer changeability, collector capabilities/access, replica counts and resource constraints.20 For failures, obtain timestamps, parser errors, backlog and upstream collection status.212. **Handle missing evidence explicitly.** Request the smallest missing sample or contract22 needed for a decision. Continue with a conditional design, but do not invent a production23 parser, health predicate, resource budget or confirmed diagnosis. Label supplied facts,24 inferred explanations and untested hypotheses separately; name a check that could refute25 each consequential hypothesis.263. **Choose the least costly adequate placement.** Before adding a container or revisiting27 log collection, read [adapter-or-node-agent.md](references/adapter-or-node-agent.md).28 Workload-specific parsing and pod metadata alone do not require a sidecar. Record the29 constraint that the existing collector or producer cannot satisfy. Use `sidecar-pattern`30 for container mechanics only once per-pod placement is justified.314. **Specify translation and failure behavior.** When implementing, reviewing or diagnosing32 an adapter, read [coupling-and-failure.md](references/coupling-and-failure.md). Map source33 fields to output meaning, including absent/invalid values, enrichment provenance, and34 compatibility ownership. Define what consumers see on malformed input, stale collection35 and overload; never silently convert missing data to a successful zero or healthy state.365. **Verify semantics and the failure path.** Use producer-version fixtures and consumer37 tooling to check both valid output and its meaning. Include the relevant failure injection38 (format drift, source outage, restart or sink outage). Record actual results separately39 from proposed checks. Parser acceptance alone cannot prove correctness.4041## Rules4243- Compare changing a controlled producer or using existing instrumentation with recurring44 adapter maintenance; ownership makes change possible, not automatically cheaper.45- Parsing may target a documented versioned API or an informal log layout. Record which,46 the supported producer/adapter combinations, and who tests upgrades. Do not assume either47 stability or absence of ownership.48- Enrichment needs an authoritative source and an unambiguous association to the record.49 Never fabricate request context or infer it from temporal proximity. Missing information50 stays missing unless the output contract explicitly defines a fallback with provenance.51- Treat translation as a data boundary: redact secrets before export or quarantine, restrict52 file/endpoint access, authenticate remote sinks, and bound record size, parser work and53 output amplification. Test hostile input without copying real secrets into fixtures.54- Version the mapping and test consumer compatibility. Emit schema metadata only through a55 mechanism the target protocol supports; adding a field does not force consumers to reject56 incompatible data.5758## Deliverable5960For a small review, a concise finding is enough: evidence (or gap), consequence, proposed61adjustment and confirming/refuting check. For a design or implementation, also provide the62placement rationale, field/semantic mapping, failure policy and compatibility tests. State63what ran and what remains unverified; do not claim a deployment fix from static analysis.6465When evaluating this skill's decisions, use66[validation-cases.md](references/validation-cases.md). These are behavioral evaluation67prompts, distinct from tests of an adapter implementation.