Skip to content

Fix/658 structured list properties#673

Merged
jaydeluca merged 7 commits into
open-telemetry:mainfrom
DCchoudhury15:fix/658-structured-list-properties
Jun 15, 2026
Merged

Fix/658 structured list properties#673
jaydeluca merged 7 commits into
open-telemetry:mainfrom
DCchoudhury15:fix/658-structured-list-properties

Conversation

@DCchoudhury15

Copy link
Copy Markdown
Contributor

What changed

Added support for structured list configurations in the declarative config builder.

Backend (explorer-db-builder)

  • Added schema metadata for java.common.service_peer_mapping
  • Added schema metadata for declarative configs ending with url_template_rules
  • Updated schema mapping to recognize structured_list configs and expose the injected schema as the list item schema

Frontend (ecosystem-explorer)

  • Added support for declarative_type and declarative_schema
  • Added a dedicated StructuredListRenderer for rendering structured list entries
  • Updated customization handling to initialize structured lists correctly
  • Updated validation logic to accept array values for structured list configurations

Why

Fixes #658.

service_peer_mapping and url_template_rules are structured configurations, but were previously rendered as generic key/value maps. This made it unclear which fields were expected and resulted in an inconsistent editing experience.

This change allows these configurations to be rendered using their schema definition, producing a more intuitive UI and correct YAML output.

Screenshot

image

Testing

Manual

  • Opened java.common.service_peer_mapping in the config builder
  • Added a sample mapping entry
  • Verified the generated YAML matches the expected structure
instrumentation/development:
  java:
    common:
      service_peer_mapping:
        - peer: 1.1.1.1
          service_name: test-service

@DCchoudhury15 DCchoudhury15 requested review from a team as code owners June 9, 2026 02:33
Copilot AI review requested due to automatic review settings June 9, 2026 02:33
@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy Preview for otel-ecosystem-explorer ready!

Name Link
🔨 Latest commit 4587ac0
🔍 Latest deploy log https://app.netlify.com/projects/otel-ecosystem-explorer/deploys/6a2cd9c4deacfa0008e38480
😎 Deploy Preview https://deploy-preview-673--otel-ecosystem-explorer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for “structured list” declarative configuration schemas so certain Java agent config options can be edited as a list of structured objects in the UI.

Changes:

  • Extend the Configuration type to include declarative_type and declarative_schema.
  • Add a new StructuredListRenderer and route rendering/customization logic to it when declarative_type === "structured_list".
  • Update the inventory/schema mappers to treat structured_list as a list and provide per-item schema.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
ecosystem-explorer/src/types/javaagent.ts Adds typed fields for declarative_type and declarative_schema on configuration entries.
ecosystem-explorer/src/features/java-agent/configuration/components/instrumentation-config-field.tsx Implements structured-list UI rendering and tweaks type matching to accommodate list values.
ecosystem-automation/explorer-db-builder/src/explorer_db_builder/schema_ui_mapper.py Maps structured_list declarative nodes to list controls and uses declarative_schema for item schema.
ecosystem-automation/explorer-db-builder/src/explorer_db_builder/declarative_name_corrections.py Injects structured_list declarative schema for specific known configuration names.

return Array.isArray(value);
case "map":
return isPlainObject(value);
return isPlainObject(value) || Array.isArray(value);
Comment on lines +241 to +242
{items.map((item, idx) => (
<div key={idx} className="border-border/40 space-y-1.5 rounded-md border p-3">
Comment on lines +298 to +301
const blank: Record<string, unknown> = {};
for (const [key, prop] of properties) {
blank[key] = prop.type === "boolean" ? (prop.default ?? false) : "";
}
declarative_schema?: {
type: "object";
required?: string[];
properties: Record<string, { type: string; description?: string; default?: unknown }>;
@DCchoudhury15 DCchoudhury15 force-pushed the fix/658-structured-list-properties branch from 0db585b to 328d07c Compare June 9, 2026 02:44
@DCchoudhury15 DCchoudhury15 force-pushed the fix/658-structured-list-properties branch from 328d07c to b41f33c Compare June 9, 2026 02:47
@DCchoudhury15

Copy link
Copy Markdown
Contributor Author

@jaydeluca pr up for review

@jaydeluca jaydeluca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just a couple comments from myself and copilot to address but this looks good, nice work.

If you are interested, there are a few other places we could update to use this new declarative_type and schema as well, like the instrumentation detail page configuration tab (https://explorer.opentelemetry.io/java-agent/instrumentation/vertx-http-client-4.0) and the config explorer: https://explorer.opentelemetry.io/java-agent/configuration

I can create an issue to handle those in a followup if you'd rather just focus on the current scope of this PR, just figured i'd mention it

def _classify_node(node: dict[str, Any]) -> str:
"""Classify a schema node into a UI control type."""

if node.get("declarative_type") == "structured_list":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i could be missing something, but i dont think the changes in this file are needed. I removed it and re-ran the build and everything still works

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, my apologies , you're absolutely right.
I updated schema_ui_mapper.py because I assumed structured_list still needed to be mapped to a standard list control on the backend. I completely overlooked that StructuredListRenderer already handles the declarative type directly on the frontend, so the change wasn't needed at all.
Sorry for the unnecessary noise in the PR. I've reverted the file. Thanks for catching that!

@DCchoudhury15

Copy link
Copy Markdown
Contributor Author

just a couple comments from myself and copilot to address but this looks good, nice work.

If you are interested, there are a few other places we could update to use this new declarative_type and schema as well, like the instrumentation detail page configuration tab (https://explorer.opentelemetry.io/java-agent/instrumentation/vertx-http-client-4.0) and the config explorer: https://explorer.opentelemetry.io/java-agent/configuration

I can create an issue to handle those in a followup if you'd rather just focus on the current scope of this PR, just figured i'd mention it

Thanks @jaydeluca! I'm really glad the implementation looks good.

I would absolutely love to work on extending this feature to the instrumentation detail page and the config explorer! Please go ahead and create the follow-up issue you can tag or assign me directly to it, and I'll start to work on it as soon as this PR is merged.

I've pushed the fixes covering the unit tests and the edge cases Copilot flagged, so this should be ready for another look! Thanks for your time and patience.

<div className="w-full max-w-xl space-y-2" aria-label={ariaLabel}>
{items.map((item, idx) => {
const stableKey =
typeof (item as Record<string, unknown>)._id === "string"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this _id is leaking into the YAML output now

image

could we keep _id purely as a render key and not store it in the value? We could Track stable keys with a useRef/WeakMap keyed by item identity. If that ends up being too complex we can just accept index keys (the previous behavior) since these lists are short and append-only.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that! I added _id for stable keys based on a Copilot suggestion, but I didn't realize it would leak into the YAML output.
You're right that idx is sufficient here. I've reverted the change, removed _id, and verified locally that the YAML output is clean now.
Thanks for catching it!

Comment thread ecosystem-explorer/src/types/javaagent.ts Outdated

@jaydeluca jaydeluca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice, thanks!

@jaydeluca jaydeluca added this pull request to the merge queue Jun 15, 2026
Merged via the queue into open-telemetry:main with commit 0219efe Jun 15, 2026
23 checks passed
@otelbot

otelbot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @DCchoudhury15! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

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.

[Config Builder] Support structured list properties

3 participants