GithubHelp home page GithubHelp logo

exceptionless.java's Introduction

Exceptionless Exceptionless

Build Discord BuiltWithDot.Net shield

The definition of the word exceptionless is: to be without exception. Exceptionless provides real-time error reporting for your JavaScript, Node, .NET Core, ASP.NET, Web API, WebForms, WPF, Console, and MVC apps. It organizes the gathered information into simple actionable data that will help your app become exceptionless!

โญ๏ธ We appreciate your star, it helps!

Using Exceptionless

Refer to the Exceptionless documentation.

Hosting Options

We provide very reasonably priced hosting at Exceptionless. By using our hosted service, you are supporting the project and helping it get better! We also provide set up and support services.

Exceptionless can easily be run locally using Docker:

  • docker run --rm -it -p 5200:8080 exceptionless/exceptionless:latest
  • Open http://localhost:5200
  • Create an account. The first account in the system will automatically be an admin.

This will run a completely self-contained simple instance of Exceptionless. It is only suitable for testing purposes since it will not persist data. For more complete setups, check out the self hosting documentation. Also, if you want to support the project while self hosting you can send us a pull request or donation.

Contributing

In appreciation for anyone who submits a non-trivial pull request, we will give you a free Exceptionless paid plan for a year. After your pull request is accepted, simply send an email to [email protected] with the name of your organization and we will upgrade you to a paid plan.

  • Please read the contributing document
  • Requirements
  • Visual Studio Code
    • Open Visual Studio Code and then open the Exceptionless root folder
    • Go to the Terminal menu and select Run Task... and then select Start Elasticsearch (you can stop the service when you are done using the Stop Elasticsearch task)
    • Go to the Debug menu and select the Web launch configuration then click the Start Debugging button
    • A browser window should be automatically opened to https://localhost:5100/
    • When running locally in Development mode, a global administrator user test@localhost is automatically created with password tester. You can also click the Signup button to create a new account
  • Visual Studio
    • Open Visual Studio and then open the Exceptionless.sln solution in the root folder
    • Start Elasticsearch by either configuring multiple startup projects for the docker-compose and Exceptionless.Web projects or by running the start-services.ps1 script in the root folder
    • Run the Exceptionless.Web project
    • A browser window should be automatically opened to https://localhost:5100/
    • When running locally in Development mode, a global administrator user test@localhost is automatically created with password tester. You can also click the Signup button to create a new account

image

UI Only Development

The UI is a SPA application that runs against the Exceptionless API. The source is located in the src/Exceptionless.Web/ClientApp folder. The UI will automatically be started when running the whole project, but if you want to work on just the UI, then open Visual Studio Code to the src/Exceptionless.Web/ClientApp folder and run the npm run serve (use exceptionless api) task to start the UI pointing at the official Exceptionless API. You will need to login to your actual Exceptionless account.

API Only Development

You can work on just the API without running the SPA UI by selecting the Exceptionless API launch configuration in Visual Studio. You can then run requests using the exceptionless.http file. Make sure that you have the REST Client extension installed.

Thanks

Thanks to all the people who have contributed!

contributors

Thanks to JetBrains for a community WebStorm and ReSharper license to use on this project. It's the best JavaScript IDE/Visual Studio productivity enhancement hands down.

Thanks to Red Gate for providing an open source license for a .NET Developer Bundle. It's an indispensable tool when you need to track down a performance/memory issue.

exceptionless.java's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

exceptionless.java's Issues

Add async submission methods

Currently, we support methods such as submitLog that submit events synchronously. Add corresponding methods to submit this asynchronously.

Configuration Feedback

In the latest JavaScript rewrite (workspace branch). We've been talking about how we can simplify configuration in general. Here is a breakdown of that feedback which would cause some code to be deleted ๐Ÿ‘๐Ÿป .

Constructor

On a platform like java I think we would know a lot of the defaults that wouldn't change often in terms of services and configuration. Seems like we could default all the items of the Configuration Manager and have a simple empty constructor. The ExceptionlessClient could have a startup method where we pass a Function/Predicate that contains a new configuration object and a user could set any properties on that. Thoughts?

Combine Configuration and Configuration Manager?

Is there any reason we shouldn't combine these and move services into an aggregate root property?

Simplifying of services.

The module collector, request info collector environment collector and error parser probably will never change in most implementations so it doesn't make sense defining services or interfaces for them. If we simply do the work in the plugin we can simplify services configuration all together. We also moved these into a services property to clean up configuration.

Configuration endpoint

We try to load the configuration settings via submission client from a preconfigured config subdomain https://config.exceptionless.io. I noticed this was missing.

Server url

Setting the server url should override the config and heartbeat server urls as well (So if you are self hosting it will set all the servers to the same).

Java client for exceptionless

Ref: exceptionless/Exceptionless#123

๐Ÿ‘‹ After going through the above issue and a quick google search I don't think we have any official client library for Java or I am missing something. I think the repository created for the Java client in the above issue is now deleted.

My background:
I am currently working on a Java app and need a self-hosting error monitoring solution. I worked with sentry before in a professional setting but want to try exceptionless for my current project.

Add Getting Started section to readme

It would be great to have a getting started to the readme. This would give some steps of required software to get going and work with the project. We try to have docs for VS Code but that isn't required (I'm also not sure what editor you use or recommend :)).

Also is there a min java version we support?

Investigate error in posting an event

com.exceptionless.exceptionlessclient.exceptions.SubmissionClientException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class io.netty.buffer.ByteBufInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->com.exceptionless.exceptionlessclient.submission.EventRequest["data"]->java.util.HashMap["@ext"]->org.springframework.core.codec.CodecException["cause"]->com.fasterxml.jackson.databind.exc.InvalidDefinitionException["location"]->com.fasterxml.jackson.core.JsonLocation["sourceRef"])
	at com.exceptionless.exceptionlessclient.submission.DefaultSubmissionClient.postSubmission(DefaultSubmissionClient.java:89) ~[exceptionless-client-1.0-beta1.jar:na]
	at com.exceptionless.exceptionlessclient.submission.DefaultSubmissionClient.postEvents(DefaultSubmissionClient.java:52) ~[exceptionless-client-1.0-beta1.jar:na]
	at com.exceptionless.exceptionlessclient.queue.DefaultEventQueue.process(DefaultEventQueue.java:140) ~[exceptionless-client-1.0-beta1.jar:na]
	at com.exceptionless.exceptionlessclient.queue.DefaultEventQueue.onProcessQueue(DefaultEventQueue.java:80) ~[exceptionless-client-1.0-beta1.jar:na]
	at com.exceptionless.exceptionlessclient.queue.DefaultEventQueue$1.run(DefaultEventQueue.java:65) ~[exceptionless-client-1.0-beta1.jar:na]
	at java.base/java.util.TimerThread.mainLoop(Timer.java:556) ~[na:na]
	at java.base/java.util.TimerThread.run(Timer.java:506) ~[na:na]
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class io.netty.buffer.ByteBufInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->com.exceptionless.exceptionlessclient.submission.EventRequest["data"]->java.util.HashMap["@ext"]->org.springframework.core.codec.CodecException["cause"]->com.fasterxml.jackson.databind.exc.InvalidDefinitionException["location"]->com.fasterxml.jackson.core.JsonLocation["sourceRef"])
	at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1277) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:726) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:681) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:637) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:119) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4407) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3661) ~[jackson-databind-2.11.2.jar:2.11.2]
	at com.exceptionless.exceptionlessclient.submission.DefaultSubmissionClient.postSubmission(DefaultSubmissionClient.java:70) ~[exceptionless-client-1.0-beta1.jar:na]
	... 6 common frames omitted

Submission Client Feedback

Multiple http clients

Would be nice if there was only one submission client instead of having one for settings too All of our current clients follow this pattern (doesn't mean we have to, but it's good to be consistent).

Utils Class

String requestJSON = Utils.JSON_MAPPER.writeValueAsString(data);
I don't know if we need to have a JSON_MAPPER in the utils class. It feels like we could just do the serialization inline or use a ISerializer service on configuration. We know our serialization format and I don't know if it needs to be exposed.

Checking server response is success

We reworked the js client a bit in this front, but it seems like it would be better to check response.isSuccessful instead of response.code() / 100 != 2. Unless you are running into some kind of issue. Again you are the domain expert :).

Settings

We'll return a 304 if settings are current and won't return a body. Otherwise if the status is a 200 it will contain the configuration. This would simplify some checks :)

Throwing errors.

We typically return a model from the submission client to give the status (again not required), we do this because we don't want to throw exceptions that might go unhandled. Our goals in the client is to never blow up a clients application ever, just log out a failure happened. Would be good to ensure we are ensuring the exceptions we do throw are caught at the call sites.

Async (what we have now works)

In .NET and previous version of JavaScript client we have a fully sync client. For both of these we did this because at the time we wrote it async wasn't prevalent in the languages. When we rewrote the JavaScript client we made it async but it had a cascading virus affect to the code base. Since submissions happen in a background thread (queue timer) I still think it's fine being sync. I added this section only to consider it if it's gained main stream adoption in Java and if we feel like it's worth doing as it will be a breaking change later. But I feel if we do this we should do the whole api (queue processing, plugins etc). Is it worth it? Is it even possible... do timers support async safely (async over sync)?

Unable to build or run tests

I installed latest JDK 11 (not the OJDK) and maven latest and I can't verify or run any of the tests. Is there something I need to do? I can't verify or click around in VS Code very easily because the builder methods don't exist.

> Executing task: mvn -B verify <

[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< com.exceptionless:exceptionless-client >---------------
[INFO] Building exceptionless-client 1.0-beta1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.22.0/maven-surefire-plugin-2.22.0.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.22.0/maven-surefire-plugin-2.22.0.pom (5.0 kB at 15 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.22.0/surefire-2.22.0.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.22.0/surefire-2.22.0.pom (27 kB at 414 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/31/maven-parent-31.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/31/maven-parent-31.pom (43 kB at 723 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/apache/19/apache-19.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/apache/19/apache-19.pom (15 kB at 298 kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.4/maven-jar-plugin-2.4.pom (5.8 kB at 102 
kB/s)
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom
[INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom (13 kB at 256 kB/s)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ exceptionless-client ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory D:\Code\Exceptionless.Java\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ exceptionless-client ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 78 source files to D:\Code\Exceptionless.Java\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.662 s
[INFO] Finished at: 2021-04-18T08:39:04-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project exceptionless-client: Fatal error 
compiling: invalid target release: 11 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command mvn -B verify" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

Plugin/Client Error handlers feedback

Handling different platforms

In the .NET clients we have we usually have a startup method on ExceptionlessClient that takes a function/predicate with a Configuration object or api key and allows configuration / setting api key and startups timers, applies configuration etc.. We then have multiple packages for different client technologies and we define Register Extension method to hook up any platform error handlers and calls startup.

In the new JavaScript client we just have startup that does the same thing but instead of Register extension methods we export a preconfigured exceptionless client (https://github.com/exceptionless/Exceptionless.JavaScript/blob/feature/workspaces/packages/browser/src/index.ts#L12) for each platform that wires up plugins that register to global error handlers: https://github.com/exceptionless/Exceptionless.JavaScript/blob/28f253ffb2e0b09b113a466860a76a0ddde4d152/packages/browser/src/BrowserExceptionlessClient.ts#L25

This brings me to the question: Do we feel like we'd have many different client technologies we'd support on java that that we'd be wiring up to different error handlers? If so what approach do we want to take? I kinda like the plugin approach but we need an easy way to add them (but it's not to much to ask or provide an easy way later to add default plugins based on the integration).

If we go the plugin route, we added support for startup and suspend to plugins (optional to implement). Here is an example plugin (We just gotta make sure we only wire up one handler if startup is called multiple times).

Event Plugin Context:

Since plugins are really dynamic, it might be nice to just store exception, unhandled error submission method and request in a data bag (dictionary<string,object>). This way users can add there own things to it. We don't have to do this but it seems like it would be nice.

Plugins

Error plugin

For the error plugin the exclusions was extra properties that are stored on the Exception object that we didn't want to include in an errors extended data that we capture. We'd want to update this for java or remove it.

Module info

We should cache this as I'm guessing this is expensive to compute every time run is called.

Duplicate Checker:

The merged event hash isn't used (at least that's what vs code is telling me.

This plugin should be checking all event types and not just errors, but this is a good starting place!

Change Settings manager log messages to debug

Following should be better suited for debug mode:
2021-04-20 09:11:04.858 INFO 13084 --- [-settings-timer] c.e.e.settings.SettingsManager : Checking for updated settings from v1
2021-04-20 09:11:04.863 INFO 13084 --- [-settings-timer] c.e.e.settings.SettingsManager : No need to update, settings are not modified

Add a method to submit exception with message

Loggers provide a method to submit an exception with a message like log.error(message, e). The client can surface such a method to easily work with this kind of situation when used as an appender for other logging frameworks

Update documentation

Remove the following snippet from the Show me the code section of the documentation

// Submit async events using submitXXXAsync methods
client.submitLogAsync("Test log");

We don't support async methods as events are processed asynchronously internally.

addData method in Event class should take configuration data inclusions into consideration

Right now we have this method signature to add data once an Event object is created

public void addData(Map<String, Object> data, Set<String> dataExclusions) {

It explicitly asks for data exclusions with the data and doesn't take the configuration default data exclusion into consideration

  • We should provide an override for this method which only uses configuration default data exclusions
  • We should be combining the provided data exclusions with configuration defaults.

Storage Feedback

The Java client was based on the javascript client (real world
Java client would probably would be closer to the .NET implementation) which has been going a major update / refactoring (https://github.com/exceptionless/exceptionless.javascript/tree/feature/workspaces).

One of the things we did was simplify storage greatly. We got rid of the storage providers and just have a simple storage implementation that reflects local storage apis (it's what makes sense in java but maybe not necessarily here in terms to the local storage api). This took some reworking of the queue to maintain storage but resulted in some really nice changes with tons of deletions. It didn't make sense to store items by timestamp and caused a lot of extra parsing of storage keys that wasn't needed. Here is the link to the new storage implementation https://github.com/exceptionless/Exceptionless.JavaScript/tree/feature/workspaces/packages/core/src/storage (here is the .NET one https://github.com/exceptionless/Exceptionless.Net/blob/master/src/Exceptionless/Storage/IObjectStorage.cs) Feel free to do what makes sense I just wanted to let you know why we changed.

We also simplified the Submission as well and got rid of the submission adaptors to a more simplified approach like what you did.

How can i and Exceptionless support to my java-web application

I have a java-web application(springboot) and it build with maven,now i want to and Exceptionless support but i can't find it on Maven Central.

I had download Exceptionless.Java code and run "mvn build" command but get false.

my jdk version is 1.8.0_241

so what can i do to this

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.