feat(otelcol): Add OTLP Profiles support - #6831
Conversation
Signed commits reportAll 6 commits between |
There was a problem hiding this comment.
🟡 Changes recommended
The updated OTLP receiver integration test has a no-timeout wait on an error channel, which can deadlock and hang the test suite.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds experimental OTLP Profiles signal support to Alloy’s otelcol plumbing so profiles can be received (OTLP gRPC/HTTP), routed through the shared consumer fanout/lazy infrastructure, and exported (OTLP exporter), alongside updates to component docs.
Changes:
- Extend
otelcol.Consumer/ConsumerArgumentsand internal consumers (lazy + fanout) to support Profiles. - Teach the shared
otelcolreceiver/exporter wrappers to instantiate Profiles receivers/exporters viaxreceiver/xexporter. - Add/extend integration tests and documentation for Profiles in OTLP receiver/exporter and
outputblocks.
File summaries
| File | Description |
|---|---|
| internal/component/otelcol/receiver/receiver.go | Adds Profiles receiver creation via xreceiver.Factory and profiles fanout. |
| internal/component/otelcol/receiver/otlp/otlp_test.go | Extends OTLP receiver integration test to send/verify Profiles over gRPC and HTTP. |
| internal/component/otelcol/processor/processor.go | Updates consumer wiring to the new 4-arg SetConsumers signature. |
| internal/component/otelcol/processor/discovery/discovery.go | Updates discovery processor exports to the new SetConsumers signature. |
| internal/component/otelcol/internal/lazyconsumer/lazyconsumer.go | Adds Profiles support to the lazy consumer, including cloning behavior and signal-not-supported handling. |
| internal/component/otelcol/internal/lazyconsumer/lazyconsumer_test.go | Adds Profiles to pause/resume and blocking behavior tests. |
| internal/component/otelcol/internal/fanoutconsumer/profiles.go | Introduces profiles fanout consumer with clone-on-mutate behavior. |
| internal/component/otelcol/internal/fanoutconsumer/profiles_test.go | Adds tests for profiles fanout cloning, error aggregation, and nil handling. |
| internal/component/otelcol/internal/fakeconsumer/fake.go | Extends fake consumer to implement ConsumeProfiles. |
| internal/component/otelcol/exporter/prometheus/prometheus.go | Updates consumer export wiring to include the new profiles slot. |
| internal/component/otelcol/exporter/otlp/otlp.go | Enables Profiles signal support for otelcol.exporter.otlp. |
| internal/component/otelcol/exporter/otlp/otlp_test.go | Extends OTLP exporter integration test to verify Profiles export over gRPC. |
| internal/component/otelcol/exporter/loki/loki.go | Updates consumer export wiring to include the new profiles slot. |
| internal/component/otelcol/exporter/exporter.go | Adds Profiles exporter creation via xexporter.Factory and routes it via lazy consumer. |
| internal/component/otelcol/exporter/exporter_test.go | Adds exporter profiles test and updates test factory to xexporter.NewFactory. |
| internal/component/otelcol/consumer.go | Extends otelcol.Consumer and output arguments to include Profiles. |
| internal/component/otelcol/connector/spanlogs/spanlogs.go | Updates consumer export wiring to include the new profiles slot. |
| internal/component/otelcol/connector/connector.go | Updates consumer wiring to the new 4-arg SetConsumers signature. |
| go.mod | Adds required OTel Collector experimental packages for profiles (xconsumer, xreceiver, pprofile, etc.). |
| docs/sources/shared/reference/components/output-block.md | Documents profiles in the shared output block. |
| docs/sources/reference/components/otelcol/otelcol.receiver.otlp.md | Documents profiles output wiring and HTTP endpoint for profiles. |
| docs/sources/reference/components/otelcol/otelcol.exporter.otlp.md | Documents profiles being accepted by the exporter input. |
Review details
- Files reviewed: 22/22 changed files
- Comments generated: 1
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
There was a problem hiding this comment.
🟡 Changes recommended
The OTLP receiver test can deadlock due to an unbounded wait on profilesErrCh, and the current OTel Collector module version skew in go.mod risks incompatibilities for the new Profiles plumbing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Review details
Suppressed comments (2)
go.mod:258
- The OpenTelemetry Collector submodules are now pinned to a mix of v0.153.x and v0.155.x (e.g., xconsumer/pprofile at v0.155.0 while otlpexporter/otlpreceiver remain v0.153.0). Since the new Profiles plumbing relies on xreceiver.Factory/xexporter.Factory, this version skew can lead to build or runtime type-assertion incompatibilities; consider aligning collector module versions to a single release line.
go.opentelemetry.io/collector/consumer/xconsumer v0.155.0
go.opentelemetry.io/collector/exporter v1.59.0
go.opentelemetry.io/collector/exporter/debugexporter v0.153.0
go.opentelemetry.io/collector/exporter/exporterhelper v0.153.0
go.opentelemetry.io/collector/exporter/otlpexporter v0.153.0
internal/component/otelcol/receiver/otlp/otlp_test.go:168
- Waiting on profilesErrCh has no timeout; if either sendProfiles goroutine never succeeds (e.g., receiver doesn’t accept profiles), the test can deadlock indefinitely at this receive.
for range 2 {
require.NoError(t, <-profilesErrCh)
}
- Files reviewed: 22/22 changed files
- Comments generated: 0 new
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
cbd4c30 to
864e065
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.
Suppressed comments (1)
internal/component/otelcol/internal/fanoutconsumer/profiles.go:70
ConsumeProfilescallspd.MarkReadOnly()when forwarding to multiple read-only consumers.MarkReadOnlymutates the inputpprofile.Profiles, which can violate the contract implied byCapabilities()(and can surprise upstream callers that reusepd). Consider cloning once and marking the clone read-only before fan-out so the original input is never mutated in the read-only path.
if len(f.readonly) > 1 && !pd.IsReadOnly() {
pd.MarkReadOnly()
}
for _, consumer := range f.readonly {
errs = multierr.Append(errs, consumer.ConsumeProfiles(ctx, pd))
|
@kgeckhart @ptodev Requesting review |
|
Thank you for the contribution @niharikag09! Interested in this so i'll assign myself for now though others also feel free to review. @niharikag09 One thing that would be great to have here are some integration tests, so that we can see how the new signal behaves e2e |
|
Doc changes are OK as-is. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 04c39d77-a9f9-49a9-8817-7962625e15c8
|
@blewis12 I have added integration tests, can you approve the workflows so that they can run |
Brief description of Pull Request
Adds experimental OTLP Profiles routing to the shared OpenTelemetry receiver and exporter plumbing. This includes lazy and fan-out Profiles consumers, OTLP gRPC and HTTP receiver coverage, OTLP exporter coverage, and component documentation for Profiles inputs, outputs, and the experimental HTTP endpoint.
Pull Request Details
Issue(s) fixed by this Pull Request
Fixes #6469
Notes to the Reviewer
PR Checklist