Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metricKey on metric_events required when it ought not be #49

Open
kyleian opened this issue Jul 11, 2023 · 0 comments
Open

metricKey on metric_events required when it ought not be #49

kyleian opened this issue Jul 11, 2023 · 0 comments

Comments

@kyleian
Copy link

kyleian commented Jul 11, 2023

I'm creating a template for metric event definitions for my organization's applications using pulumi typescript.

I've found a discrepancy on defining a metric event for the type METRIC_SELECTOR, where the value metricKey on the MetricEventsQueryDefinition type is required, even when it should not be (eg, type would be METRIC_KEY rather than METRIC_SELECTOR when it ought be required).

It's unclear to me if I'm misconfiguring the below, however I believe there should be a change to set metricKey as optional on this resource. I see on the corresponding terraform object that this specific key is labeled optional: https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/resources/metric_events#metric_key

        const metricQueryDefinition: MetricEventsQueryDefinition = {
            metricKey: metricEventData.queryDefinition.metricKey,
            type: metricEventData.queryDefinition.type,
            metricSelector: metricEventData.queryDefinition.metricSelector.replace(/REPLACE_ME_HOST_ID/g, host),
            queryOffset: metricEventData.queryDefinition.queryOffset,
        }

Error when the metricKey is set on a METRIC_SELECTOR type event:

  dynatrace:index:MetricEvents (ix-test-example-Mem Usage):
    error: 1 error occurred:
        * Given property 'metricKey' should not be set as it does not satisfy the following precondition: type = 'METRIC_KEY'

Error when the metricKey is not set, on a METRIC_KEY type event:

  dynatrace:index:MetricEvents (ix-test-example-REPLACE_ME_PROJECT_NAME Mem Usage):
    error: 1 error occurred:
        * Given property 'entityFilter' with value: 'null' does not comply with required NonNull of schema
    Given property 'metricSelector' should not be set as it does not satisfy the following precondition: type = 'METRIC_SELECTOR'
    Given property 'aggregation' with value: 'null' does not comply with required NonNull of schema```
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

No branches or pull requests

1 participant