Skip to content

[receiver/oracledbreceiver] Updated attributes to execution plan#48969

Open
sjyothi54 wants to merge 10 commits into
open-telemetry:mainfrom
newrelic-forks:oracle-execution-plan
Open

[receiver/oracledbreceiver] Updated attributes to execution plan#48969
sjyothi54 wants to merge 10 commits into
open-telemetry:mainfrom
newrelic-forks:oracle-execution-plan

Conversation

@sjyothi54

Copy link
Copy Markdown
Contributor

Description

Extends the Oracle DB receiver's execution plan SQL template (receiver/oracledbreceiver/templates/oracleQueryPlanSql.tmpl) to capture five additional columns from V$SQL_PLAN: OBJECT_NAME, OBJECT_TYPE, FILTER_PREDICATES, PARTITION_START, and PARTITION_STOP. These attributes enrich the collected execution plan with object identity, filter, and partition-access context for deeper query analysis and tuning.

Link to tracking issue

Fixes
#48965

Testing

Updated existing test fixtures in receiver/oracledbreceiver/testdata/ to cover the new SELECT columns:

  • oracleQueryPlanData.txt: added OBJECT_NAME, OBJECT_TYPE, FILTER_PREDICATES, PARTITION_START, PARTITION_STOP to the plan input row
  • expectedQueryTextAndPlanQuery.yaml: updated the expected oracledb.query_plan JSON to include the same five keys

Documentation

No documentation changes. New columns are surfaced as additional keys inside the existing oracledb.query_plan attribute JSON; no new attributes, metrics, or config options are introduced.

Authorship

  • I, a human, wrote this pull request description myself.

component: receiver/oracledb

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add `object_name`, `object_type`, `filter_predicates`, `partition_start`, and `partition_stop` attributes to Oracle query execution plan events

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.

are you missing the mapping of those additional columns to metric attributes?

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.

HI @atoulme So whatever columns we gonna add to the SELECT query in oracleQueryPlanSql.tmpl automatically appear as JSON keys in oracledb.query_plan. No per-column mapping is needed — there's no metadata.yaml change, no codegen, no scraper wiring.

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.

Does order matter here in the query? If not, I'd prefer to alphabetize the attributes to make it easier to find values and maintain going forward.

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.

@crobert-1 Updated the attributes in query in alphabetical order

Comment thread .chloggen/oracledbreceiver-execution-plan-attributes.yaml Outdated
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
Extend the `V$SQL_PLAN` query in the Oracle DB receiver execution-plan template with five additional columns:

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.

Nit: We should stick to user facing information here, I don't think V$SQL_PLAN is relevant to them. We also don't need to include the component name as it's obvious from component. Also, please format attributes with backticks to make md formatting more clear.

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.

Updated subtext and formatted as well

Comment thread .chloggen/oracledbreceiver-execution-plan-attributes.yaml Outdated
# Use pipe (|) for multiline entries.
subtext: |
Extend the execution plan with five additional attributes:
- `object_name`: Name of the object referenced by the plan step

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.

Does case matter here? (I just notice these references are different than what's being used programmatically.)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants