Skip to content

feat(otelcol): Add OTLP Profiles support - #6831

Open
niharikag09 wants to merge 6 commits into
grafana:mainfrom
niharikag09:feat/6469-otlp-profiles
Open

feat(otelcol): Add OTLP Profiles support#6831
niharikag09 wants to merge 6 commits into
grafana:mainfrom
niharikag09:feat/6469-otlp-profiles

Conversation

@niharikag09

Copy link
Copy Markdown

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

  • Documentation added
  • Tests updated
  • Config converters updated
  • This pull request was substantially generated with AI assistance (see the GenAI policy)

@niharikag09
niharikag09 requested review from a team and clayton-cornell as code owners August 5, 2026 23:59
Copilot AI lite review requested due to automatic review settings August 5, 2026 23:59
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Signed commits report

All 6 commits between main and feat/6469-otlp-profiles have verified signatures. ✅

@cla-assistant

cla-assistant Bot commented Aug 5, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 / ConsumerArguments and internal consumers (lazy + fanout) to support Profiles.
  • Teach the shared otelcol receiver/exporter wrappers to instantiate Profiles receivers/exporters via xreceiver/xexporter.
  • Add/extend integration tests and documentation for Profiles in OTLP receiver/exporter and output blocks.
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.

Comment thread internal/component/otelcol/receiver/otlp/otlp_test.go
Copilot AI review requested due to automatic review settings August 6, 2026 15:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Copilot AI review requested due to automatic review settings August 7, 2026 04:43
@niharikag09
niharikag09 force-pushed the feat/6469-otlp-profiles branch from cbd4c30 to 864e065 Compare August 7, 2026 04:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • ConsumeProfiles calls pd.MarkReadOnly() when forwarding to multiple read-only consumers. MarkReadOnly mutates the input pprofile.Profiles, which can violate the contract implied by Capabilities() (and can surprise upstream callers that reuse pd). 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))

@niharikag09

Copy link
Copy Markdown
Author

@kgeckhart @ptodev Requesting review

@blewis12

Copy link
Copy Markdown
Member

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

@blewis12 blewis12 self-assigned this Aug 10, 2026
@clayton-cornell

Copy link
Copy Markdown
Contributor

Doc changes are OK as-is.

@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Aug 10, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 04c39d77-a9f9-49a9-8817-7962625e15c8
@niharikag09

Copy link
Copy Markdown
Author

@blewis12 I have added integration tests, can you approve the workflows so that they can run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/docs Docs Squad label across all Grafana Labs repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: End-to-end OTLP Profiles support (Internal bridge for pyroscope.* and Profiles support in otelcol.exporter.otlp)

4 participants