microsoft / microsoft/ApplicationInsights-JS

[Feature] Add the ability to disable truncation

Open
#2,383 6 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
685
Forks
261
Avg merge
21h 33m
Merged PRs (30d)
5

Description

**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](https://github.com/microsoft/ApplicationInsights-JS/blob/main/shared/AppInsightsCommon/src/Telemetry/Common/DataSanitizer.ts#L23).

**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.

Contributor guide

Open the contributing guide

Research direction

Start with shared/AppInsightsCommon/src/Telemetry/Common/DataSanitizer.ts and trace how the track method reaches property truncation. Determine where an option could be passed through without changing the default 8192-character limit. Done means callers can disable truncation for self-hosted telemetry while existing behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.