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

[Feature] Add the ability to disable truncation #2383

Open
MgenGlder opened this issue Jul 23, 2024 · 6 comments
Open

[Feature] Add the ability to disable truncation #2383

MgenGlder opened this issue Jul 23, 2024 · 6 comments

Comments

@MgenGlder
Copy link

Is your feature request related to a problem? Please describe.
Adding the an option to the track method that disables property truncation.

Describe the solution you'd like
I currently use ApplicationInsights-Web to send telemetry to a non-Azure endpoint. I do this because the SDK is robust, has fault tolerance, and implements useful retry logic out of the box. My service understands and adheres to the contracts created by the Application Insights SDK. Unfortunately, the SDK defaults to limiting the length of property fields to 8192 characters. This limit is based on the Application Insights Azure service's specifications, but isn't relevant if you use a self-hosted option.

I'd love to see an option that can be passed down to conditionally disable the character length limit that exists here.

Describe alternatives you've considered
I've considered migrating away from using the ApplicationInsights-web SDK, though I enjoy the benefits the library confers for telemetry management.

I've also considered shrinking telemetry length, though there are some messages that are long by nature and cannot be shrunk.

@MSNev
Copy link
Collaborator

MSNev commented Jul 23, 2024

We can't remove the "truncation" limits as if we do the backend will reject the entire event as that is why we have these limits in place.

If you find "some" field where it seems that the SDK imposed limit does not match the server limit we can address that as a bug, but generally the limits were gathered from the server several years ago.

@MgenGlder
Copy link
Author

MgenGlder commented Jul 25, 2024

We can't remove the "truncation" limits as if we do the backend will reject the entire event as that is why we have these limits in place.

If you find "some" field where it seems that the SDK imposed limit does not match the server limit we can address that as a bug, but generally the limits were gathered from the server several years ago.

@MSNev Thanks for replying so quickly!

What about the possibility of adding a configuration to disable truncation client-side? We have our own server that mimics the behavior of the App Insights server, but doesn't have character limits as we need longer field values. It could be added to the .Track(..., truncate: Boolean) function such that, if omitted, it defaults to true. What do you think?

@MSNev
Copy link
Collaborator

MSNev commented Jul 25, 2024

That might be a little ticky as all of the actual sanitization (truncation) occurs in these functions which don't take any additional config properties (to potentially have a disable flag)...

Which would mean that every call of these would either need to have an alias (so we could replace with a no-op that just returns the value), so it's probably not a trivial change and we would need to be a little careful to ensure we didn't increase the bundle size too much or introduce bugs of people that don't have the same requirements.

I'll tag this as an enhancement, but I don't expect that we will get to this any time soon. So feel free to investigate and see if you could propose a possible option to solve your issue (ie. a PR).

@MgenGlder
Copy link
Author

@MSNev In league with your feedback on my PR- do you have any availability to walk through the code a bit? I'd love to get the lay of the land in terms of how things work holistically, as well as future plans I can work around.

@MSNev
Copy link
Collaborator

MSNev commented Sep 25, 2024

What timezone are you in? I'm in PST/PDT, I tend to have a lot of early morning meetings my time everyday... Based on your github profile it looks like your about -3hrs from me, is your listed github email the best way to directly contact you?

@MgenGlder
Copy link
Author

MgenGlder commented Sep 30, 2024

What timezone are you in? I'm in PST/PDT, I tend to have a lot of early morning meetings my time everyday... Based on your github profile it looks like your about -3hrs from me, is your listed github email the best way to directly contact you?

@MSNev Yep! That's correct, I'm in EDT, so ~3 hours ahead of you. I can be reached at [email protected]. I was searching for you in Teams but I wasn't able to find your full handle, maybe we can interface that way?

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

No branches or pull requests

2 participants