Skip to content

fix(dynatrace): send the only unmute reason the API accepts and request the detail fields the tools map - #6463

Merged
waleedlatif1 merged 2 commits into
stagingfrom
worktree-dynatrace-unmute-check
Aug 9, 2026
Merged

fix(dynatrace): send the only unmute reason the API accepts and request the detail fields the tools map#6463
waleedlatif1 merged 2 commits into
stagingfrom
worktree-dynatrace-unmute-check

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Unmute forwarded the shared muteReason dropdown's FALSE_POSITIVE default, but Dynatrace accepts exactly one unmute reason — AFFECTED. The tool-level params.reason || 'AFFECTED' fallback never fired because a truthy invalid reason was already supplied, so unmute failed from the block (single and bulk) unless the reason was changed by hand. The block now sends AFFECTED itself and the dropdown is scoped to the mute operations.
  • The vulnerability, problem, and attack detail endpoints omit every optional property unless it is named in fields. Descriptions, remediation guidance, affected entities, vulnerable components, root-cause evidence, impact analysis, and attacker details were mapped but always null. Each detail tool now requests its full documented set by default; an explicit fields still wins.
  • pageSize / nextPageKey / sort (plus the SLO and metric filters) were user-only across the 11 list tools, so an agent could not paginate or sort. Moved to user-or-llm, matching the rest of the repo.
  • monitorEnabled was declared boolean in block inputs while the dropdown emits ''|'true'|'false' and the mapping compared === 'true' — a real boolean wired from an upstream block read as "disabled only". Reads through a tri-state helper now.
  • Settings object create/update answer 207 with a per-object 4xx, so a rejected write reported success with a null objectId. It now raises with the validation message.
  • Dropped nextPageKey from Query Metrics — the API documents it as deprecated and always null.

Found while auditing the integration against the Dynatrace API reference. Every endpoint, parameter, default, page-size limit, and response key in the integration is now doc-verified.

Type of Change

  • Bug fix

Testing

bun run type-check, bun run lint, bun run tool-metadata:check, bun run integration-catalog:check, and bun run check:api-validation all pass. 49/49 tests in tools/dynatrace/dynatrace.test.ts; the 7 new assertions were each verified to fail without their fix. Not exercised against a live Dynatrace tenant.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…st the detail fields the tools map

Unmute forwarded the shared muteReason dropdown's FALSE_POSITIVE default, but
Dynatrace accepts exactly one unmute reason, AFFECTED. The tool-level fallback
never fired because a truthy invalid reason was already supplied, so unmute
failed from the block unless the reason was changed by hand.

The vulnerability, problem, and attack detail endpoints omit every optional
property unless it is named in `fields`, so the descriptions, remediation
guidance, affected entities, root-cause evidence, and attacker details those
tools map were always null.
@vercel

vercel Bot commented Aug 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 9, 2026 12:16am

Request Review

@cursor

cursor Bot commented Aug 9, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes how Dynatrace API calls are built (unmute, filters, settings validation) and what agents can pass; incorrect behavior before could cause failed unmute or silent settings-write success, but scope is the Dynatrace integration only.

Overview
Fixes several Dynatrace integration bugs where the block and tools sent wrong parameters or treated partial API successes as full success.

Unmute now always sends reason: AFFECTED (the only value Dynatrace accepts). The shared mute-reason dropdown no longer appears on unmute operations and no longer lists AFFECTED, so the default FALSE_POSITIVE cannot break unmute from the block.

Get Problem, Get Security Problem, and Get Attack request their full optional fields sets when unset, so mapped fields (evidence, remediation, attacker details, etc.) are not always null.

List synthetic monitors uses a tri-state enabled filter (toOptionalBoolean) so “any” omits the parameter and wired booleans are not misread as “disabled only.” Settings create/update throw when Dynatrace returns 207 with a per-object 4xx. Query Metrics drops deprecated nextPageKey from outputs. Pagination, sort, and related filters on many list/audit/SLO tools move from user-only to user-or-llm so agents can paginate and sort.

Reviewed by Cursor Bugbot for commit a0e1f7e. Configure here.

…-unmute-check

# Conflicts:
#	apps/sim/tools/generated/tool-metadata.ts
@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR corrects Dynatrace request shaping and response handling while exposing pagination, sorting, and filtering parameters to agent-driven tool calls.

  • Sends Dynatrace’s required AFFECTED reason for single and bulk unmute operations.
  • Requests mapped optional fields by default from problem, vulnerability, and attack detail endpoints.
  • Detects per-object settings write failures returned under HTTP 207.
  • Supports both dropdown strings and upstream booleans for synthetic monitor filtering.
  • Makes list pagination and filtering parameters available to users and the LLM, and removes the deprecated Query Metrics cursor output.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issues identified.

The changed request mappings, input handling, response validation, generated metadata, documentation, and regression tests remain internally consistent, and investigated compatibility concerns were either contradicted by the execution path or lacked a reachable failure condition.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/dynatrace.ts Separates mute and unmute request mapping, adds robust tri-state boolean conversion, and aligns monitor input metadata with dropdown values.
apps/sim/tools/dynatrace/create_settings_object.ts Converts per-object rejection statuses in HTTP 207 create responses into tool failures.
apps/sim/tools/dynatrace/update_settings_object.ts Checks the response body’s per-object status before reporting an update as successful.
apps/sim/tools/dynatrace/get_security_problem.ts Requests the complete mapped vulnerability detail field set by default while preserving explicit field selections.
apps/sim/tools/dynatrace/get_attack.ts Requests all mapped attack detail properties by default while preserving explicit field selections.
apps/sim/tools/dynatrace/get_problem.ts Requests optional problem evidence, impact analysis, and comments by default.
apps/sim/tools/dynatrace/query_metrics.ts Removes the deprecated, always-null pagination cursor from the Query Metrics output contract.
apps/sim/tools/dynatrace/dynatrace.test.ts Adds regression coverage for unmute reasons, detail-field defaults, boolean monitor filters, and per-object settings failures.
apps/sim/tools/generated/tool-metadata.ts Regenerates tool metadata to reflect expanded parameter visibility and updated Dynatrace contracts.
apps/sim/tools/generated/tool-outputs.ts Regenerates output metadata after removing Query Metrics’ deprecated cursor.

Reviews (1): Last reviewed commit: "fix(dynatrace): send the only unmute rea..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit e6485f5 into staging Aug 9, 2026
20 of 21 checks passed
@waleedlatif1
waleedlatif1 deleted the worktree-dynatrace-unmute-check branch August 9, 2026 00:11
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