是否可以使用AWS IoT Timestream规则操作创建多度量记录?

0

【以下的问题经过翻译处理】 你好,使用IoT Greengrass Timestream规则操作是否可以创建包含多个测量值的单个数据库记录?我想要在单个行中显示来自设备的3个测量值。尽管我的查询语句中选择了3个测量值,但它们都被插入到表的不同行中。我的Timestream规则在CF模板中的配置如下: TimestreamRule: Type: AWS::IoT::TopicRule Properties: TopicRulePayload: RuleDisabled: false Sql: !Join [ '', [ "SELECT cpu_utilization, memory_utilization, disc_utilization FROM 'device/+/telemetry'", ], ] Actions: - Timestream: DatabaseName: !Ref TelemetryTimestreamDatabase TableName: !GetAtt DeviceTelemetryTimestreamTable.Name Dimensions: - Name: device Value: ${deviceId} RoleArn: !GetAtt SomeRole.Arn Timestamp: Unit: SECONDS Value: ${time}我的消息有效负载:{ "cpu_utilization": 8, "memory_utilization": 67.4, "disc_utilization": 1.1, "deviceId": "asdasdasd123123123", "time": "1639141461"}在Timestream中的结果记录:| device | measure_name | time | measure_value::bigint | measure_value::double|| --- || 61705b3f6ac7696431ac6b12 | disc_utilization | 2021-12-10 13:03:47.000000000 | - | 1.1 || 61705b3f6ac7696431ac6b12 | memory_utilization | 2021-12-10 13:03:47.000000000 | - | 67.1 || 61705b3f6ac7696431ac6b12 | cpu_utilization | 2021-12-10 13:03:47.000000000 | - | 12.1 |

这不是我想要的,I want to have a single record including all three measurements, cpu, disc and memory. I know it is possible to do it somehow because provided sample db has multi measurement records, such as:

| hostname | az | region | measure_name | time | memory_utilization | cpu_utilization | | --- | | host-n2Rxl |eu-north-1a | eu-north-1 | DevOpsMulti-stats | 2021-12-10 13:03:47.000000000 | 40.324917071566546 | 91.85944083569557 | | host-sEUc8 |us-west-2a | us-west-2 | DevOpsMulti-stats | 2021-12-10 13:03:47.000000000 | 59.224512780289224 | 18.09011541205904 |

请问如何解决?

profile picture
EXPERTE
gefragt vor 2 Jahren61 Aufrufe
1 Antwort
0

【以下的回答经过翻译处理】 Amazon Timestream于2021年11月29日发布了多度量记录功能(https://aws.amazon.com/about-aws/whats-new/2021/11/amazon-timestream-scheduled-queries-multi-measure-records-magnetic-storage-writes/),而AWS IoT Timestream操作尚不支持多度量记录。作为解决方法,您可以使用AWS IoT Lambda Action触发Lambda函数,并使用AmazonTimestream Write API插入您的多度量记录:https://docs.aws.amazon.com/timestream/latest/developerguide/API_WriteRecords.html

profile picture
EXPERTE
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen