Code Monkey home page Code Monkey logo

Comments (8)

JacksonWeber avatar JacksonWeber commented on June 3, 2024 1

@Apokalypt I believe the functionality you're referring too still exists. You should be able to see how we handle persisting here.

Regarding 2.X SDK maintenance, yes, the 2.X SDK will be updated in the case of security flaws to support customers on that version.

I can work on testing this scenario and determine if we can prioritize it. I'll let you know if development begins on this feature.

from applicationinsights-node.js.

Apokalypt avatar Apokalypt commented on June 3, 2024

Before creating this issue, I tried to see if I could find a way to force the trace push "manually". I found 3, but this is absolutely not a good way to do it...

1st solution

  1. Create the appinsight client, set disk retry caching to true and set auto collect exceptions to true
  2. Listen the event uncaughtExceptionMonitor
  3. When it's emitted, change the resend interval to few millisecond
  4. Force the creation of a trace (e.g. with a log, with the method trackTrace, ...)
  5. Call the flush method without isAppCrashing option
  6. Wait a few seconds to be sure that all traces were pushed (even the exception ones that may be stored previously by the library inside of a local file) and then force the application to stop

--> We force the app to stay alive in a possible unstable state

2nd solution

  1. Create the appinsight client, set disk retry caching to true and set auto collect exceptions to false
  2. Listen the event uncaughtExceptionMonitor
  3. When it's emitted, track manually the exception thanks to trackException method
  4. Call the flush method without isAppCrashing option and, in callback, force the application to stop

--> We force the app to stay alive in a possible unstable state

3rd solution

  1. Create the appinsight client and set disk retry caching to true with the interval set to few MS
  2. At startup, force the creation of a telemetry and immediately call the flush method
  3. Wait few seconds to be sure that all locally file stored has been sent and then update the interval of the disk retry caching to a more normal value

from applicationinsights-node.js.

Apokalypt avatar Apokalypt commented on June 3, 2024

What do you think @JacksonWeber ? I'm up for doing the PR, but I'd rather have an opinion before I start working on it.

from applicationinsights-node.js.

JacksonWeber avatar JacksonWeber commented on June 3, 2024

@Apokalypt Before you begin any work on something like this, we're migrating away from the Application Insights 2.X SDK to an OpenTelemetry based solution that will be the foundation going forward. So if you look at the behavior of https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/monitor-opentelemetry and find you have the same issue there (I believe this logic is the same), it would be best to discuss the suggestion in that repository. Haven't gotten much time to investigate this suggestion, but I wanted to make you aware of that change first.

from applicationinsights-node.js.

Apokalypt avatar Apokalypt commented on June 3, 2024

@Apokalypt Before you begin any work on something like this, we're migrating away from the Application Insights 2.X SDK to an OpenTelemetry based solution that will be the foundation going forward. So if you look at the behavior of https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/monitor-opentelemetry and find you have the same issue there (I believe this logic is the same), it would be best to discuss the suggestion in that repository. Haven't gotten much time to investigate this suggestion, but I wanted to make you aware of that change first.

@JacksonWeber Thanks for your answer.
I'm already aware of this major change, however I didn't know its current status (close to a stable release or not) which is why I was suggesting it on the current version. In fact, this suggestion stems mainly from a need expressed by the team where I work, which is the second reason why I'm suggesting it on version 2.x.

Nevertheless, if version 3.x is close to a stable release (and the behavior is the same/similar) I'm okay with proposing an implementation directly on 3.x. Do you have an ETA of a 3.x stable release?

from applicationinsights-node.js.

JacksonWeber avatar JacksonWeber commented on June 3, 2024

@Apokalypt Version 3 is expected to release this week.

from applicationinsights-node.js.

Apokalypt avatar Apokalypt commented on June 3, 2024

Ok thx, I will take a look at the version 3.x to implement this feature 👍

from applicationinsights-node.js.

Apokalypt avatar Apokalypt commented on June 3, 2024

Unfortunately, I don't think I'll have time to look at the implementation at the moment. Especially as I've had a quick look at the project and I have the impression that the functionality for sending missing traces following a crash has been removed... From there, I have 2 questions:

  • Will version 2.x be maintained if there's a security flaw?
  • Do you have the time to look into these features @JacksonWeber ?

from applicationinsights-node.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.