aws-greengrass / aws-greengrass-nucleus

The Greengrass nucleus component provides functionality for device side orchestration of deployments and lifecycle management for execution of Greengrass components and applications. This includes features such as starting, stopping, and monitoring execution of components and apps, interprocess communication server for communication between components, component installation and configuration management.
Apache License 2.0
107 stars 44 forks source link

Nucleus Telemetry Agent: Configuration for QOS #1627

Open cole-jxn opened 3 months ago

cole-jxn commented 3 months ago

Feature Description I noticed in the documentation for the Greengrass Nucleus Telemetry Agent that the QOS is set to 0. I have noticed my devices rarely send the aggregated daily telemetry data. To improve this, allowing the QOS to be set to 1 through the component configuration could help improve reliability.

I am referring to this link: https://docs.aws.amazon.com/greengrass/v2/developerguide/telemetry.html

The telemetry agent publishes data using the MQTT protocol with a quality of service (QoS) level of 0, which means that it doesn't confirm delivery or retry publishing attempts. Telemetry messages share an MQTT connection with other messages for subscriptions destined for AWS IoT Core.

Use Case Why do you need this feature? For my use case, daily aggregated data works fine, but using QOS = 0 makes it unreliable. I am currently using EventBridge to write the data to CloudWatch logs. I have 20 devices, but typically see updated logs every 5-6 days for a single device. I would expect to see all 20 devices publishing telemetry data every day.

Proposed Solution Add a configuration field "QOS" to the nucleus component:

{ "telemetry": { "enabled": true, "QOS": 1, "periodicAggregateMetricsIntervalSeconds": 3600, "periodicPublishMetricsIntervalSeconds": 86400 } }

Other Add detailed explanation, stacktraces, related issues, links for us to have context, etc https://docs.aws.amazon.com/greengrass/v2/developerguide/telemetry.html https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-telemetry

junfuchen99 commented 3 months ago

Hello,

Thanks for reaching out. We will look adding an option that makes Telemetry QOS 1