Giter VIP home page Giter VIP logo

Comments (12)

vmarchaud avatar vmarchaud commented on May 18, 2024

https://github.com/keymetrics/pmx-2/blob/master/src/features/notify.ts#L37

from pm2-io-apm.

Unitech avatar Unitech commented on May 18, 2024

Why closing it?

from pm2-io-apm.

vmarchaud avatar vmarchaud commented on May 18, 2024

Misunderstood the title, currently everything expect that the notify send an error. Both frontend and backend, so i think we can just force it to be an error.
If people want to send additional metadata, they need to attach it to the error object like we do with the express middleware for example.

from pm2-io-apm.

wallet77 avatar wallet77 commented on May 18, 2024

It really depends on what notify mean !
Does it mean :

  • notify me if an error occurred ?
  • or just notify me when an event is emitted ?

We can have a notify method and a notifyError method if we want to do both.

from pm2-io-apm.

vmarchaud avatar vmarchaud commented on May 18, 2024

or just notify me when an event is emitted

We have pmx.emit event specially for this, and you can setup alert on it.

from pm2-io-apm.

Unitech avatar Unitech commented on May 18, 2024

We will need to rename this methods anyway.

Example for custom error handling on newrelic:
newrelic.noticeError(e, { message: "record custom event failed" });

from pm2-io-apm.

vmarchaud avatar vmarchaud commented on May 18, 2024

Of course we can change the high level API but for the event process:exception sent to the backend, the data sended should be in the form of an error, in the present or the future.
We can maybe add different event with like process:error ?

from pm2-io-apm.

Unitech avatar Unitech commented on May 18, 2024

from pm2-io-apm.

vmarchaud avatar vmarchaud commented on May 18, 2024

I think we just should reserve the event process:exception for runtime error that can't be avoided (= crash), and process:error that are handled by the user

from pm2-io-apm.

wallet77 avatar wallet77 commented on May 18, 2024

Currently, send method in transport class can send any kind of object.

from pm2-io-apm.

vmarchaud avatar vmarchaud commented on May 18, 2024

Also note how pmx try to adapt the object sended via pmx.notify : https://github.com/keymetrics/pmx-2/blob/master/src/features/notify.ts#L134

from pm2-io-apm.

Unitech avatar Unitech commented on May 18, 2024

pmx.notifyError(new Error(msg), { context })

from pm2-io-apm.

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.