Add IoT SDK Metrics V2 with feature encoding and metadata support#994
Open
rakshil14-2 wants to merge 11 commits into
Open
Add IoT SDK Metrics V2 with feature encoding and metadata support#994rakshil14-2 wants to merge 11 commits into
rakshil14-2 wants to merge 11 commits into
Conversation
xiazhvera
requested changes
Jun 10, 2026
xiazhvera
reviewed
Jun 10, 2026
| (jstring)(*env)->GetObjectField(env, entry, iot_metrics_metadata_properties.key_field_id); | ||
| jstring value_jstr = | ||
| (jstring)(*env)->GetObjectField(env, entry, iot_metrics_metadata_properties.value_field_id); | ||
| if (key_jstr != NULL && value_jstr != NULL) { |
Contributor
There was a problem hiding this comment.
As mentioned in Python PR, empty key or empty value is valid case. While I'm not sure how GetObjectField handled undefined fields though.
| java_metrics->metrics.metadata_count = java_metrics->metadata_count; | ||
| } | ||
|
|
||
| (*env)->DeleteLocalRef(env, metadata_list); |
Contributor
There was a problem hiding this comment.
I'm not familiar with JNI memory management. Could you confirm that delete the jni object would not release the memory buffer? Could we have full crt logS that shows that metadata fields are set properly?
Author
There was a problem hiding this comment.
DeleteLocalRef: It will just release the local reference without affecting the memory buffer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes:
IoTDeviceSDKMetricsfor passing key-value metrics through JNI to aws-c-mqttIoTMetricEncoderthat encodes CRT-level features (protocol, socket, TLS, proxy, jitter, session, queue, topic alias) into compact "ID/Value" formatwithMetrics()/setMetrics()) for IoT SDK layermetricsEnabled→disableMetrics(opt-out pattern, default false)TlsContextfor feature reportingBreaking changes:
withMetricsEnabled(boolean)→withDisableMetrics(boolean)getMetricsEnabled()→getDisableMetrics()By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.