Skip to content

Add IoT Metrics Support#809

Open
xiazhvera wants to merge 35 commits intomainfrom
iot_metrics
Open

Add IoT Metrics Support#809
xiazhvera wants to merge 35 commits intomainfrom
iot_metrics

Conversation

@xiazhvera
Copy link
Contributor

@xiazhvera xiazhvera commented Dec 19, 2025

Issue #, if available:

Description of changes:

  • Bind IoTDeviceSDKMetrics and metrics related features , CRT is now appending AWS metrics by default.
  • Add enableMetrics option to allow user disable metrics.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Mqtt5::Mqtt5ClientOptions mqtt5Options(allocator);
mqtt5Options.WithHostName(mqtt5TestVars.m_hostname_string);
mqtt5Options.WithPort(mqtt5TestVars.m_port_value);
mqtt5Options.WithMetricsCollection(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we testing that setting this to false is preventing metrics from being added? Also, I'm not seeing a test that is checking that metrics ARE being added neither. Maybe I'm missing something.

/* Error */
int m_lastError;

/** Enable AWS IoT Metrics Collection. This is always set to true for now. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial: Maybe it'll become clearer below but what does this mean it's always set to true? Is this not tied to the enableMetrics bools that can be set to false?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this can't be changed to false. Is there a reason we're not allowing metrics to be disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option was originally there to match MQTT3 behavior, which allows users to disable metrics. Since the MQTT5 client does not supports toggling metrics collection, it should be safe to remove.

Copy link
Contributor

@sbSteveK sbSteveK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add what enable metrics defaults to in some locations and add tests that turning them off results in an unpadded username.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants