Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation of [null] slice for []int should not pass #271

Open
lahsivjar opened this issue May 3, 2024 · 5 comments
Open

Validation of [null] slice for []int should not pass #271

lahsivjar opened this issue May 3, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@lahsivjar
Copy link
Contributor

lahsivjar commented May 3, 2024

With empty slices the validation will fail. Example:

{"metadata": {"user": {"username": "logged-in-user", "id": "axb123hg", "email": "[email protected]"}, "labels": {"tag0": null, "tag1": "one", "tag2": 2}, "process": {"ppid": null, "pid": 1234, "argv": null, "title": null}, "system": null, "service": {"name": "testme-12a3", "node": {"configured_name": "node-1"},"language": {"version": null, "name":"ecmascript"}, "agent": {"version": "3.14.0", "name": "elastic-node", "activation_method": "some_activation_method"}, "environment": null, "framework": null,"version": null, "runtime": null}}}
{"metricset": { "samples": { "latency_distribution": { "type": "histogram", "unit": "s", "counts": [], "values": [] } }, "timestamp": 1496170421368000 }}

But with null values in the slices validation will not fail. Example:

{"metadata": {"user": {"username": "logged-in-user", "id": "axb123hg", "email": "[email protected]"}, "labels": {"tag0": null, "tag1": "one", "tag2": 2}, "process": {"ppid": null, "pid": 1234, "argv": null, "title": null}, "system": null, "service": {"name": "testme-12a3", "node": {"configured_name": "node-1"},"language": {"version": null, "name":"ecmascript"}, "agent": {"version": "3.14.0", "name": "elastic-node", "activation_method": "some_activation_method"}, "environment": null, "framework": null,"version": null, "runtime": null}}}
{"metricset": { "samples": { "latency_distribution": { "type": "histogram", "unit": "s", "counts": [null], "values": [null] } }, "timestamp": 1496170421368000 }}

I think both should have the same behavior.

@raultorrecilla
Copy link

raultorrecilla commented Jan 13, 2025

Hi @lahsivjar , @simitt explained to me a little bit the context of this.
As I understood this is part of the shared library and it will be a breaking change for agents which might be fine for apm server as we can change it as well, but it will cause issues on MIS.

Do you think this is still worth it? Shall we close it? In any case, this is too late for the 9.0 as it was initially planned.

@lahsivjar
Copy link
Contributor Author

@raultorrecilla I have completely paged this out of memory and I don't recall what will be the impact of having essentially empty histograms indexed as metrics. If the impact is not noteworthy then I am okay to close it.

@kruskall
Copy link
Member

I wonder if we should revisit nil handling and be more forgiving (ignore the value instead of failing)

@simitt
Copy link
Contributor

simitt commented Jan 16, 2025

I wonder if we should revisit nil handling and be more forgiving (ignore the value instead of failing)

+1 on implementing this in a non-breaking way (relaxing the check), which also takes pressure out of the timelines. Allowing nil values and filtering them out sounds like a good solution with low risk.

@raultorrecilla
Copy link

removing this from 9.0 candidate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants