feat(pivot): PR-B2 — port nccl_fr off internal pipeline+consumer#201
Merged
Conversation
Port components/receivers/nccl_fr off the v0.1.x internal facades
(internal/pipeline, internal/consumer, internal/runtime/lifecycle) onto
upstream go.opentelemetry.io/collector/{component,receiver,consumer}
v1.59.0 — the canonical types the OCB-generated _build/main.go already
consumes for all third-party receivers.
Factory now uses receiver.NewFactory(...) + receiver.WithLogs(...) instead
of a hand-rolled internal/pipeline.ReceiverFactory struct. Receiver
struct renamed to ncclFRReceiver (avoids name collision with the
upstream receiver package) and implements receiver.Logs via
Start(ctx, component.Host) / Shutdown(ctx). Logger swapped from
*slog.Logger -> *zap.Logger (the type carried in component.TelemetrySettings).
Log messages and fields preserved byte-for-byte so operator alerts on
log content do not regress.
Hard gate for PR-I.1 submodule extraction: nccl_fr now has zero
internal/{pipeline,consumer,runtime/lifecycle} imports.
Predecessor: PR-B1 #184 ported the selftel + lifecycle helpers into
the package as siblings; this PR handles the remaining pipeline +
consumer + factory layer.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Tri Lam <tri@maydow.com>
added 2 commits
May 31, 2026 00:02
PR-B2 is the first-of-kind upstream-API port; 7 more receivers/exporters inherit this template. Five fixes so the template is reference-grade: 1. Delete dead package-var Factory + NewFactory indirection — the tools/components-gen driver that required the wrapper was deleted in PR-A2 #168. NewFactory() now constructs the upstream receiver.Factory directly, mirroring otlpreceiver / filelogreceiver. 2. Fix misleading "LogsReceiver tag" comment — upstream receiver.Logs is literally `interface { component.Component }`; no tag exists. 3. Switch tests to receivertest.NewNopSettings(componentType()) wrapped in a thin testSettings() helper that pins the ID to nccl_fr/test (selftel label assertions need a stable ID; raw helper returns UUID). Drops hand-rolled Settings construction so upstream BuildInfo + TelemetrySettings additions land automatically. 4. Rename ncclFRReceiver → ncclfrReceiver per Go acronym convention and align with planned PR-I.1b package name ncclfrreceiver. 5. Append Type-swap reference table to PR body so PR-F.2 inheritors (clockreceiver, kernelevents, stdoutexporter, k8sevents, containerstdout, otlphttp, pyspy, dcgm) have a single mapping doc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Tri Lam <tri@maydow.com>
This was referenced May 31, 2026
trilamsr
added a commit
that referenced
this pull request
May 31, 2026
## Summary
Port `components/exporters/stdoutexporter` off
`internal/{pipeline,consumer}` onto upstream OTel collector v1.59.0 /
v0.153.0 types. Mirrors PR-B2 #201 (nccl_fr receiver port),
exporter-flavor. Sibling self-telemetry from PR #186 stays in place —
only the `pipeline.ID` → `component.ID` + `pipeline.CreateSettings` →
`exporter.Settings` type-swaps in tests are needed.
## Type swap
| Before (internal) | After (upstream) |
|---|---|
| `internal/pipeline.ExporterFactory` | `exporter.Factory` |
| `internal/pipeline.CreateSettings` | `exporter.Settings` |
| `internal/pipeline.Config` | `component.Config` |
| `internal/pipeline.Exporter` | `exporter.Metrics` |
| `internal/consumer.{Metrics,Capabilities}` |
`consumer.{Metrics,Capabilities}` |
| `pipeline.ComponentState` (embedded) | explicit no-op
`Start`/`Shutdown` |
| `pipeline.ErrSignalNotSupported` (manual returns) | upstream's
built-in unregistered-signal sentinel |
| `*slog.Logger` | `*zap.Logger` (factory-side only — exporter has no
log sites) |
Factory shape matches upstream-contrib (`debugexporter`,
`fileexporter`):
```go
func NewFactory() exporter.Factory {
return exporter.NewFactory(
componentType(),
createDefaultConfig,
exporter.WithMetrics(createMetrics, stability),
)
}
```
`WithMetrics` is the only signal registered. Logs + traces fall through
to upstream's built-in *"telemetry type is not supported"* sentinel —
tests pin the surfaced message so a future upstream rename surfaces here
at test-time rather than as a silent contract regression.
## Root cause
RFC-0013 §migration mandates that `internal/pipeline`,
`internal/consumer`, and `internal/selftelemetry` are deleted in PR-F.
Every in-tree component must first switch to upstream OTel types so PR-F
can land cleanly. PR-B2 #201 did this for the nccl_fr receiver; this PR
is the exporter sibling. Not a workaround — this is the migration step
itself.
## Why drop `pipeline.ComponentState`
`stdoutexporter` is purely synchronous (no goroutines, no resources to
acquire). The embedded `ComponentState` only existed to provide free
`Start`/`Shutdown`/`Started`/`Stopped` accessors. Upstream
`component.Component` requires `Start`/`Shutdown` (now explicit no-ops)
but does NOT require `Started`/`Stopped` — those tests are dropped. The
`lifecycle` helper that nccl_fr's port introduced is intentionally
absent here: the exporter has no run-loop to bookend.
## New adversarial tests added with the swap
- `TestFactory_CreateMetrics_BadConfigType` — pins the type-guard in
`createMetrics` so a non-`*Config` cfg surfaces a clear error rather
than panicking on type assertion.
- `TestExporter_StartShutdown_NoOps` — pins the no-op contract so a
future refactor that introduces a side-effecting `Start`/`Shutdown` is
forced to add its own test.
- `TestExporter_WriteErrorSurfaces` — pins the I/O failure path: a
writer that errors must surface a wrapped error from `ConsumeMetrics`
(paired with the existing `kindIO` selftel coverage).
- `var _ exporter.Factory = NewFactory()` — compile-time pin against
silent regression back to `internal/pipeline.ExporterFactory`.
## LOC delta
```
components/exporters/stdoutexporter/ 6 files, +221 / -142
go.mod +6 / -0
go.sum +40 / -2
```
Net +79 LOC for the exporter package, almost entirely the four new
adversarial tests above and the type-swap boilerplate the upstream
contract requires (separate `componentType` + `createDefaultConfig` +
`createMetrics` funcs vs. one struct with three methods).
## Test plan
- [x] `make check` — clean (fmt, tidy, lint, vet, mod-verify all green).
- [x] `go test -race -count=1 ./components/exporters/stdoutexporter/...`
— green.
- [x] `go test ./...` — green except three pre-existing flakes (verified
by stashing this diff and re-running on `origin/main`):
- `components/receivers/kernelevents/TestReceiver_SLIBudget` (p99 perf
budget; flakes ~50% on local Darwin)
-
`components/receivers/kernelevents/TestKernelevents_Lifecycle_ConcurrentAddDuringShutdown_NoPanic`
-
`components/receivers/k8sevents/TestK8sevents_Lifecycle_ConcurrentAddDuringShutdown_NoPanic`
- [ ] CI to run the same gates on a fresh checkout.
```release-notes
NONE
```
Signed-off-by: Tri Lam <tri@maydow.com>
Co-authored-by: Tri Lam <tri@maydow.com>
This was referenced May 31, 2026
trilamsr
added a commit
that referenced
this pull request
May 31, 2026
…ream (#208) ## Summary Ports `components/receivers/kernelevents/` off the soon-to-be-deleted `internal/{pipeline,consumer,runtime/lifecycle}` packages onto upstream OTel collector v1.59.0 / v0.153.0. Mirrors PR-B2 (#201) for the multi-source kernelevents shape — receiver-scoped `lifecycle` helper keeps its `Add()` method (one goroutine per source under one WaitGroup); only the logger type flips from `*slog.Logger` to `*zap.Logger`. Net delta: **+317 / -296 LOC** across 28 files in `components/receivers/kernelevents/` plus `go.mod` (promotes `componenttest`, `pipeline` from indirect to direct). ## Root cause RFC-0013 PR-F deletes `internal/pipeline`, `internal/consumer`, and `internal/runtime/lifecycle`. Every receiver must consume upstream types directly. PR #187 already pulled the receiver-local `lifecycle` + `selftel` siblings into this package (preempting the internal-lifecycle dep) but kept `*slog.Logger` and the internal/pipeline factory shape. This PR completes the swap. ## Type-swap applied | internal | upstream | |---|---| | `internal/pipeline.Type` | `component.Type` | | `internal/pipeline.ReceiverFactory` | `receiver.Factory` (via `receiver.NewFactory(...)`) | | `internal/pipeline.CreateSettings` | `receiver.Settings` (via `receivertest.NewNopSettings`) | | `internal/pipeline.Config` | `component.Config` | | `internal/pipeline.Receiver` | `receiver.Logs` (compile-time `var _ receiver.Logs = (*kernelEventsReceiver)(nil)`) | | `internal/pipeline.Host` | `component.Host` (via `componenttest.NewNopHost`) | | `internal/pipeline.ComponentState` mixin | **dropped** (`Started()/Stopped()` accessors were unused) | | `internal/pipeline.ErrSignalNotSupported` | `pipeline.ErrSignalNotSupported` (auto-surfaced by `receiver.NewFactory` default) | | `internal/pipeline/pipelinetest.New(t)` | local `testSettings(t)` wrapper + `componenttest.NewNopHost` | | `internal/consumer.{Logs,Capabilities,Metrics,Traces}` | upstream `consumer.*` | | `internal/pipeline.TelemetrySettings.{Logger,MeterProvider,Resource}` | `receiver.Settings.{Logger,MeterProvider,Resource}` (TelemetrySettings embedded, no `.Telemetry` indirection) | | `*slog.Logger` everywhere (lifecycle, source, kmsg, journald, factory, kernelevents.go, all tests) | `*zap.Logger` | | `slog.Default()` | `zap.NewNop()` | ## Behavior changes (deliberate) - **Shutdown surfaces lifecycle ctx-deadline error**: previously `_ = r.lc.Shutdown(ctx)` silently swallowed any deadline-exceeded; now wrapped + returned (`kernelevents lifecycle shutdown: %w`). Matches PR-B2 nccl_fr discipline. `TestReceiver_ShutdownIsIdempotent` still passes (second Shutdown short-circuits to the first call's stashed error, which is nil on success). - **Factory shape**: package-var `Factory` removed; `NewFactory()` returns a fresh `receiver.Factory` per call (matches upstream-contrib pattern + PR-B2 nccl_fr). Stability pinned at `component.StabilityLevelBeta`. - **No `ComponentState` mixin**: `Started()` / `Stopped()` accessors had no callers; dropping the embed removes the only stateful field the receiver carried for upstream interface satisfaction. ## Behavior preserved - Multi-source `Add()` lifecycle contract — TOCTOU-safe under the `closed` mutex guard; `TestKernelevents_Lifecycle_ConcurrentAddDuringShutdown_NoPanic` passes under `-race` (the only mode it exercises; flaky without `-race` as documented in the test docstring). - Per-source isolation (each source owns its OWN `*lifecycle`; receiver hosts the driver goroutine). - Sibling-isolation invariant + cancel cascade (Start-ctx cancellation reaches every source without an explicit Shutdown). - Self-telemetry: metric names + label shape unchanged (`tracecore.receiver.errors_total{kind,component_id}` and siblings); instrumentation scope = receiver's Go import path. - Schema URL (`kernelEventsSchemaURL`), attribute set, severity mapping, partial-source mode, regex / facility / min-severity filters, kmsg `bufio.ErrTooLong` → `kindKmsgOversized` discrimination, journald restart-with-backoff + slow-recovery loop. ## Test plan - [x] `make check` — `0 issues`. - [x] `go test -race ./components/receivers/kernelevents/...` — pass. - [x] `go test ./...` — pass for kernelevents; two unrelated pre-existing race-window flakes (`TestK8sevents_Lifecycle_ConcurrentAddDuringShutdown_NoPanic`, `TestServer_HealthzReturns503DuringShutdown`) both pass under `-race`. - [x] Concurrent-Add stress test passes under `-race` (first try; the test is `-race`-only by design). - [x] Compile-time assertion `var _ receiver.Logs = (*kernelEventsReceiver)(nil)` guards against upstream interface drift. - [x] `go.mod` tidies cleanly with `componenttest` + `pipeline` promoted indirect → direct. ## Out of scope - `internal/sli` import in `bench_test.go` (SLI summary publisher, not deleted by PR-F). - `internal/pipeline/pipelinetest` deletion (covered by sibling PRs). - Source-template `.go.example` parser-gate test — comment refreshed; the template's `package-kernelevents` private-type usage means the parse-only gate is unchanged. ```release-notes NONE ``` Signed-off-by: Tri Lam <tri@maydow.com> Co-authored-by: Tri Lam <tri@maydow.com>
trilamsr
added a commit
that referenced
this pull request
May 31, 2026
## Summary
- Port `components/receivers/containerstdout` off the v0.1.x internal
facades (`internal/pipeline`, `internal/consumer`) onto upstream
`go.opentelemetry.io/collector/{component,receiver,consumer}` v1.59.0
— the canonical types the OCB-generated `_build/main.go` already
consumes for all third-party receivers.
- Follow-up to **PR-F #197** (which ported off `internal/selftelemetry`
+ `internal/runtime/lifecycle` into in-package siblings) and mirrors
**PR-B2 #201** (which did the same swap for nccl_fr). After this PR
the receiver has zero `internal/*` imports, clearing the PR-I.1
submodule-extraction gate for containerstdout.
- Factory is now `receiver.NewFactory(componentType,
createDefaultConfig, receiver.WithLogs(createLogs,
component.StabilityLevelBeta))` instead of a hand-rolled struct
implementing `internal/pipeline.ReceiverFactory`. Stability level
(`Beta`) preserved across the swap so OCB-surfaced metadata doesn't
regress. The `Factory` package-var + `type factory struct{}` are
deleted; each OCB-stitched pipeline gets a freshly-built factory via
`containerstdout.NewFactory()` (mirrors upstream-contrib
otlpreceiver / filelogreceiver and the sibling nccl_fr port).
- Receiver + noopReceiver no longer embed `pipeline.ComponentState`
(upstream `component.Component` carries no equivalent
Started/Stopped mixin; the runtime never read that bookkeeping on
the upstream graph). Lifecycle bookkeeping the receiver actually
needs lives in the in-package `lifecycle` helper added in PR-F #197.
- Logger swapped from `*slog.Logger` → upstream's `*zap.Logger` (the
type carried in `receiver.Settings.Logger`). All log call sites
converted to `zap.String/Int64/Float64/Bool/Error` fields; log
messages and field names are byte-for-byte preserved so operator
alerting on log content does not regress. Internal lifecycle helper,
tailer, informer, pipeline, and receiver all converted in lockstep.
## Type-swap reference
Inherited verbatim from PR-B2 #201 — the canonical mapping for the
PR-F.2 receiver/exporter ports.
| Internal | Upstream |
|---|---|
| `internal/pipeline.Type` | `component.Type` |
| `internal/pipeline.ReceiverFactory` | `receiver.Factory` |
| `internal/pipeline.CreateSettings` | `receiver.Settings` (via
`receivertest.NewNopSettings` in tests) |
| `internal/pipeline.Config` | `component.Config` |
| `internal/pipeline.Receiver` | `receiver.Logs` (`= interface{
component.Component }`) |
| `internal/pipeline.Host` | `component.Host` (via
`componenttest.NewNopHost` in tests) |
| `internal/pipeline.ID` | `component.ID` |
| `internal/consumer.Logs` | `consumer.Logs` |
| `*slog.Logger` | `*zap.Logger` |
| `internal/pipeline.MustNewType` | `component.MustNewType` |
| `internal/pipeline.MustNewID` | `component.NewIDWithName` |
## Hard gate
PR-I.1 (submodule extraction to
`module/receiver/containerstdoutreceiver/`)
requires zero `internal/*` imports from the receiver package. This PR
clears it:
```
$ grep -rn 'internal/pipeline\|internal/consumer\|internal/runtime/lifecycle\|internal/selftelemetry' components/receivers/containerstdout/*.go
(no matches)
```
Comment-only historical references remain in `factory.go`,
`receiver.go`, `noop_receiver.go`, `selftel.go`, `kind_test.go`, and
`selftel_test.go` documenting the v0.1.x → v0.2.0 migration; they are
not imports.
## Predecessor / scope
- **PR-B2 #201** (merged 2026-05-31) — same swap on nccl_fr; reference
template for the type-swap table above.
- **PR-F #197** (merged 2026-05-31) — extracted `internal/selftelemetry`
+ `internal/runtime/lifecycle` into in-package siblings (`selftel.go`,
`lifecycle.go`, `CapturingTelemetry`, local `Kind*` consts). This PR
builds on top.
Together with the sibling receiver/exporter ports already merged
(clockreceiver / kernelevents / stdoutexporter / k8sevents / otlphttp /
pyspy / dcgm / nccl_fr), this is the last `internal/{pipeline,consumer}`
import site on `components/receivers/containerstdout` — once the other
sibling PR-F.2 ports land, RFC-0013 PR-F can delete the
`internal/{pipeline,consumer}` packages outright.
## Test removals (intentional)
Three tests are removed because the upstream API makes them
tautological:
- `TestFactory_CreateMetrics_Unsupported` /
`TestFactory_CreateTraces_Unsupported` — `receiver.NewFactory(...
WithLogs(...))` returns a factory whose CreateMetrics / CreateTraces
surface upstream's `componenterror.ErrDataTypeIsNotSupported`
naturally; no hand-rolled sentinel to pin.
- `TestNewFactory_ReturnsPackageVarFactory` — there is no longer a
`Factory` package-var; `NewFactory()` constructs a fresh factory
each call, mirroring upstream-contrib. Mirrors the PR-B2 nccl_fr
removal.
## Compatibility note
`go.mod` promotes
`go.opentelemetry.io/collector/component/componenttest`
from indirect to direct (used by `receiver_test.go` +
`pipeline_test.go` for `componenttest.NewNopHost()`). No transitive-dep
churn beyond that — all `go.opentelemetry.io/collector/{component,
receiver,consumer}` v1.59.0 + `receiver/receivertest` v0.153.0 were
already pinned by PR-B2.
## Test plan
- [x] `make check` — gofumpt clean, golangci-lint 0 issues, vet clean,
go mod verified.
- [x] `go test -race ./components/receivers/containerstdout/...
-count=10`
— all tests green under race across 10 runs, including stress runs
of `TestTailer_RotationStalledKind` and the TOCTOU pin
`TestContainerstdout_Lifecycle_ConcurrentAddDuringShutdown_NoPanic`.
- [x] `go test ./...` — full repo green except the pre-existing
`TestK8sevents_Lifecycle_ConcurrentAddDuringShutdown_NoPanic`
race-window flake (passes on retry; documented in PR-B2 #201 +
PR-F #197 bodies).
- [x] `TestContainerstdout_SelfTel_ScopeNameIsReceiverImportPath` still
pins the OTel scope name to the receiver's Go import path
(`github.com/tracecoreai/tracecore/components/receivers/containerstdout`)
so a regression back to the deleted internal/selftelemetry scope
fails here.
```release-notes
NONE
```
Signed-off-by: Tri Lam <tri@maydow.com>
Co-authored-by: Tri Lam <tri@maydow.com>
trilamsr
added a commit
that referenced
this pull request
May 31, 2026
) ## Summary - Port `components/receivers/pyspy` off the v0.1.x internal facades (`internal/pipeline`, `internal/consumer`, `internal/runtime/lifecycle`) onto upstream `go.opentelemetry.io/collector/{component,receiver,consumer}` v1.59.0 — the canonical types the OCB-generated `_build/main.go` already consumes for all third-party receivers. Mirrors PR-B2 #201 (`nccl_fr` port) one-for-one; sibling wave of the PR-F.2 series. - Factory is now `receiver.NewFactory(componentType, createDefaultConfig, receiver.WithLogs(createLogs, stability))` instead of a hand-rolled struct implementing `internal/pipeline.ReceiverFactory`. The hand-rolled `var Factory` + `NewFactory()` indirection wrapper is deleted — callers construct via `pyspy.NewFactory()` directly, mirroring upstream `otlpreceiver` / `filelogreceiver`. The `tools/components-gen` driver that motivated the package-var was deleted in PR-A2 #168, so no consumer remains. - Stability level pinned at `Alpha` — pyspy is in-tree but NOT registered with the OCB-stitched main (per `install/kubernetes/tracecore/values.yaml` comment: "NOT registered by OCB; no upstream equivalent yet"). The Beta-pin path is reserved for when chart enablement crosses out of "always-disabled in default values.yaml" — same gate PR-B2 used for nccl_fr but at a different milestone. - Receiver struct is `pyspyReceiver` (already the local name; no rename needed) and implements `receiver.Logs` via a `Start(ctx, component.Host) error` / `Shutdown(ctx) error` pair — the `pipeline.ComponentState` embed was dropped (upstream `component.Component` carries no equivalent mixin; the lifecycle bookkeeping the receiver actually needs lives in the sibling `lifecycle.go` helper added in PR #194). - Logger swapped from `*slog.Logger` → upstream's `*zap.Logger` (the type carried in `component.TelemetrySettings.Logger`). All log call sites converted to `zap.String/Int/Int64/Duration/Error` fields; log messages and fields are byte-for-byte preserved so operator alerting on log content does not regress. - `selftel.go` swap: `newSelfTelemetry(id pipeline.ID, ...)` → `newSelfTelemetry(id component.ID, ...)`. The instrumentation scope name (`github.com/tracecoreai/tracecore/components/receivers/pyspy`) and the five metric instrument names + label shapes are preserved — scope-name pin test (`TestPyspy_ScopeNameIsReceiverImportPath`) and the factory-fallback contract test (`TestPyspy_FallsBackToNoopWhenMeterFails`) still pass unchanged. ## Hard gate PR-I.1 (submodule extraction to `module/receiver/pyspyreceiver/`) requires `grep -r 'internal/(pipeline|consumer|runtime/lifecycle)' components/receivers/pyspy/` to return zero hits. This PR clears it: ``` $ grep -rn 'internal/pipeline\|internal/consumer\|internal/runtime/lifecycle' components/receivers/pyspy/*.go components/receivers/pyspy/lifecycle.go:4:// v0.1.x dependency on `internal/runtime/lifecycle`, which is slated ``` One comment-only mention remains in `lifecycle.go` — historical context for the v0.1.x → v0.2.0 migration, not an import. ## Predecessor PR #194 (`feat(pivot): port pyspy off internal selftel + lifecycle`, merged before this) ported the **self-telemetry + lifecycle** helpers into the package as siblings. This PR handles the **pipeline + consumer + factory** layer — the last remaining `internal/*` imports — mirroring the PR-B1 → PR-B2 split for `nccl_fr`. ## Test plan - [x] `go build ./...` — green - [x] `go test ./components/receivers/pyspy/... -race` — all tests pass - [x] `go test ./...` — green except pre-existing flake in `components/receivers/kernelevents/TestKernelevents_Lifecycle_ConcurrentAddDuringShutdown_NoPanic` (verified flaky on `git stash` of pyspy changes — predates this PR) - [x] `make check` — golangci-lint + go vet + go mod verify — green - [x] Scope-name pin (`TestPyspy_ScopeNameIsReceiverImportPath`) still asserts `github.com/tracecoreai/tracecore/components/receivers/pyspy` - [x] Factory fallback contract (`TestPyspy_FallsBackToNoopWhenMeterFails`) still surfaces `tracecore.selftelemetry.init_errors_total` when every `tracecore.receiver.*` instrument registration is synthetically failed - [x] Sibling-types pin (`TestPyspy_SiblingTypesArePackageLocal`) still enforces selfTelemetry + kind ownership by the receiver package - [x] All 11 RFC-0009 §Degraded modes still covered by `TestKinds_AllRFC0009DegradedModesCovered` - [x] Linux integration gate (`TestIntegration_NoBannedSyscalls`) still runs the receiver under strace in `target_not_attached` posture ## Compatibility note `go.mod` promotes `go.opentelemetry.io/collector/pipeline v1.59.0` from indirect → direct (used by `factory_test.go` for the `pipeline.ErrSignalNotSupported` sentinel — upstream's canonical "signal not supported" error that `receiver.NewFactory`'s default unimplemented handlers return). No transitive-dep churn. ```release-notes NONE ``` ## Type-swap reference Inherits the PR-B2 #201 type-swap table verbatim. Repeated here for the PR-F.2 series tracking sheet: | Internal | Upstream | |---|---| | `internal/pipeline.Type` | `component.Type` | | `internal/pipeline.ReceiverFactory` | `receiver.Factory` | | `internal/pipeline.CreateSettings` | `receiver.Settings` (via `receivertest.NewNopSettings` in tests) | | `internal/pipeline.Config` | `component.Config` | | `internal/pipeline.Receiver` | `receiver.Logs` (`= interface{ component.Component }`) | | `internal/pipeline.ErrSignalNotSupported` | `pipeline.ErrSignalNotSupported` (`go.opentelemetry.io/collector/pipeline`) | | `internal/pipeline.ComponentState` | (dropped — lifecycle bookkeeping lives in sibling `lifecycle.go`) | | `internal/consumer.Logs` | `consumer.Logs` | | `*slog.Logger` | `*zap.Logger` | | `internal/pipeline.MustNewType` | `component.MustNewType` | | `internal/pipeline.MustNewID` | `component.NewIDWithName` | ## Test-helper changes - `pyspy_test.go` adds a package-local `testSettings()` wrapper around `receivertest.NewNopSettings(componentType())` that pins the ID to `pyspy/test` so selftel label assertions stay deterministic (a per-run UUID would defeat the `component_id=pyspy/test` asserts). Mirrors the nccl_fr PR-B2 pattern. - `integration_linux_test.go` drops the `nopHost` struct + the `pipelinetest.NewHost()` dependency — the strace harness passes `nil` for `component.Host` (the receiver doesn't read it). - `pyspy_test.go` and `selftel_test.go` swap every `pipelinetest.NewHost()` call to `nil` for the same reason — same pattern PR-B2 established. - `factory_test.go` deletes `TestPyspy_NewFactory_ReturnsTheSamePackageVar` since the `var Factory` package-var is gone (tools/components-gen driver was deleted in PR-A2 #168 — the codegen seam this test pinned no longer exists). Signed-off-by: Tri Lam <tri@maydow.com> Co-authored-by: Tri Lam <tri@maydow.com>
trilamsr
added a commit
that referenced
this pull request
May 31, 2026
#204) ## Summary - Port `components/receivers/k8sevents` off the v0.1.x internal facades (`internal/pipeline`, `internal/consumer`, `internal/runtime/lifecycle`) onto upstream `go.opentelemetry.io/collector/{component,receiver,consumer}` v1.59.0 — the canonical types the OCB-generated `_build/main.go` already consumes. Mirrors PR-B2 #201 (nccl_fr); same type-swap table applied. - Factory is now `receiver.NewFactory(componentType, createDefaultConfig, receiver.WithLogs(createLogs, component.StabilityLevelBeta))` instead of a hand-rolled struct implementing `internal/pipeline.ReceiverFactory`. Stability level (`Beta`) preserved so OCB-surfaced metadata doesn't regress. - `k8sEventsReceiver` implements `receiver.Logs` via `Start(ctx, component.Host) error` / `Shutdown(ctx) error`; the `pipeline.ComponentState` embed dropped (upstream `component.Component` carries no equivalent mixin; the multi-source lifecycle bookkeeping already lives in the sibling `lifecycle.go` from PR #196). - Logger swapped from `*slog.Logger` → upstream's `*zap.Logger`. Every call site converted to `zap.String / Int / Int64 / Duration / Strings / Bool / Error` fields; log messages and field names preserved byte-for-byte so operator log-content alerting doesn't regress. ## Multi-source specifics Unlike PR-B1/B2 nccl_fr (single-source, single `lc.Start`), k8sevents runs an Events informer + an optional Node informer in parallel under the package-local lifecycle helper's `Add()`. Both sources fan into the same `selfTelemetry` instance; the receiver-wide degraded flag stays the OR of per-source `degradedEvent` / `degradedNode` bits — preserved across the port. Per-source error kinds (`KindNodeWatch`, `KindNodeParse`, `KindNodePanic`, `KindNodeBackpressureDrop`) still fire on the correct path; the `TestReceiver_NodeWatchErrorFiresDistinctKind` / `TestReceiver_EmitNodePreservesEventDegraded` / `TestReceiver_NodeParseAndPanicFireDistinctKinds` falsifiers stay green. ## Hard gate PR-I.1 (submodule extraction) requires zero `internal/(pipeline| consumer|runtime/lifecycle)` import hits in the package. This PR clears it: ``` $ grep -rn 'internal/pipeline\|internal/consumer\|internal/runtime/lifecycle' \ components/receivers/k8sevents/*.go components/receivers/k8sevents/factory.go:27:// internal/pipeline factory; PR-F preserves it across the upstream components/receivers/k8sevents/lifecycle.go:4:// v0.1.x dependency on `internal/runtime/lifecycle`, which is slated ``` Two comment-only mentions remain — historical context for the v0.1.x → v0.2.0 migration, not imports. ## Predecessor PR #196 (merged) ported the **self-telemetry + lifecycle helpers** into the package as siblings (with the multi-source `Add()` k8sevents needs). This PR handles the **pipeline + consumer + factory** layer — the last remaining `internal/*` imports in the package. ## Type-swap reference Same mapping PR-B2 #201 established: | Internal | Upstream | |---|---| | `internal/pipeline.Type` | `component.Type` | | `internal/pipeline.ReceiverFactory` | `receiver.Factory` | | `internal/pipeline.CreateSettings` | `receiver.Settings` (via `receivertest.NewNopSettings` in tests) | | `internal/pipeline.Config` | `component.Config` | | `internal/pipeline.Receiver` | `receiver.Logs` (`= interface{ component.Component }`) | | `internal/consumer.Logs` | `consumer.Logs` | | `*slog.Logger` | `*zap.Logger` | | `internal/pipeline.MustNewType` | `component.MustNewType` | | `internal/pipeline.MustNewID` | `component.NewIDWithName` | | `set.Telemetry.Logger` / `set.Telemetry.MeterProvider` / `set.Telemetry.Resource` | `set.Logger` / `set.MeterProvider` / `set.Resource` (flattened via embedded `TelemetrySettings`) | ## Test plan - [x] `go build ./...` — green - [x] `go test -race ./components/receivers/k8sevents/...` — 60+ tests pass (incl. multi-source informer + degraded-state falsifiers + goleak) - [x] `go test ./...` — green except pre-existing `kernelevents/TestReceiver_SLIBudget` flake (passes on retry; same flake PR-B2 documented) - [x] `make check` — golangci-lint + go vet + go mod verify — green - [x] No `log/slog` imports remain in the package - [x] Hard-gate `grep` returns only the two comment-only mentions ## Compatibility note No new module versions added — k8sevents inherits the upstream pins PR-B2 already brought in (`collector/component`, `collector/receiver`, `collector/consumer` v1.59.0; `zap` 1.28.0; `receiver/receivertest` v0.153.0). ```release-notes NONE ``` Signed-off-by: Tri Lam <tri@maydow.com> Co-authored-by: Tri Lam <tri@maydow.com>
trilamsr
added a commit
that referenced
this pull request
May 31, 2026
#205) ## Summary Ports `components/receivers/clockreceiver` off `internal/{pipeline,consumer,runtime/lifecycle}` onto upstream OTel v1.59.0 types, mirroring PR-B2 (#201) which did the same for `nccl_fr`. Unblocks RFC-0013 §migration PR-F.2 (deletion of the three internal packages once every receiver/exporter has migrated). Third receiver port in the cross-receiver upstream-API wave (after `nccl_fr` #201; siblings for kernelevents/stdoutexporter/k8sevents/containerstdout/otlphttp/pyspy running in parallel). ## Type swap applied | Internal | Upstream | |---|---| | `internal/pipeline.Type` | `component.Type` | | `internal/pipeline.ReceiverFactory` | `receiver.Factory` | | `internal/pipeline.CreateSettings` | `receiver.Settings` (via `receivertest.NewNopSettings`) | | `internal/pipeline.Config` | `component.Config` | | `internal/pipeline.Receiver` | `receiver.Metrics` | | `internal/consumer.Metrics` | `consumer.Metrics` | | `*slog.Logger` | `*zap.Logger` | | `internal/pipeline.MustNewType` | `component.MustNewType` | | `internal/pipeline.MustNewID` | `component.NewIDWithName` | ## Shape changes - `NewFactory()` returns a fresh `receiver.Factory` each call (mirrors upstream `otlpreceiver` / `filelogreceiver`); the v0.1.x `clockreceiver.Factory` package-var is gone. No external Go consumers exist outside the receiver dir, so this is internally safe (kernelevents + stdoutexporter doc comments referencing the var are unchanged — they'll get rewritten by their own in-flight upstream-port PRs). - `clockReceiver` struct → `Receiver` (exported, matches "single-Type-per-package" upstream convention). - `pipeline.ComponentState` embedding dropped — the upstream `receiver.Metrics` interface is now the only lifecycle contract, pinned at build time via `var _ receiver.Metrics = (*Receiver)(nil)`. The only test that depended on `Started()/Stopped()` accessors (`TestReceiver_ComponentStateFlags`) is removed; equivalent guarantee is now the compile-time interface assertion. - `createMetrics` now calls `cfg.Validate()` before constructing the receiver, mirroring PR-B2. Catches `interval=5ms` at component-construction time instead of first tick. ## Test rewrites - `selftel_test.go` + `clockreceiver_test.go` use `receivertest.NewNopSettings(componentType())` for stable settings; ID overridden to `clockreceiver/test` so scope/label assertions stay deterministic. - `errors_integration_test.go` drops `internal/pipeline/pipelinetest` by inlining a 10-line `failingMetricsSink`. `internal/telemetry` (MeterProvider + Prometheus handler) is kept — it's not in the banned set and the Prometheus surface assertion is the point of the test. - `lifecycle_test.go` uses `zap.NewNop()` instead of `slog.Default()`. ## Verification - `grep "internal/pipeline\|internal/consumer\|internal/runtime/lifecycle" components/receivers/clockreceiver/*.go` returns only doc-comment references to the v0.1.x history (no live imports / call sites). - `make check` — golangci-lint 0 issues, `go vet ./...` clean, `go mod verify` ok. - `go test -race -count=1 ./components/receivers/clockreceiver/...` — pass (1.6s). - `go test -count=1 ./...` — pass everywhere except a pre-existing flaky `TestReceiver_SLIBudget` in `kernelevents` (CPU-budget assertion, p99 16ms vs 5ms target; reproduces on second run as PASS — orthogonal to this PR). ## Test plan - [x] `make check` clean. - [x] `go test -race ./components/receivers/clockreceiver/...` green. - [x] `go test ./...` — only sibling-receiver flake (not introduced here). - [x] Diff swept for banner / drive-by comments (pre-push doc-check enforces). ```release-notes NONE ``` Refs: PR-B2 #201, RFC-0013 §migration PR-F.2. Signed-off-by: Tri Lam <tri@maydow.com> Co-authored-by: Tri Lam <tri@maydow.com>
trilamsr
added a commit
that referenced
this pull request
May 31, 2026
…#207) ## Summary Ports the in-tree `components/exporters/otlphttp` off `internal/{pipeline,consumer}` to the upstream OTel collector exporter API (v1.59.0 / v0.153.0). Mirrors the PR-B2 nccl_fr receiver port (#201) on the exporter flavor. This is RFC-0013 §migration cleanup: `internal/pipeline` and `internal/consumer` are slated for deletion by PR-F. Until this PR, otlphttp blocked that deletion. After this PR, OCB can stitch otlphttp alongside upstream-contrib exporters without a translation layer. ## Type-swap surface | Before (`internal/*`) | After (upstream) | | ---------------------------------- | ----------------------------------------- | | `pipeline.ExporterFactory` + `Factory` var | `exporter.NewFactory(...)` constructor | | `pipeline.CreateSettings` | `exporter.Settings` | | `pipeline.BuildInfo` | `component.BuildInfo` | | `pipeline.ID` | `component.ID` | | `pipeline.ComponentState` (embed) | local `sync.Mutex + bool` for idempotent `Shutdown` | | `*slog.Logger` | `*zap.Logger` (upstream `TelemetrySettings.Logger`) | | `pipelinetest.New(t).CreateSettings` | `exportertest.NewNopSettings(componentType())` | | `consumer.Capabilities` (internal) | `consumer.Capabilities` (upstream — same name, new import) | ## Behavior preserved across the swap - Retry semantics (429/502/503/504 + Retry-After integer / RFC 1123 / clamping). - Idempotent `Shutdown` that drains in-flight `Consume*` (`inflight` WaitGroup pattern + TOCTOU-safe ordering). - Self-telemetry metric names and label shape (`tracecore.exporter.calls_total{result,kind,component_id}`, `tracecore.selftelemetry.init_errors_total`). - Sentinel-based `classifyKind` (`errPermanentStatus` / `errRetryableStatus` → `kindDownstream`). - Header canonicalization, gzip threshold, user-agent format. - Stability level (`StabilityLevelBeta`) carried via `WithMetrics/Traces/Logs`. ## Behavior intentionally dropped None new — the per-exporter `ExporterCarrier` / `FailureRateReader` plumbing was already removed by the earlier selftelemetry port (#193). This PR is mechanical type-swap only. ## Compile-time guard `factory.go` now pins `_ exporter.Metrics = (*otlpExporter)(nil)` (plus Traces/Logs) so upstream shape changes surface at build time, not at OCB stitch time. ## Test plan - [x] `go test -race ./components/exporters/otlphttp/...` (green, 2.7s) - [x] `go build ./...` - [x] `make check` (lint + vet + tidy + doc-check + mod verify — all green) - [x] `zaptest/observer`-based assertion for `signal=metrics/traces/logs` Stringer rendering (replaces the prior `slog.NewTextHandler` byte-buffer assertion) - [x] `failingExporterMP` synthetic-failure path still falls back to noop telemetry and ticks `init_errors_total` - [x] Existing `pipelinetest` callers in this package removed; no other in-tree caller references the deleted `otlphttp.Factory` package var ```release-notes NONE ``` Signed-off-by: Tri Lam <tri@maydow.com> Co-authored-by: Tri Lam <tri@maydow.com>
This was referenced May 31, 2026
trilamsr
added a commit
that referenced
this pull request
May 31, 2026
## Summary Reconcile the four pivot-tracking docs (`docs/rfcs/0013-distro-first-pivot.md`, `CHANGELOG.md`, `MILESTONES.md`, `docs/migration/v0.1-to-v0.2.md`) with the wave-3 (PR-B1-shape sibling ports) and wave-4 (PR-B2-shape upstream-only ports + PR-F.1 + PR-J + PR-L + PR-N) landings. Pure doc sweep — no code or config touched. ## What changed ### `docs/rfcs/0013-distro-first-pivot.md` §migration PR sequence rows updated with PR-number citations and landed markers: - **PR-A2** (landed, #189, 2026-05-30) - **PR-B2** (landed, #201) — also enumerates sibling-receiver follow-ups under PR-B2 to dispel the slug collision with #188's PR-B2-labelled dcgm port: stdoutexporter (#202), pyspy (#203), kernelevents (#208), containerstdout (#209) - **PR-F.1** (landed) — fleshed-out delete list (`internal/{selftelemetry,telemetry}` + `components/receivers/dcgm/` + `pkg/dcgm/` + one orphan clockreceiver integration test) - **PR-F.2** re-scoped — now deletes the whole `internal/{componentstatus,pipeline,pipelinebuilder,consumer,fanout,runtime/lifecycle}` bundle in one cut once the last three pipeline+consumer-importing receivers land (#204 k8sevents, #205 clockreceiver, #207 otlphttp). Per the import-graph state — `internal/componentstatus`'s only non-test consumer is `internal/pipeline`, so they delete together - **PR-G** (landed, #182), **PR-H** (landed, #183) - **PR-I.1a** (in flight — scaffold agent), **PR-I.1b** (pre-staged; gate satisfied by #201) - **PR-J** (landed, #195) — kept existing marker - **PR-K.1** (in flight — separate agent landing) - **PR-L** (landed, skeleton #179 + body #191) — flagged as living document - **PR-N** (landed, #200) — shipped at v0.1.0 ahead of v0.3.0 as a doc-only update at `docs/migration/v0.2-to-v0.3.md` ### `CHANGELOG.md` [Unreleased] - Restructured the pivot wave list as **four waves** (was three). Wave 3 enumerates PR-B1-shape sibling ports + support infra (#180-#194/#196). Wave 4 enumerates PR-B2-shape upstream-only ports + PR-J (#195) + PR-F.1 (#206) + PR-N (#200) + lint/TOCTOU hardening (#198/#210). - Tightened the PR-F.2 deferred note to point at the three open ports (#204/#205/#207) as the gate. ### `MILESTONES.md` - **M1** (pipeline runtime) — status row now cites PR-A2 (#189), PR-F.1 (#206), PR-F.2 gate (#204/#205/#207), PR-E (#180), retains `internal/config/` (still load-bearing for `tracecore validate`). - **M2** (self-telemetry) — status row now cites PR-F.1 (#206); flags `internal/componentstatus` as travelling with `internal/pipeline` in PR-F.2. - **M8** (DCGM receiver) — status flipped to *landed-and-replaced*: cites PR-F.1 (#206) deletion + PR-J (#195) `docs/integrations/prometheus-scrape.md` recipe. Notes the inert chart toggle retention until PR-K.3. ### `docs/migration/v0.1-to-v0.2.md` - §`internal/*` package deletion (PR-F) status flips from "not yet open" to "PR-F.1 landed (#206), PR-F.2 gated on three open ports". - Open-items checklist expanded from 5 to 13 entries — tracks every PR letter the migration guide cares about (A2 / E / F.1 / F.2 / I.1a-c / J / K.1-3 / L / N) with PR numbers and links. ## Why now Tracking docs accumulated drift across wave-3 + wave-4 because every sibling-port PR (and the support-infra PRs around them) updated the bottom of `CHANGELOG.md` but did not always touch the upstream sequencing section in RFC-0013. Per memory rule `[Keeping this document current]`: status drift is a review blocker. This PR is the consolidated catch-up; future port PRs include their RFC-row flip in-PR. ## What this PR does NOT change - No code, no config, no YAML, no chart — only the four tracking docs. - No new doc gates added; existing gates pass. - No PRs other than the four named docs are modified. ## Test plan - [x] `bash scripts/doc-check.sh` clean (33 test refs, 528 links resolve, comment-noise diff gate clean vs `origin/main`, all 13 gates green). - [x] Pre-commit hook (`commitlint` 72-char subject limit + DCO + AI-trailer gates) passed. - [x] Pre-push hook (`make ci-fast` equivalent: `golangci-lint`, `go vet`, `go mod verify`, `no-autoupdate-check`, `doc-check.sh`) passed on second attempt after `git fetch origin main` populated the worktree's `origin/main` ref — first push failed because the worktree previously tracked the (gone) `pr-a2-ocb-main-swap` branch, so `doc-check.sh`'s comment-noise diff-scope gate exited 128 on the missing ref. Root cause fixed by the fetch; not a workaround. - [ ] CI green on this branch. ```release-notes NONE ``` Signed-off-by: Tri Lam <tri@maydow.com> Co-authored-by: Tri Lam <tri@maydow.com>
trilamsr
added a commit
that referenced
this pull request
May 31, 2026
## Summary Deletes the seven `internal/*` packages that RFC-0013 §migration step 8 PR-F.2 promised once the upstream-port wave (#201/#202/#203/#204/#205/#207/#208/#209) cleared every external caller of the in-tree pipeline runtime. **Net: -6,888 LOC across 56 deleted files, +80 LOC across 14 modified files. 70 files total.** This is the final cut of RFC-0013 §migration step 8 PR-F. ## What deletes | Path | LOC | Replacement | |---|---|---| | `internal/pipeline/` | 4,134 | `go.opentelemetry.io/collector/service` (OCB-generated `_build/main.go` consumes `builder-config.yaml`). | | `internal/pipelinebuilder/` | 1,282 | Same — assembly is upstream `service`. | | `internal/config/` | 718 | Upstream `confmap` providers (`file`, `yaml`, `env`). | | `internal/consumer/` | 87 | Upstream `go.opentelemetry.io/collector/consumer`. | | `internal/fanout/` | 366 | Upstream `internal/fanoutconsumer` (collector module). | | `internal/componentstatus/` | 16 | Upstream `component/componentstatus.ReportStatus` (same free-function shape). | | `internal/runtime/lifecycle/` | 505 | Per-receiver package-local `lifecycle.go` siblings — already ported during the PR-B1 wave (#184/#185/#186/#187/#194/#196/#197); the in-tree helper had no remaining non-test consumer after PR-F.1 + the wave-2 upstream-port PRs. `kernelevents/lifecycle.go` was inherited from k8sevents (#208). | ## Pre-flight grep evidence ``` $ grep -rn 'tracecoreai/tracecore/internal/(pipeline|consumer|pipelinebuilder|config|fanout|componentstatus|runtime/lifecycle)' --include='*.go' . (zero matches) ``` ## Tooling - `.golangci.yml` `ignore-interface-regexps` repointed at upstream `consumer.{Metrics,Traces,Logs}` + `component.Component`. The in-tree-only same-package-error-wrap exemption stays — the STYLE rule applies regardless of which interface is forwarded. - `.github/workflows/chaos.yml` drops the `chaos-pipeline-test` job (the in-tree `internal/pipeline/chaos_test.go` is gone; upstream `service` provides the equivalent panic-recovery contract). `harness-determinism` (failure-inject golden-SHA), `cpu-steal-mpstat`, `pattern-pod-evicted` jobs preserved. - `.github/workflows/install-bench.yml` drops the `internal/{pipeline,runtime,selftelemetry}/**` path-filter rows. - `go.mod` / `go.sum` unchanged. ## Doc sweep - `CHANGELOG.md` Unreleased: PR-F.2 landed entry replacing the "PR-F.2 deferred" sentence; "Remaining v0.1.0 work" line updated; one dead `internal/pipeline/README.md` link in Foundation block rewritten as "deleted at v0.1.0". - `docs/rfcs/0013-distro-first-pivot.md` §7 deletion table: both pipeline-internals and runtime/lifecycle rows updated from "v0.1.0 (audit first…)" / "v0.2.0 (with last consumer)" to "v0.1.0 (landed PR-F.2)". §migration step 8 reframed. - `docs/FAILURE-MODES.md` Lifecycle / Data flow / Shutdown timing / Backend tables rewired from in-tree `internal/{config,pipeline,fanout}/*_test.go::TestName` pointers to upstream-delegated wording matching the pattern PR-A2 established. - `docs/STRATEGY.md` "Post-RFC-0013 status" intro updated; "Stable interfaces in `internal/pipeline/`" graduation row rewritten to point at the upstream surface. - `docs/migration/v0.1-to-v0.2.md` `internal/*` section status banner flipped from "deferred, still present in RC builds" to "landed, deleted in v0.2.0 builds". - `MILESTONES.md` v0.1.0 deletions row extended with boot-path internals; M1 + M4b + M19 rubric details annotated with the PR-F.2 retirement. - `README.md` Contributor row repointed at upstream `go.opentelemetry.io/collector` package docs. - `AGENTS.md` "Self-telemetry internals" bullet split into "Self-tel internals" + "Pipeline / boot-path internals" with explicit deletion status. - `docs/README.md` table row for `internal/pipeline/README.md` dropped. - `components/receivers/kernelevents/README.md` lifecycle-sibling rationale updated to past-tense. - `tools/failure-inject/README.md` "Testing locally" section drops the `-tags=chaos ./internal/pipeline/...` invocation. ## Sequencing This PR is hard-gated on every upstream-port PR landing first: - #201 nccl_fr (PR-B2) - #202 stdoutexporter - #203 pyspy - #204 k8sevents - #205 clockreceiver (PR-B3) - #207 otlphttp - #208 kernelevents - #209 containerstdout - #206 PR-F.1 (selftel / telemetry / dcgm) All nine merged before this PR opened; this is the moat-deletion payoff. Remaining v0.1.0 work is PR-K (chart-default flip + `clockreceiver` + `stdoutexporter` + remaining receiver source deletions, coupled with test-fixture migration and the `telemetry:` values-key deprecation cycle). ## Test plan - [x] `make check` — golangci-lint 0 issues, go vet clean, go mod verify ok. - [x] `go build ./...` — clean. - [x] `go test -count=1 ./...` — green (excluding the known `kernelevents/TestReceiver_SLIBudget` flake called out in #205's body, which only triggers under heavy parallel `go test ./...` load; passes standalone). - [x] `grep` confirms zero non-internal callers of the deleted packages. - [x] Doc-check pre-push hook passes after the CHANGELOG dead-link fix. ```release-notes [CHANGE] internal/{pipeline,pipelinebuilder,config,consumer,fanout,componentstatus,runtime/lifecycle} packages deleted. The OCB-generated boot path off builder-config.yaml replaces them. Third-party importers of internal/* (unlikely pre-1.0; the packages live under internal/ and the Go compiler rejects external imports) lose the pipeline-assembly + lifecycle + config-loader surfaces; receiver authors now wire against upstream go.opentelemetry.io/collector/{component,receiver,consumer,pipeline} directly. See docs/migration/v0.1-to-v0.2.md "internal/* package deletion". ``` --------- Signed-off-by: Tri Lam <tri@maydow.com> Co-authored-by: Tri Lam <tri@maydow.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
components/receivers/nccl_froff the v0.1.x internal facades(
internal/pipeline,internal/consumer,internal/runtime/lifecycle)onto upstream
go.opentelemetry.io/collector/{component,receiver,consumer}v1.59.0 — the canonical types the OCB-generated
_build/main.goalready consumes for all third-party receivers.
receiver.NewFactory(componentType, createDefaultConfig, receiver.WithLogs(createLogs, component.StabilityLevelBeta))insteadof a hand-rolled struct implementing
internal/pipeline.ReceiverFactory.Stability level (
Beta) preserved across the swap so OCB-surfacedmetadata doesn't regress.
ncclFRReceiver(avoids collision with theupstream
receiverpackage name) and implementsreceiver.Logsviaa
Start(ctx, component.Host) error/Shutdown(ctx) errorpair —the
pipeline.ComponentStateembed was dropped (upstreamcomponent.Componentcarries no equivalent mixin; the lifecyclebookkeeping the receiver actually needs lives in the sibling
lifecycle.gohelper added in PR-B1 feat(pivot): PR-B1 — port nccl_fr off internal selftel + lifecycle #184).*slog.Logger→ upstream's*zap.Logger(the type carried in
component.TelemetrySettings.Logger). All logcall sites converted to
zap.String/Int64/Duration/Errorfields;log messages and fields are byte-for-byte preserved so operator
alerting on log content does not regress.
Hard gate
PR-I.1 (submodule extraction to
module/receiver/ncclfrreceiver/) requiresgrep -r 'internal/(pipeline|consumer|runtime/lifecycle)' components/receivers/nccl_fr/to return zero hits. This PR clears it:
(Two comment-only mentions remain in
lifecycle.goandfactory.go—historical context for the v0.1.x → v0.2.0 migration, not imports.)
Predecessor
PR-B1 #184 (merged 2026-05-30) ported the self-telemetry + lifecycle
helpers into the package as siblings. This PR (PR-B2) handles the
pipeline + consumer + factory layer — the last remaining
internal/*imports.Test plan
go build ./...— greengo test ./components/receivers/nccl_fr/... -race— 12 tests passgo test ./...— green except pre-existing flake incomponents/receivers/kernelevents/TestReceiver_SLIBudget(verified flaky on stashed/PR-B2-not-applied tree)
make check— golangci-lint + go vet + go mod verify — greenTestSelfTelemetry_ScopeNameIsReceiverImportPath)still asserts
github.com/tracecoreai/tracecore/components/receivers/nccl_frTestFactory_FallsBackToNoopWhenMeterFails)still surfaces
tracecore.selftelemetry.init_errors_totalwhenevery
tracecore.receiver.*instrument registration is synthetically failedCompatibility note
go.modnow pinsgo.opentelemetry.io/collector/{component,receiver,consumer} v1.59.0— the v1.x stable line aligned with
pdata v1.59.0the repo was already on.No transitive-dep churn beyond zap 1.24.0 → 1.28.0 (upstream component
v1.59.0 requires it).
Type-swap reference
This PR is the first-of-kind upstream-API port; 7 more receiver/exporter
ports (PR-F.2 series — clockreceiver, kernelevents, stdoutexporter,
k8sevents, containerstdout, otlphttp, pyspy, dcgm) inherit this exact
mapping. Use this table as reference when porting those components off
internal/pipeline+internal/consumer.internal/pipeline.Typecomponent.Typeinternal/pipeline.ReceiverFactoryreceiver.Factoryinternal/pipeline.CreateSettingsreceiver.Settings(viareceivertest.NewNopSettingsin tests)internal/pipeline.Configcomponent.Configinternal/pipeline.Receiverreceiver.Logs(= interface{ component.Component })internal/consumer.Logsconsumer.Logs*slog.Logger*zap.Loggerinternal/pipeline.MustNewTypecomponent.MustNewTypeinternal/pipeline.MustNewIDcomponent.NewIDWithNameDeep-review cleanup (post-aec83be)
A follow-up commit applies five reference-pattern fixes so PR-F.2 inherits
the cleanest possible template:
var Factory+ indirection wrapper —NewFactory()nowconstructs the factory directly, mirroring upstream
otlpreceiver/filelogreceiver. Thetools/components-gendriver that motivated thepackage-var was deleted in PR-A2 chore(pivot): delete kueue + kineto receivers per RFC-0013 #168.
receiver.Logscarries a"LogsReceiver tag" — upstream defines
receiver.Logsasinterface { component.Component }; the type identity is adocumentation marker only.
receivertest.NewNopSettings(componentType())so test Settings auto-track upstream field additions (
BuildInfo,TelemetrySettings). A thintestSettings()wrapper pins the ID tonccl_fr/testso selftel label assertions stay deterministic.ncclFRReceiver→ncclfrReceiverper Go acronymconvention (lowercased) and aligned with the planned PR-I.1b package
name
ncclfrreceiver.