refactor code for synthetic global variable resource#3378
Open
bernata wants to merge 1 commit intoDataDog:masterfrom
Open
refactor code for synthetic global variable resource#3378bernata wants to merge 1 commit intoDataDog:masterfrom
bernata wants to merge 1 commit intoDataDog:masterfrom
Conversation
…ies (DataDog#3356) [datadog_dashboard] Add semantic_mode support to metric queries Add support for the semantic_mode property in FormulaAndFunctionMetricQueryDefinition. This determines how metrics from different sources (OTel semantic conventions) are combined or displayed. Valid values are 'combined' and 'native'. - Add semantic_mode schema attribute with enum validation - Update buildDatadogMetricQuery to handle semantic_mode - Update buildTerraformQuery to read semantic_mode from API response - Add acceptance tests for both semantic_mode values Generate docs for semantic_mode property remove dupe sentence Co-authored-by: bruce.tu <bruce.tu@datadoghq.com>
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.
The existing code used deep if-else nesting to set properties on syntheticsGlobalVariableModel. It wasn't clear from the
updateStatewhat properties ofstatevariable were being set. This pr attempt to simplifyupdateStateby making it clear which properties are set and under what conditions.Introduce helper functions
newGlobalVariableValueandnewGlobalVariableParseTestOptionsto examine the datadog http response and return values with flags [indicating found/not found in the response]. The behavior ofupdateStateis unchanged.