Repository navigation
Read Datadog monitors stored as objects - #125
Merged
Merged
Conversation
The API stores a Datadog monitor as a bare ID or as an object with an ID and an optional alias. The provider read only the bare form, and an unchecked type assertion crashed the provider during plan, apply, and refresh for any entity with object-form monitors. The parser now reads both forms. A monitor with an alias, or without a numeric ID, returns an error instead of a panic. The schema has no alias attribute, so reading the ID alone would drop the alias on the next apply. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ryanduffin
added this pull request to stack #128
October 6, 2026 15:30
ryanduffin
marked this pull request as ready for review
October 6, 2026 18:33
The alias check read only string aliases, but the API also accepts a number or a boolean as an alias. Any non-empty alias is now an error, and the message says how to fix it. Monitor IDs are now parsed as integers, not through float64, so infinity, values out of the int64 range, and IDs above 2^53 no longer read as wrong IDs. A string ID is parsed as a base-10 integer. A Datadog APM value that is not an object, or monitors that are not a list, is now an error instead of a panic. GetFromDescriptor adds the entity tag to parse errors, so the user can see which entity failed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The API drops a bare string monitor and converts a string ID only inside an object, so a bare string is now an error instead of an ID that Cortex never registers. The API also treats an empty alias as an alias name, so every non-null alias is now an error. The alias error now reports the parsed ID, and the error for a non-integer ID names the decoded type. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gvillenave
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cortex_catalog_entityno longer crashes when an entity's Datadog monitors are stored as objects.Claude Details