Skip to content

fix: Auto monitor setup alignments#159

Open
OzBenSimhonTraceloop wants to merge 6 commits intomainfrom
obs/TLP-1866-auto-monitor-setup-api
Open

fix: Auto monitor setup alignments#159
OzBenSimhonTraceloop wants to merge 6 commits intomainfrom
obs/TLP-1866-auto-monitor-setup-api

Conversation

@OzBenSimhonTraceloop
Copy link
Contributor

@OzBenSimhonTraceloop OzBenSimhonTraceloop commented Mar 5, 2026

Summary by CodeRabbit

  • Documentation
    • Selector parameter now accepts an array of rule objects (per-rule key/value/source/operator) instead of a single object.
    • Request example updated to show multiple selector rules.
    • Responses now include init_rules mirroring the input selector shape.
    • Added top-level response fields: status and updated_at.
    • Evaluator objects in responses updated to include schema/status and remove prior identifier fields.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

The create-auto-monitor-setup API doc was updated: the selector request field is now an array of rule objects instead of a single object; responses include new top-level status and updated_at fields and an init_rules array; evaluator objects no longer include evaluator_id/binding_id and have input_schema, output_schema, and status.

Changes

Cohort / File(s) Summary
API Documentation
api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx
selector param type changed from objectobject[]; request example updated to array of rule objects (key, value, values, source, operator). Response (201) now includes top-level status and updated_at, adds init_rules (mirrors input selector), adds org_id, project_id, env_project_id, and moves evaluator fields to include input_schema, output_schema, and status while removing evaluator_id and binding_id. Examples and textual descriptions updated accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hop through docs with ears held high,
Rules once single now line up in a sigh,
Init_rules mirror the selector's new tune,
Status and timestamps beneath the moon,
A tiny rabbit cheers this API boon.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: Auto monitor setup alignments' is vague and does not clearly summarize the specific changes made in the pull request. Provide a more specific title that describes the actual changes, such as 'fix: Update auto monitor setup selector format and response schema' to clearly communicate the main modifications to the API documentation.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch obs/TLP-1866-auto-monitor-setup-api

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx (1)

35-41: Clarify value and values exclusivity.

Line 38-Line 41 describe conditional requirements, but they don’t explicitly state whether both fields can be sent together. Adding an “exactly one of value/values” rule would prevent ambiguous payloads.

✍️ Suggested doc tweak
   | `operator` | string | No | Comparison operator. Defaults to `equals`. One of: `equals`, `not_equals`, `contains`, `not_contains`, `exists`, `not_exists`, `in`, `not_in` |
+
+  **Rule:** Provide exactly one of `value` or `values`, based on the selected `operator`.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx` around
lines 35 - 41, The doc currently allows ambiguous payloads by not stating
exclusivity between `value` and `values`; update the table and surrounding text
to require exactly one of `value` or `values` be provided (mutually exclusive),
clarifying that `value` is required for operators `equals`, `not_equals`,
`contains`, `not_contains`, `exists`/`not_exists` (where applicable) and
`values` is required for `in`/`not_in`; reference the `value`, `values`,
`operator`, and `source` fields and add a short note like “Exactly one of
`value` or `values` must be supplied” so clients cannot send both.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx`:
- Line 66: The doc text incorrectly claims init_rules is “same shape as the
input selector”; instead state that init_rules reflects the stored selector with
any defaulted fields (e.g., operator) expanded — i.e., the response may include
explicit operator defaults that callers can omit in the request. Update the
single sentence referencing init_rules/selector to note that server-side
defaults (such as operator) are populated in the response so integrators know
the returned shape can include those defaulted fields.

---

Nitpick comments:
In `@api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx`:
- Around line 35-41: The doc currently allows ambiguous payloads by not stating
exclusivity between `value` and `values`; update the table and surrounding text
to require exactly one of `value` or `values` be provided (mutually exclusive),
clarifying that `value` is required for operators `equals`, `not_equals`,
`contains`, `not_contains`, `exists`/`not_exists` (where applicable) and
`values` is required for `in`/`not_in`; reference the `value`, `values`,
`operator`, and `source` fields and add a short note like “Exactly one of
`value` or `values` must be supplied” so clients cannot send both.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5f3a3c6e-9f85-4506-b62e-a9d45da6a3c0

📥 Commits

Reviewing files that changed from the base of the PR and between e991911 and c592c52.

📒 Files selected for processing (1)
  • api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx

### 201 Created

Returns the created auto monitor setup object.
Returns the created auto monitor setup object. The `init_rules` array reflects the stored selector — same shape as the input `selector`.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix init_rules “same shape” wording mismatch.

Line 66 says init_rules has the same shape as input selector, but the response example includes explicit operator defaults that input can omit. This can confuse integrators.

🛠️ Suggested wording update
-Returns the created auto monitor setup object. The `init_rules` array reflects the stored selector — same shape as the input `selector`.
+Returns the created auto monitor setup object. The `init_rules` array reflects the stored selector and may include defaulted fields (for example, `operator: "equals"`).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx` at line
66, The doc text incorrectly claims init_rules is “same shape as the input
selector”; instead state that init_rules reflects the stored selector with any
defaulted fields (e.g., operator) expanded — i.e., the response may include
explicit operator defaults that callers can omit in the request. Update the
single sentence referencing init_rules/selector to note that server-side
defaults (such as operator) are populated in the response so integrators know
the returned shape can include those defaulted fields.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx (1)

30-31: Clarify behavior when selector is omitted or empty.

The selector field lacks the required attribute, implying it's optional. Consider adding a sentence explaining what happens if the selector is not provided or is an empty array (e.g., "If omitted, all spans will be evaluated" or "At least one rule is required").

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx` around
lines 30 - 31, The ParamField documentation for "selector" is unclear about
optional/empty behavior; update the "selector" description (ParamField
body="selector") to explicitly state what happens if the selector is omitted or
provided as an empty array—e.g., add a sentence like "If omitted or empty, all
spans will be evaluated" or, if the implementation requires at least one rule,
state "At least one rule is required; an empty or omitted selector will result
in [validation/error/none]"—so readers know whether the field is optional and
the system's runtime behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx`:
- Around line 30-31: The ParamField documentation for "selector" is unclear
about optional/empty behavior; update the "selector" description (ParamField
body="selector") to explicitly state what happens if the selector is omitted or
provided as an empty array—e.g., add a sentence like "If omitted or empty, all
spans will be evaluated" or, if the implementation requires at least one rule,
state "At least one rule is required; an empty or omitted selector will result
in [validation/error/none]"—so readers know whether the field is optional and
the system's runtime behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8598e731-1855-406f-b869-5b9f14b3eec7

📥 Commits

Reviewing files that changed from the base of the PR and between c592c52 and 848d9ea.

📒 Files selected for processing (1)
  • api-reference/auto-monitor-setups/create-an-auto-monitor-setup.mdx

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.

1 participant