You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of datafusion related changes going on OpenSearch core, the team has requested to add new telemetry device which would fetch and ingest metrics related for backend analytics plugin.
Usage: pass --telemetry datafusion-stats in the command.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
The flattening logic in record() only processes dict values but does not handle non-dict top-level values. If the API response includes a top-level key with a non-dict value (e.g., a string or number), that key-value pair is silently ignored and not stored in the metrics. This could lead to incomplete telemetry data if the API format changes or includes additional fields.
The code assumes all non-dict values in stats should be ignored, but doesn't handle top-level scalar values. If the API returns unexpected structure with top-level scalars, they will be silently dropped, potentially losing important data.
doc = {"name": "datafusion-stats"}
for section_name, section_values in stats.items():
if isinstance(section_values, dict):
for key, value in section_values.items():
doc[f"{section_name}_{key}"] = value
+ else:+ doc[section_name] = section_values
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly identifies that top-level scalar values would be silently dropped. However, based on the test data in DataFusionStatsRecorderTests.stats_response, the API only returns nested dictionaries, making this a defensive improvement rather than fixing an actual bug.
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
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.
Description
As part of datafusion related changes going on OpenSearch core, the team has requested to add new telemetry device which would fetch and ingest metrics related for backend analytics plugin.
Usage: pass
--telemetry datafusion-statsin the command.Below is how the stats will be queried:
Issues Resolved
[List any issues this PR will resolve]
Testing
[Describe how this change was tested]
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.