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

Kinesis Datastream Alarms #282

Open
x3dfxjunkie opened this issue Dec 5, 2022 · 0 comments
Open

Kinesis Datastream Alarms #282

x3dfxjunkie opened this issue Dec 5, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@x3dfxjunkie
Copy link

x3dfxjunkie commented Dec 5, 2022

Version

v1.22.7

Steps and/or minimal code example to reproduce

Create a monitoring facade and scope to set defaults for Kinesis DataStreams

self.monitoring_facade.monitor_scope(
    scope=self,
    lambda_={
        "props": {
            "addLatencyP50Alarm": {
                "Warning": {"maxLatency": Duration.seconds(1)}
            },
            "addFaultCountAlarm": {
                "Warning": {"maxErrorCount": 1},
            },
        },
    },
    kinesis_data_stream={
        "props": {
            "addIteratorMaxAgeAlarm": {
                "Warning": {
                    "maxAgeInMillis": 60000,
                }
            },
        }
    },
)

Then add a kinesis stream to the app / stack.

Expected behavior

This should create an alarm for max iterator age of 60 seconds for the kinesis stream.

Actual behavior

jsii.errors.JavaScriptError:
  @jsii/kernel.RuntimeError: Error: Resolution error: Supplied properties not correct for "CfnAlarmProps"
    metrics: element 0: supplied properties not correct for "MetricDataQueryProperty"
      metricStat: supplied properties not correct for "MetricStatProperty"
        metric: supplied properties not correct for "MetricProperty"
          dimensions: element 0: supplied properties not correct for "DimensionProperty"
            value: required but missing.
      at Kernel._ensureSync (/private/var/folders/l2/m9wygxk944d1bb8fpr1q34zh0000gp/T/tmpdvb1_joa/lib/program.js:8427:27)
      at Kernel.invoke (/private/var/folders/l2/m9wygxk944d1bb8fpr1q34zh0000gp/T/tmpdvb1_joa/lib/program.js:7827:34)
      at KernelHost.processRequest (/private/var/folders/l2/m9wygxk944d1bb8fpr1q34zh0000gp/T/tmpdvb1_joa/lib/program.js:11037:36)
      at KernelHost.run (/private/var/folders/l2/m9wygxk944d1bb8fpr1q34zh0000gp/T/tmpdvb1_joa/lib/program.js:10997:22)
      at Immediate._onImmediate (/private/var/folders/l2/m9wygxk944d1bb8fpr1q34zh0000gp/T/tmpdvb1_joa/lib/program.js:10998:46)
      at processImmediate (internal/timers.js:464:21)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "PATH/app/APP.py", line 31, in <module>
    PipelineStack(app, 'Pipeline',
  File "PATH/app/.venv/lib/python3.10/site-packages/jsii/_runtime.py", line 111, in __call__
    inst = super().__call__(*args, **kwargs)
  File "PATH/app/infrastructure/pipeline/APP_pipeline.py", line 94, in __init__
    waves[region].add_stage(stages[region],
  File "PATH/app/.venv/lib/python3.10/site-packages/aws_cdk/pipelines/__init__.py", line 5493, in add_stage
    return typing.cast(StageDeployment, jsii.invoke(self, "addStage", [stage, options]))
  File "PATH/app/.venv/lib/python3.10/site-packages/jsii/_kernel/__init__.py", line 149, in wrapped
    return _recursize_dereference(kernel, fn(kernel, *args, **kwargs))
  File "PATH/app/.venv/lib/python3.10/site-packages/jsii/_kernel/__init__.py", line 409, in invoke
    return _callback_till_result(self, response, InvokeResponse)
  File "PATH/app/.venv/lib/python3.10/site-packages/jsii/_kernel/__init__.py", line 267, in _callback_till_result
    response = kernel.sync_complete(response.cbid, None, result, response_type)
  File "PATH/app/.venv/lib/python3.10/site-packages/jsii/_kernel/__init__.py", line 447, in sync_complete
    return self.provider.sync_complete(
  File "PATH/app/.venv/lib/python3.10/site-packages/jsii/_kernel/providers/process.py", line 401, in sync_complete
    resp = self._process.send(_CompleteRequest(complete=request), response_type)
  File "PATH/app/.venv/lib/python3.10/site-packages/jsii/_kernel/providers/process.py", line 340, in send
    raise RuntimeError(resp.error) from JavaScriptError(resp.stack)
RuntimeError: Error: Resolution error: Supplied properties not correct for "CfnAlarmProps"
  metrics: element 0: supplied properties not correct for "MetricDataQueryProperty"
    metricStat: supplied properties not correct for "MetricStatProperty"
      metric: supplied properties not correct for "MetricProperty"
        dimensions: element 0: supplied properties not correct for "DimensionProperty"
          value: required but missing.

Other details

Similar syntax works when attaching a kinesis stream by name.

self.monitoring_facade.monitor_kinesis_data_stream(
    stream_name=test_stream.stream_name,
    alarm_friendly_name=prefix,
    add_iterator_max_age_alarm={"Warning": {"maxAgeInMillis": 60000}}
)
@x3dfxjunkie x3dfxjunkie added the bug Something isn't working label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant