使用日志监控 Kinesis 数据 Firehose CloudWatch - Amazon Kinesis Data Firehose

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用日志监控 Kinesis 数据 Firehose CloudWatch

Kinesis Data Firehose 与亚马逊CloudWatch日志集成,因此当用于数据转换或数据传输的 Lambda 调用失败时,您可以查看特定的错误日志。在创建交付流时,您可以启用 Kinesis Data Firehose 错误日志记录。

如果您在 Kinesis Data Firehose 控制台中启用 Kinesis Data Firehose 错误日志,则会代表您为传输流创建日志组和相应的日志流。日志组名称的格式为 /aws/kinesisfirehose/ delivery-stream-name ,其中 delivery-stream-name 是相应传输流的名称。 DestinationDelivery 是创建并用于记录与传送到主要目的地相关的任何错误的日志流。仅当 BackupDelivery 为目标启用了 S3 备份时,才会创建另一个名为的日志流。 BackupDelivery 日志流用于记录与传送到 S3 备份相关的任何错误。

例如,如果您创建以 Amazon Redshift 为目标的传输流 MyStream “” 并启用 Kinesis Data Firehose 错误日志,则会代表您创建以下内容:一个名为的日志组 aws/kinesisfirehose/MyStream 和两个名为和的日志流。 DestinationDelivery BackupDelivery 在此示例中, DestinationDelivery 将用于记录与传送到 Amazon Redshift 目的地以及与中间 S3 目的地相关的任何错误。 BackupDelivery ,如果启用了 S3 备份,则将用于记录与传送到 S3 备份存储桶相关的任何错误。

您可以通过AWS CLI、API 或AWS CloudFormation使用配置启用 Kinesis Data Firehose 错误日志记录。 CloudWatchLoggingOptions 为此,请提前创建日志组和日志流。我们建议仅为 Kinesis Data Firehose 错误日志保留该日志组和日志流。还要确保关联的 IAM 策略具有 "logs:putLogEvents" 权限。有关更多信息,请参阅 使用亚马逊 Kinesis 数据消防管控制访问权限

请注意,Kinesis Data Firehose 不保证所有传输错误日志都发送到CloudWatch日志。在传输失败率很高的情况下,Kinesis Data Firehose 会在将传输错误日志发送到 Logs 之前对其进行CloudWatch采样。

发送到 CloudWatch Logs 的错误日志收取象征性费用。有关更多信息,请参阅 Amazon CloudWatch 定价

数据传输错误

以下是每个 Kinesis Data Firehose 目的地的数据传输错误代码和消息列表。每个错误消息还描述了修复问题所应采取的适当操作。

亚马逊 S3 数据传输错误

Kinesis Data Firehose 可以将以下与亚马逊 S3 相关的错误发送到 Logs。CloudWatch

错误消息和信息 S3.KMS.NotFoundException

"The provided AWS KMS key was not found。If you are using what you believe to be a valid AWS KMS key with the correct role, check if there is a problem with the account to which the AWS KMS key is attached."

S3.KMS.RequestLimitExceeded

"The KMS request per second limit was exceeded while attempting to encrypt S3 objects。Increase the request per second limit."

有关更多信息,请参阅《AWS Key Management Service 开发人员指南》 中的 限制

S3.AccessDenied "Access was denied。确保所提供的 IAM 角色的信任策略允许 Kinesis Data Firehose 代入该角色,并且访问策略允许访问 S3 存储桶。” S3.AccountProblem “您的AWS帐户存在问题,导致操作无法成功完成。联系AWS支持部门。” S3.AllAccessDisabled "Access to the account provided has been disabled。联系AWS支持部门。” S3.InvalidPayer "Access to the account provided has been disabled。联系AWS支持部门。” S3.NotSignedUp “该账户未注册 Amazon S3。Sign the account up or use a different account." S3.NoSuchBucket "The specified bucket does not exist。Create the bucket or use a different bucket that does exist." S3.MethodNotAllowed "The specified method is not allowed against this resource。修改存储桶的策略以允许正确的 Amazon S3 操作权限。” InternalError "An internal error occurred while attempting to deliver data。将重试交付;如果错误仍然存在,则将报告给以AWS寻求解决。” Redshift.TableNotFound

"The table to which to load data was not found。Ensure that the specified table exists."

在 Amazon Redshift 中找不到数据应从 S3 复制到的目标表。请注意,如果亚马逊 Redshift 表不存在,Kinesis Data Firehose 不会创建该表。

Redshift.SyntaxError "The COPY command contains a syntax error。Retry the command." Redshift.AuthenticationFailed "The provided user name and password failed authentication。Provide a valid user name and password." Redshift.AccessDenied "Access was denied。确保所提供的 IAM 角色的信任策略允许 Kinesis Data Firehose 担任该角色。” Redshift.S3BucketAccessDenied "The COPY command was unable to access the S3 bucket。确保所提供的 IAM 角色的访问策略允许访问 S3 存储桶。” Redshift.DataLoadFailed "Loading data into the table failed。Check STL_LOAD_ERRORS system table for details." Redshift.ColumnNotFound "A column in the COPY command does not exist in the table。Specify a valid column name." Redshift.DatabaseNotFound “找不到亚马逊 Redshift 目标配置或 JDBC URL 中指定的数据库。Specify a valid database name." Redshift.IncorrectCopyOptions

"Conflicting or redundant COPY options were provided。Some options are not compatible in certain combinations。Check the COPY command reference for more info."

有关更多信息,请参阅 亚马逊 Redshift 数据库开发者指南中的亚马逊 Redshift COPY 命令

Redshift.MissingColumn "There is a column defined in the table schema as NOT NULL without a DEFAULT value and not included in the column list。排除此列,确保加载的数据始终为该列提供值,或者向该表的 Amazon Redshift 架构添加默认值。” Redshift.ConnectionFailed “与指定亚马逊 Redshift 集群的连接失败。确保安全设置允许 Kinesis Data Firehose 连接,在亚马逊 Redshift 目标配置或 JDBC URL 中指定的集群或数据库正确无误,并且集群可用。” Redshift.ColumnMismatch "The number of jsonpaths in the COPY command and the number of columns in the destination table should match。Retry the command." Redshift.IncorrectOrMissingRegion “亚马逊 Redshift 试图使用错误的区域终端节点来访问 S3 存储桶。要么在 COPY 命令选项中指定正确的区域值,要么确保 S3 存储桶与 Amazon Redshift 数据库位于同一区域。” Redshift.IncorrectJsonPathsFile "The provided jsonpaths file is not in a supported JSON format。Retry the command." Redshift.MissingS3File “亚马逊 Redshift 需要的一个或多个 S3 文件已从 S3 存储桶中删除。Check the S3 bucket policies to remove any automatic deletion of S3 files." Redshift.InsufficientPrivilege "The user does not have permissions to load data into the table。检查亚马逊 Redshift 用户权限以获取插入权限。” Redshift.ReadOnlyCluster "The query cannot be executed because the system is in resize mode。Try the query again later." Redshift.DiskFull "Data could not be loaded because the disk is full。增加 Amazon Redshift 集群的容量或删除未使用的数据以释放磁盘空间。” InternalError "An internal error occurred while attempting to deliver data。将重试交付;如果错误仍然存在,则将报告给以AWS寻求解决。” Splunk.DisabledToken "The HEC token is disabled。Enable the token to allow data delivery to Splunk." Splunk.InvalidToken "The HEC token is invalid。使用有效的 HEC 代币更新 Kinesis Data Firehose。” Splunk.InvalidDataFormat "The data is not formatted correctly。To see how to properly format data for Raw or Event HEC endpoints, see Splunk Event Data ." Splunk.InvalidIndex "The HEC token or input is configured with an invalid index。Check your index configuration and try again." Splunk.ServerError “由于来自 HEC 节点的服务器错误,向 Splunk 传输数据失败。如果您的 Kinesis Data Firehose 中的重试持续时间大于 0,Kinesis Data Firehose 将重试发送数据。如果所有重试都失败,Kinesis Data Firehose 会将数据备份到亚马逊 S3。” Splunk.DisabledAck "Indexer acknowledgement is disabled for the HEC token。Enable indexer acknowledgement and try again。For more info, see Enable indexer acknowledgement ." Splunk.AckTimeout "Did not receive an acknowledgement from HEC before the HEC acknowledgement timeout expired。尽管确认超时,但数据可能已在 Splunk 中成功建立索引。Kinesis Data Firehose 在确认超时已过期的亚马逊 S3 数据中进行备份。” Splunk.MaxRetriesFailed

"Failed to deliver data to Splunk or to receive acknowledgment。Check your HEC health and try again."

Splunk.ConnectionTimeout "The connection to Splunk timed out。这可能是暂时性错误,请求将被重试。如果所有重试都失败,Kinesis Data Firehose 会将数据备份到亚马逊 S3。” Splunk.InvalidEndpoint "Could not connect to the HEC endpoint。确保 HEC 端点 URL 有效且可从 Kinesis Data Firehose 访问。” Splunk.ConnectionClosed "Unable to send data to Splunk due to a connection failure。This might be a transient error。延长 Kinesis Data Firehose 配置中的重试持续时间可能会防止此类暂时性故障。” Splunk.SSLUnverified "Could not connect to the HEC endpoint。主机与对等项提供的证书不匹配。请确保证书和主机是有效的。 Splunk.SSLHandshake "Could not connect to the HEC endpoint。请确保证书和主机是有效的。

HTTPS 端点数据传输错误

Kinesis Data Firehose 可以将以下与 HTTP 终端节点相关的错误发送到日志。CloudWatch如果这些错误都与你遇到的问题不匹配,则默认错误如下:“尝试传送数据时出现内部错误。将重试交付;如果错误仍然存在,则将报告给以AWS寻求解决。”

错误消息和信息 HttpEndpoint.RequestTimeout

交付在收到回复之前已超时,将重试。如果此错误仍然存在,请联系 AWS Firehose 服务团队。

HttpEndpoint.ResponseTooLarge “从端点收到的响应太大。请联系终端的所有者以解决此问题。” HttpEndpoint.InvalidResponseFromDestination “从指定端点收到的响应无效。请联系端点的所有者以解决问题。” HttpEndpoint.DestinationException “从终端目的地收到以下响应。” HttpEndpoint.ConnectionFailed “无法连接到目标端点。请联系终端的所有者以解决此问题。” HttpEndpoint.ConnectionReset “无法保持与端点的连接。请联系终端的所有者以解决此问题。” HttpEndpoint.ConnectionReset “与端点保持连接时出现问题。请联系终端的所有者。” Lambda.JsonProcessingException

“解析 Lambda 函数返回的记录时出错。确保返回的记录符合 Kinesis Data Firehose 要求的状态模型。”

有关更多信息,请参阅 数据转换和状态模型

Lambda.InvokeLimitExceeded

“已超过 Lambda 并发执行限制。Increase the concurrent execution limit."

有关更多信息,请参阅 AWS Lambda开发人员指南AWS 中的 Lambda 限制

Lambda.DuplicatedRecordId

"Multiple records were returned with the same record ID。确保 Lambda 函数返回每条记录的唯一记录 ID。”

有关更多信息,请参阅 数据转换和状态模型

Lambda.MissingRecordId

"One or more record IDs were not returned。确保 Lambda 函数返回所有收到的记录 ID。”

有关更多信息,请参阅 数据转换和状态模型

Lambda.ResourceNotFound

“指定的 Lambda 函数不存在。Use a different function that does exist."

Lambda.InvalidSubnetIDException

“Lambda 函数 VPC 配置中指定的子网 ID 无效。Ensure that the subnet ID is valid."

Lambda.InvalidSecurityGroupIDException

“Lambda 函数 VPC 配置中指定的安全组 ID 无效。Ensure that the security group ID is valid."

Lambda.SubnetIPAddressLimitReachedException

“无法AWS Lambda为 Lambda 函数设置 VPC 访问权限,因为一个或多个已配置的子网没有可用的 IP 地址。Increase the IP address limit."

有关更多信息,请参阅 亚马逊 VPC 用户指南中的亚马逊 VPC 限制-VPC 和子网

Lambda.ENILimitReachedException

“无法AWS Lambda在 VPC 中创建作为 Lambda 函数配置的一部分指定的弹性网络接口 (ENI),因为已达到网络接口的限制。Increase the network interface limit."

有关更多信息,请参阅 亚马逊 VPC 用户指南中的亚马逊 VPC 限制-网络接口

输出结构无效。检查您的函数并确保输出采用所需的格式。此外,请确保已处理的记录包含 Dropped Ok 、或的有效结果状态 ProcessingFailed

Lambda 函数已成功调用,但它返回了错误结果。

Lambda 无法解密环境变量,因为对 KMS 密钥的访问已被拒绝。检查该函数的 KMS 密钥设置以及密钥策略。有关更多信息,请参阅 密钥访问疑难解答

Kinesis Data Firehose 在调用 AWS Lambda 时遇到错误 将重试该操作;如果错误仍然存在,将报告给以AWS寻求解决。”

Kinesis 数据消防队遇到了来InvalidStateException自 Lambda 的 KMS。Lambda 无法解密环境变量,因为所用的 KMS 密钥处于无效的解密状态。检查 lambda 函数的 KMS 密钥。

Kinesis Data Firehose 遇到了AWSLambdaException来自 Lambda Lambda 无法初始化提供的容器映像。验证图片。

Kinesis Data Firehose 在调用 AWS Lambda 时遇到超时错误 支持的最大函数超时为 5 分钟。有关更多信息,请参阅 数据转换执行持续时间

访问 Kinesis Data Firehose CloudWatch 的日志

您可以使用 Kinesis Data Firehose 控制台或控制台查看与 Kinesis Data Firehose 数据传输失败相关的错误日志。CloudWatch下面的过程介绍如何使用这两种方法访问错误日志。

使用 Kinesis Data Firehose 控制台访问错误日志
  1. 登录到 AWS Management Console,然后通过以下网址打开 Kinesis 控制台: https://console.aws.amazon.com/kinesisvideo/home

  2. 在导航窗格中选择 Data Firehose (数据 Firehose)

    在导航栏上,选择一个AWS区域。

    选择传输流名称,转到传输流详细信息页面。

    选择 Error Log 查看与数据传输故障有关的错误日志的列表。

    使用 CloudWatch 控制台访问错误日志
    1. 打开 CloudWatch 控制台 ( https://console.aws.amazon.com/cloudwatch/ )。

    2. 在导航栏中,选择一个区域。