Skip to content

feat: adds plugin span filtering for multiple connectors - #4199

Merged
Pratham-Mishra04 merged 1 commit into
devfrom
06-09-feat_adds_plugin_span_filtering_for_multiple_connectors
Jun 9, 2026
Merged

feat: adds plugin span filtering for multiple connectors#4199
Pratham-Mishra04 merged 1 commit into
devfrom
06-09-feat_adds_plugin_span_filtering_for_multiple_connectors

Conversation

@roroghost17

@roroghost17 roroghost17 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

PluginSpanFilter and its associated logic (ShouldExportSpan, BuildReparentMap, PluginNameFromSpan) were previously defined and implemented inside the OTEL plugin package. This PR promotes them to core/schemas so they can be shared across all observability connectors (OTEL, Datadog, BigQuery) without duplicating the span-name contract or reparenting behavior. The OTEL package re-exports the types and constants as aliases to preserve existing import paths. The PluginTracingSheet UI component is also generalized to accept a pluginName and destination prop, and is relocated from the plugins page to the OTEL observability view where it belongs.

Changes

  • Introduced core/schemas/span_filter.go with PluginSpanFilter, PluginSpanFilterMode, PluginNameFromSpan, ShouldExportSpan, and BuildReparentMap, along with full unit test coverage in span_filter_test.go.
  • Removed the duplicate shouldExportSpan and buildReparentMap methods from plugins/otel/converter.go; call sites now delegate to the shared schema methods.
  • PluginSpanFilter, PluginSpanFilterMode, and the include/exclude constants in plugins/otel/main.go are replaced with type aliases and const aliases pointing to core/schemas, keeping the OTEL package's public API unchanged.
  • Validation in otel.Init is replaced with a call to config.PluginSpanFilter.Validate().
  • PluginTracingSheet is moved from ui/app/workspace/plugins/sheets/ to ui/app/workspace/observability/sheets/ and now accepts pluginName and destination props, making it connector-agnostic.
  • The "Configure Plugin Tracing" button and PluginTracingSheet are removed from the plugins page and plugins empty state, and are instead surfaced directly in OtelView.
  • Added a warning notice to the ent-v1.4.7 changelog about a known /virtual-key/quota issue fixed in v1.4.8.
  • Improved the v1.5.11 changelog rollback section with a warning callout and collapsible AccordionGroup sections for single-node and multi-node rollback SQL.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

# Core/Transports
go test ./core/schemas/... ./plugins/otel/...

# UI
cd ui
pnpm i
pnpm build
  • Open the Observability → OTEL view and confirm the "Configure Plugin Tracing" button appears and opens the sheet correctly.
  • Verify the sheet reads and writes plugin_span_filter only for the otel plugin.
  • Confirm the Plugins page no longer shows a "Configure Plugin Tracing" button or sheet.
  • Confirm the plugins empty state no longer renders the tracing button.

Screenshots/Recordings

N/A — functional behavior is unchanged; only the location of the tracing button has moved.

Breaking changes

  • Yes
  • No

The OTEL package re-exports all renamed types and constants as aliases, so existing config parsing and external consumers are unaffected.

Related issues

N/A

Security considerations

No new auth, secrets, PII handling, or sandboxing changes introduced.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

Summary by CodeRabbit

Release Notes

  • New Features

    • Added configurable span filtering for plugin observability exports with include/exclude modes to control which plugins' spans are exported to observability connectors.
    • Extended plugin tracing configuration to support any backend plugin destination, not limited to a single connector.
  • Refactor

    • Consolidated span filtering logic for improved reusability and consistency across observability integrations.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Extracts plugin-span filtering and reparenting into core/schemas, updates OTEL plugin to use the shared filter and aliases its types/constants, and generalizes the tracing sheet UI to edit per-plugin span filters while moving tracing controls into the OTEL view.

Changes

Span Filter Core & Plugin Tracing UI Generalization

Layer / File(s) Summary
Span filter core logic and validation
core/schemas/span_filter.go
Introduces PluginSpanFilterMode ("include"/"exclude"), PluginSpanFilter with Validate(), PluginNameFromSpan(), ShouldExportSpan(), and BuildReparentMap() for filtered plugin spans.
Span filter tests
core/schemas/span_filter_test.go
Unit tests for validation, plugin-name extraction, include/exclude export decisions, always-export for non-plugin spans, and reparenting filtered spans including chain resolution and cycle bounds.
OTEL plugin refactoring to use core span filter
plugins/otel/converter.go, plugins/otel/main.go
Removes local converter helpers, calls pluginSpanFilter.BuildReparentMap and ShouldExportSpan during conversion, and aliases OTEL plugin types/constants to core schemas while delegating validation to PluginSpanFilter.Validate().
OTEL converter end-to-end test update
plugins/otel/converter_test.go
Replaces prior helper unit tests with an end-to-end test asserting filtered plugin spans are omitted and parent IDs are rewritten to the nearest exported ancestor after conversion.
Generalize plugin tracing sheet to support any plugin
ui/app/workspace/observability/sheets/pluginTracingSheet.tsx
Sheet now accepts pluginName and destination, fetches target plugin config, loads/saves config.plugin_span_filter, and updates copy/toasts to reference the destination.
Add tracing controls to OTEL view
ui/app/workspace/observability/views/plugins/otelView.tsx
Adds state and a "Configure Plugin Tracing" button that opens PluginTracingSheet with pluginName="otel" and a destination label.
Remove tracing configuration from plugins page
ui/app/workspace/plugins/page.tsx, ui/app/workspace/plugins/views/pluginsEmptyState.tsx
Removes global tracing sidebar button, tracing props from PluginsEmptyState, and the tracing sheet from the main plugins page.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • maximhq/bifrost#3382: Refactors existing OTEL span filtering logic by moving shouldExportSpan/buildReparentMap and config types into core/schemas/span_filter.go, directly tied to the same filtering feature.

Suggested reviewers

  • danpiths
  • Pratham-Mishra04
  • akshaydeo

Poem

🐰 I hop through spans where plugin names hide,

I split the dots and find the middle pride.
Include or exclude, I mark who may roam,
Reparent the lost so each trace finds home.
— your rabbit reviewer, nibbling code and chrome

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: promoting plugin span filtering logic to a shared core package for use across multiple connectors.
Description check ✅ Passed The description is comprehensive and follows the template structure with all major sections completed: Summary, Changes, Type of change, Affected areas, How to test, Breaking changes, and Checklists.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 06-09-feat_adds_plugin_span_filtering_for_multiple_connectors

Comment @coderabbitai help to get the list of available commands and usage tips.

@CLAassistant

CLAassistant commented Jun 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

roroghost17 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@roroghost17
roroghost17 force-pushed the 06-09-feat_adds_plugin_span_filtering_for_multiple_connectors branch from cae0d6c to 4cfa28e Compare June 9, 2026 08:30
@roroghost17
roroghost17 marked this pull request as ready for review June 9, 2026 08:31
@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the change is a well-scoped refactor that moves stable logic into a shared package without altering behavior.

All call sites in plugins/otel delegate to nil-safe receivers with identical logic; the type aliases preserve JSON parsing and external import paths; the UI guard correctly blocks premature saves by gating on a state update that forces a re-render; no new cross-module dependencies are introduced because plugins/otel already depended on core/schemas.

No files require special attention. The pluginTracingSheet.tsx initialization guard is slightly non-obvious but correct.

Important Files Changed

Filename Overview
core/schemas/span_filter.go New shared span-filter types and logic promoted from plugins/otel; nil-safe receivers, well-documented cycle guard, and correct include/exclude semantics.
core/schemas/span_filter_test.go Comprehensive table-driven tests cover nil filter, include/exclude modes, malformed names, chain resolution, and cycle termination.
plugins/otel/converter.go Removed duplicate shouldExportSpan/buildReparentMap methods; call sites delegate to nil-safe schema methods with equivalent semantics.
plugins/otel/main.go PluginSpanFilter and PluginSpanFilterMode replaced with Go type aliases (=) pointing to core/schemas; constants re-exported by value; Validate() call replaces inline switch; backward-compatible API.
ui/app/workspace/observability/sheets/pluginTracingSheet.tsx Sheet generalized with pluginName/destination props; initialization guard uses wasOpenRef to prevent premature save; Save button disabled until toggles are loaded from persisted config.

Reviews (7): Last reviewed commit: "feat: adds plugin span filtering for mul..." | Re-trigger Greptile

Comment thread core/schemas/span_filter.go

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui/app/workspace/observability/sheets/pluginTracingSheet.tsx`:
- Line 178: Replace the grammatically awkward and inaccurate phrase that uses
"inside the {destination}" with a reference to the actual plugin key by using
pluginName; update the text so it reads something like: "If plugin_span_filter
is set in the {pluginName} plugin config in config.json, it takes precedence
over these settings after restarting Bifrost." Locate the string in
pluginTracingSheet.tsx (the line currently referencing destination) and swap
destination for pluginName and "inside the" for "in the" to avoid double
articles and to point users to the real config key.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 57f65d45-1d23-4d1a-9abb-4d8cf85efb17

📥 Commits

Reviewing files that changed from the base of the PR and between fed162e and 4cfa28e.

📒 Files selected for processing (9)
  • core/schemas/span_filter.go
  • core/schemas/span_filter_test.go
  • plugins/otel/converter.go
  • plugins/otel/converter_test.go
  • plugins/otel/main.go
  • ui/app/workspace/observability/sheets/pluginTracingSheet.tsx
  • ui/app/workspace/observability/views/plugins/otelView.tsx
  • ui/app/workspace/plugins/page.tsx
  • ui/app/workspace/plugins/views/pluginsEmptyState.tsx

Comment thread ui/app/workspace/observability/sheets/pluginTracingSheet.tsx Outdated
@roroghost17
roroghost17 force-pushed the 06-09-feat_adds_plugin_span_filtering_for_multiple_connectors branch from 4cfa28e to e6bc951 Compare June 9, 2026 09:04

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/schemas/span_filter_test.go`:
- Around line 30-49: TestPluginNameFromSpan is missing tests for two
malformed-name scenarios; add entries to the tests slice to cover a two-segment
malformed name and a wrong-prefix case so PluginNameFromSpan's parser contract
is locked. Specifically, in the tests array inside TestPluginNameFromSpan add a
case with span produced by pluginSpan(..., "plugin.logging") expecting "" and a
case with pluginSpan(..., "otel.logging.prehook") expecting "" (also keep
existing "plugin" and nil cases) to ensure PluginNameFromSpan and
ShouldExportSpan continue to treat these as non-plugin names.

In `@core/schemas/span_filter.go`:
- Around line 96-109: The second-pass loop over the filtered map (using maxHops,
spanID, parentID, grandParentID) can still produce cycles that resolve to
another filtered span; after the bounded walk, check if the final parentID is
still a key in filtered and if so set filtered[spanID] = "" (collapse to root)
instead of leaving it pointing to another filtered span; update the logic in the
loop that currently uses maxHops to perform this final membership test and
assignment so any remaining filtered parent becomes "".
- Around line 43-54: The PluginNameFromSpan function currently treats any
dot-containing SpanKindPlugin name as a plugin; update it so it only returns the
middle name when the span name strictly matches the contract
"plugin.<name>.prehook" or "plugin.<name>.posthook": in PluginNameFromSpan
verify parts := strings.SplitN(span.Name, ".", 3) yields exactly 3 parts,
parts[0] == "plugin", and parts[2] is either "prehook" or "posthook"; otherwise
return "".

In `@ui/app/workspace/observability/sheets/pluginTracingSheet.tsx`:
- Around line 72-80: The sheet initialization can run before plugin names load
and overwrite persisted include-mode filters; modify the useEffect
initialization block (the effect that checks open && !wasOpenRef.current and
calls resolveToggleState/setToggles) to bail out when the saved filter is
include-mode but allPlugins is empty — specifically, after computing filter =
targetPlugin.config?.plugin_span_filter, if filter?.mode === "include" &&
allPlugins.length === 0 return early so you don't call
setToggles(resolveToggleState(...)) and flip include filters; keep
wasOpenRef.current unchanged until real initialization runs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2afc113a-64cc-41d9-b479-e8d8ce45b42a

📥 Commits

Reviewing files that changed from the base of the PR and between 4cfa28e and e6bc951.

📒 Files selected for processing (9)
  • core/schemas/span_filter.go
  • core/schemas/span_filter_test.go
  • plugins/otel/converter.go
  • plugins/otel/converter_test.go
  • plugins/otel/main.go
  • ui/app/workspace/observability/sheets/pluginTracingSheet.tsx
  • ui/app/workspace/observability/views/plugins/otelView.tsx
  • ui/app/workspace/plugins/page.tsx
  • ui/app/workspace/plugins/views/pluginsEmptyState.tsx

Comment thread core/schemas/span_filter_test.go
Comment thread core/schemas/span_filter.go
Comment thread core/schemas/span_filter.go
Comment thread ui/app/workspace/observability/sheets/pluginTracingSheet.tsx
@roroghost17
roroghost17 force-pushed the 06-09-feat_adds_plugin_span_filtering_for_multiple_connectors branch from e6bc951 to 7a6c43b Compare June 9, 2026 09:24

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@plugins/otel/converter_test.go`:
- Line 93: The current tests in pluginSpanFilter.ShouldExportSpan duplicate
core/schemas/span_filter_test.go; instead replace or refactor them to test
convertTraceToResourceSpan's end-to-end behavior: construct a trace containing
spans that the plugin filter should drop and spans that should be kept, run
convertTraceToResourceSpan (or the higher-level function that calls it), and
assert the exported OTEL spans' SpanId and ParentSpanId rewrites and that
filtered plugin spans are not present; update assertions that currently call
pluginSpanFilter.ShouldExportSpan to validate the converted OTEL output (span
IDs, parent relationships, and absence of dropped plugin spans) so regressions
in convertTraceToResourceSpan are caught.

In `@ui/app/workspace/observability/sheets/pluginTracingSheet.tsx`:
- Around line 87-90: The save handler (handleSave) can run before tracing
toggles are initialized (e.g., include-mode deferral) causing buildFilter to
return null and clearing plugin_span_filter; update handleSave to guard against
uninitialized toggles by either (A) early-returning with a user-visible toast
when toggles are not ready (so Save cannot proceed while targetPlugin exists) or
(B) preserving the existing plugin_span_filter when buildFilter returns null
(skip updating plugin_span_filter instead of writing null). Refer to handleSave,
buildFilter, toggles, targetPlugin and plugin_span_filter when making the
change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4655c3a5-4960-4afa-be6e-6db9b78f51ad

📥 Commits

Reviewing files that changed from the base of the PR and between e6bc951 and 7a6c43b.

📒 Files selected for processing (9)
  • core/schemas/span_filter.go
  • core/schemas/span_filter_test.go
  • plugins/otel/converter.go
  • plugins/otel/converter_test.go
  • plugins/otel/main.go
  • ui/app/workspace/observability/sheets/pluginTracingSheet.tsx
  • ui/app/workspace/observability/views/plugins/otelView.tsx
  • ui/app/workspace/plugins/page.tsx
  • ui/app/workspace/plugins/views/pluginsEmptyState.tsx

Comment thread plugins/otel/converter_test.go Outdated
Comment thread ui/app/workspace/observability/sheets/pluginTracingSheet.tsx
@roroghost17
roroghost17 force-pushed the 06-09-feat_adds_plugin_span_filtering_for_multiple_connectors branch from 7a6c43b to 7e12811 Compare June 9, 2026 10:25

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

♻️ Duplicate comments (1)
core/schemas/span_filter.go (1)

57-58: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Reject empty or over-segmented plugin stages.

Line 57 still treats malformed names like plugin.logging. and plugin.logging.prehook.extra as valid plugin spans, because SplitN(..., 3) collapses extra . into the stage segment and Line 58 never checks that the stage is non-empty. That breaks the documented “malformed spans pass through” behavior by letting them be filtered/reparented.

Suggested fix
-	parts := strings.SplitN(span.Name, ".", 3)
-	if len(parts) != 3 || parts[0] != "plugin" || parts[1] == "" {
+	parts := strings.Split(span.Name, ".")
+	if len(parts) != 3 || parts[0] != "plugin" || parts[1] == "" || parts[2] == "" {
 		return ""
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/schemas/span_filter.go` around lines 57 - 58, The current check uses
strings.SplitN(span.Name, ".", 3) which allows malformed names like
"plugin.logging." or "plugin.logging.prehook.extra" to pass; change to use
strings.Split(span.Name, ".") (or otherwise ensure there are exactly 3 segments)
and add explicit emptiness checks for both the stage and the final segment:
require len(parts) == 3, parts[0] == "plugin", parts[1] != "" and parts[2] != ""
so names with an empty stage or extra dot-segments are treated as malformed and
pass through rather than being handled as valid plugin spans.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui/app/workspace/plugins/page.tsx`:
- Line 52: The docs still point users to the Plugins page for "Configure Plugin
Tracing" even though the Plugins page no longer exposes tracing controls (see
PluginsEmptyState usage and surrounding removal of tracing UI in page.tsx);
update docs/features/observability/otel.mdx to point the OTEL configuration flow
to the new OTEL view entrypoint instead of the Plugins page—replace any links,
button targets, and instructional text that reference the Plugins page with the
new OTEL view entrypoint name, adjust any navigation examples, and update
screenshots or step labels as needed so the doc flow correctly opens the OTEL
view for Configure Plugin Tracing.
- Line 52: Update tests and docs to reference the new tracing UI: replace legacy
Playwright/UI selectors like "plugins-tracing-button" with the new data-testids
"otel-configure-tracing-button" and the "plugin-tracing-*" controls, update any
E2E specs that previously targeted the Plugins page flow to instead interact
with the tracing button rendered by the otel view (component otelView /
data-testid="otel-configure-tracing-button"), and refresh docs
(docs/features/observability/otel.mdx) to instruct users to open the
Observability → Configure Plugin Tracing UI from the OTEL view rather than the
old Plugins page; ensure E2E tests assert the presence and behavior of the new
elements and that selectors in tests/e2e and ui references are fully replaced.

---

Duplicate comments:
In `@core/schemas/span_filter.go`:
- Around line 57-58: The current check uses strings.SplitN(span.Name, ".", 3)
which allows malformed names like "plugin.logging." or
"plugin.logging.prehook.extra" to pass; change to use strings.Split(span.Name,
".") (or otherwise ensure there are exactly 3 segments) and add explicit
emptiness checks for both the stage and the final segment: require len(parts) ==
3, parts[0] == "plugin", parts[1] != "" and parts[2] != "" so names with an
empty stage or extra dot-segments are treated as malformed and pass through
rather than being handled as valid plugin spans.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 40fbc50b-feb9-4994-8cc1-e9a31e9d72e8

📥 Commits

Reviewing files that changed from the base of the PR and between 7a6c43b and 7e12811.

📒 Files selected for processing (9)
  • core/schemas/span_filter.go
  • core/schemas/span_filter_test.go
  • plugins/otel/converter.go
  • plugins/otel/converter_test.go
  • plugins/otel/main.go
  • ui/app/workspace/observability/sheets/pluginTracingSheet.tsx
  • ui/app/workspace/observability/views/plugins/otelView.tsx
  • ui/app/workspace/plugins/page.tsx
  • ui/app/workspace/plugins/views/pluginsEmptyState.tsx

Comment thread ui/app/workspace/plugins/page.tsx
@roroghost17
roroghost17 force-pushed the 06-09-feat_adds_plugin_span_filtering_for_multiple_connectors branch from 7e12811 to 7473d46 Compare June 9, 2026 11:03
@coderabbitai
coderabbitai Bot requested review from akshaydeo and danpiths June 9, 2026 11:07
@roroghost17
roroghost17 force-pushed the 06-09-feat_adds_plugin_span_filtering_for_multiple_connectors branch from 7473d46 to a02e997 Compare June 9, 2026 11:25

Pratham-Mishra04 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Merge activity

  • Jun 9, 12:40 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 9, 12:41 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 9, 12:41 PM UTC: @Pratham-Mishra04 merged this pull request with Graphite.

@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-09-feat_adds_plugin_span_filtering_for_multiple_connectors branch from a02e997 to af382a8 Compare June 9, 2026 12:40
@Pratham-Mishra04
Pratham-Mishra04 merged commit 371e553 into dev Jun 9, 2026
15 checks passed
@Pratham-Mishra04
Pratham-Mishra04 deleted the 06-09-feat_adds_plugin_span_filtering_for_multiple_connectors branch June 9, 2026 12:41
akshaydeo pushed a commit that referenced this pull request Jun 12, 2026
## Summary

`PluginSpanFilter` and its associated logic (`ShouldExportSpan`, `BuildReparentMap`, `PluginNameFromSpan`) were previously defined and implemented inside the OTEL plugin package. This PR promotes them to `core/schemas` so they can be shared across all observability connectors (OTEL, Datadog, BigQuery) without duplicating the span-name contract or reparenting behavior. The OTEL package re-exports the types and constants as aliases to preserve existing import paths. The `PluginTracingSheet` UI component is also generalized to accept a `pluginName` and `destination` prop, and is relocated from the plugins page to the OTEL observability view where it belongs.

## Changes

- Introduced `core/schemas/span_filter.go` with `PluginSpanFilter`, `PluginSpanFilterMode`, `PluginNameFromSpan`, `ShouldExportSpan`, and `BuildReparentMap`, along with full unit test coverage in `span_filter_test.go`.
- Removed the duplicate `shouldExportSpan` and `buildReparentMap` methods from `plugins/otel/converter.go`; call sites now delegate to the shared schema methods.
- `PluginSpanFilter`, `PluginSpanFilterMode`, and the include/exclude constants in `plugins/otel/main.go` are replaced with type aliases and const aliases pointing to `core/schemas`, keeping the OTEL package's public API unchanged.
- Validation in `otel.Init` is replaced with a call to `config.PluginSpanFilter.Validate()`.
- `PluginTracingSheet` is moved from `ui/app/workspace/plugins/sheets/` to `ui/app/workspace/observability/sheets/` and now accepts `pluginName` and `destination` props, making it connector-agnostic.
- The "Configure Plugin Tracing" button and `PluginTracingSheet` are removed from the plugins page and plugins empty state, and are instead surfaced directly in `OtelView`.
- Added a warning notice to the `ent-v1.4.7` changelog about a known `/virtual-key/quota` issue fixed in v1.4.8.
- Improved the `v1.5.11` changelog rollback section with a warning callout and collapsible `AccordionGroup` sections for single-node and multi-node rollback SQL.

## Type of change

- [ ] Bug fix
- [ ] Feature
- [x] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [x] Plugins
- [x] UI (React)
- [x] Docs

## How to test

```sh
# Core/Transports
go test ./core/schemas/... ./plugins/otel/...

# UI
cd ui
pnpm i
pnpm build
```

- Open the Observability → OTEL view and confirm the "Configure Plugin Tracing" button appears and opens the sheet correctly.
- Verify the sheet reads and writes `plugin_span_filter` only for the `otel` plugin.
- Confirm the Plugins page no longer shows a "Configure Plugin Tracing" button or sheet.
- Confirm the plugins empty state no longer renders the tracing button.

## Screenshots/Recordings

N/A — functional behavior is unchanged; only the location of the tracing button has moved.

## Breaking changes

- [ ] Yes
- [x] No

The OTEL package re-exports all renamed types and constants as aliases, so existing config parsing and external consumers are unaffected.

## Related issues

N/A

## Security considerations

No new auth, secrets, PII handling, or sandboxing changes introduced.

## Checklist

- [x] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

## Release Notes

* **New Features**
  * Added configurable span filtering for plugin observability exports with include/exclude modes to control which plugins' spans are exported to observability connectors.
  * Extended plugin tracing configuration to support any backend plugin destination, not limited to a single connector.

* **Refactor**
  * Consolidated span filtering logic for improved reusability and consistency across observability integrations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants