-
Notifications
You must be signed in to change notification settings - Fork 242
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
Add metadata
configuration object to TelemetryItem, for use in .track(...)
function to enable customizing event property truncation threshold
#2419
base: main
Are you sure you want to change the base?
Conversation
- Also add `maxLength` configuration to sanitizer.
metadata
configuration object to TelemetryItemmetadata
configuration object to TelemetryItem, for use in .track(...)
function
metadata
configuration object to TelemetryItem, for use in .track(...)
functionmetadata
configuration object to TelemetryItem, for use in .track(...)
function to enable customizing event property truncation threshold
@MgenGlder please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
- Fix text description names.
- Use `string` instead of `String` types in Typescript.
We can't just "add" properties to the ITelemetryItem as this library is also used by an internal extension and having something else (while optional) would cause a clash. There are also longer term plans that are starting to solidify on how we might go about providing OpenTelementry support / API compatibility, and this approach would clash with some of the ideas that are circulating. Tracing this back to where it gets called it looks like it occurring in the Perhaps, introducing a configuration on the "ISenderConfig" (which will then be unique to Application Insights, so no clash concerns) that would allow you to provide either an override implementation of the entire Other options (which we have considered in the past and we have for the 1ds-post implementation), is to introduce a serializer interface (which is not a small change) so that it can be (and we do in some internal code extensions) replaced with something else -- it primary use case was to provide "sanitization" in the form of Hashing out configured fields.... We may still introduce this as well, so any changes in this code is a little messy. Other options you might want to consider.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking for now based on my previous comments
@MSNev Thanks for looking at this. I have a few questions that will help me navigate the rework:
|
Sorry, I was unexpectedly OOF yesterday.
Simplistically, any extension (thing that extends the One (gotya) that we have to deal with (that you won't necessarily for your extension), is that historically (and still supported), is that if the configuration is not specified in any
As above as long as you "always" provide an
The 1ds extensions (1ds-core-js and 1ds-post -- part of the internal MS only usages) we do have a
Not beyond what is in the repo itself, we are working on building it out (in the docs folder which is deployed to https://microsoft.github.io/ApplicationInsights-JS/) and in the readme for creating your own extension |
Note
This is an early POC and draft. I'm looking for feedback and working through the best way to approach this addition.
References #2383
Todo
Event
.Dependency
Exception
Metric
PageView
Trace
PageViewPerformance
.track
function withmetadata
passed in, and having themaxLength
configuration be respected.README.md
docs with addition of configuration object and instructions and recommendations for how to use it.Nice-To-Haves / Next Iteration Goals
ApplicationInsights
client, and not passed every time you call the.track
function. I'm limited by my understanding of the codebase at present, but I will look to attempt to add this in future iterations / PRs.Summary
Enables customization for
properties
bag value truncation through a newmetadata
configuration object, passed through the.track(...)
function.Additions:
maxLength
configuration to sanitizer.metadata
dictionary object to house user configurations when calling.track(...)
function.Context
We're using the
ApplicationsInsights-web-basic
npm package to make requests for an internal service that mimics the behavior of the ApplicationInsights managed service, sans the property size limit. We'd like to make it so you can configure the max length before truncation.Use
You should now be able to pass a
metadata
object within yourTelemetryItem
when calling.track(...)
via the ApplicationInsights client 👇🏾Notes
This can be leveraged in the future for passing down custom configurations that can be used to override hard coded constants.