【发布时间】:2021-06-03 01:17:27
【问题描述】:
我正在 AWS 中开发一个 lambda 函数,该函数使用适用于 Javascript 的 AWS 开发工具包v3 将时间序列数据推送到 AWS TimeStream。代码很简单,但是没有运行:
// Push the batch to timestream
await client.send(new WriteRecordsCommand({
DatabaseName: config.datbase,
TableName: config.table,
Records: records
}));
records 是一个对象数组,包含测量名称、值和一些维度:
{
Time: "1614859498169",
TimeUnit: "MILLISECONDS",
MeasureName: "test",
MeasureValue: "1",
MeasureValueType: "DOUBLE",
Version: 1,
Dimensions: []
}
AWS 连接完全有效,区域已设置,...但它会导致以下错误:
UnknownOperationException: UnknownOperationException
24 |
25 | // Push the batch to timestream
> 26 | await client.send(new WriteRecordsCommand({
| ^
27 | DatabaseName: config.datbase,
28 | TableName: config.table,
29 | Records: records
at deserializeAws_json1_0WriteRecordsCommandError (../node_modules/@aws-sdk/client-timestream-write/protocols/Aws_json1_0.ts:1644:39)
at ../node_modules/@aws-sdk/middleware-serde/src/deserializerMiddleware.ts:20:18
at ../node_modules/@aws-sdk/middleware-signing/src/middleware.ts:26:22
at StandardRetryStrategy.retry (../node_modules/@aws-sdk/client-timestream-write/node_modules/@aws-sdk/middleware-retry/src/defaultStrategy.ts:125:38)
at ../node_modules/@aws-sdk/middleware-logger/src/loggerMiddleware.ts:21:20
at Object.publishMessages (publisher.ts:26:5)
at Object.<anonymous> (__tests__/publisher.spec.ts:17:9)
将记录插入时间流数据库应遵循哪种策略?
【问题讨论】:
-
我降级到 V2 SDK 以使其工作。
标签: aws-sdk-js