Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@iobroker/plugin-sentry
Advanced tools
Facilitates the integration of the Sentry error tracking and monitoring service into the js-controller and adapters, allowing developers to monitor and track any errors occurring within ioBroker setups.
By configuring Sentry.io, developers can receive real-time notifications and detailed reports of errors or exceptions in ioBroker systems, helping to identify and resolve issues promptly and ensuring the stability and reliability of home automation setups.
The integration with our Sentry server enables users to gather valuable information about the errors, including the stack trace, affected devices, and other relevant data. This information helps analyze and debug the problems effectively, leading to improved performance and stability of the ioBroker system.
Providing consent to iobroker GmbH to collect diagnostic data, results in the inclusion of an anonymous installation ID without any additional information about you, such as email or name, is included. This enables Sentry to group errors and gains insight into the number of unique users affected by a particular error. It's important to note that no IP addresses are present within crash reports, with all data deleted within 90 days at the latest.
All of these helps developers to provide an error-free smart home system that never crashes. :-)
If you wish to deactivate the error reporting feature, you have a couple of options:
Use the ioBroker CLI commands:
iobroker plugin disable sentry
.iobroker plugin disable sentry --instance adaptername.nr
Adjust the corresponding state values:
Upon making these changes, you should see a log message confirming the disabling of Sentry.
Note: Once the plugin is disabled, the automatic reporting of system crashes will cease. If you still want to report any issues, you must do so manually.
The minimal configuration required for inclusion in the common section of io-package.json is as follows:
"plugins": {
"sentry": {
"dsn": "https://...@.../..."
}
}
Two additional optional configuration options that can be also provided if required:
"plugins": {
"sentry": {
"dsn": "https://...@.../...",
"pathWhitelist": ["@iobroker", "iobroker.js-controller"],
"pathBlacklist": ["scripts.js"],
"errorBlacklist": ["SyntaxError"]
}
}
The configuration includes the following settings:
dsn (Required): This is the Sentry DSN, obtained after creating the Sentry project.
pathWhitelist (Optional): An array of strings that specify the required path components for reporting. Only sends exceptions with filenames containing at least one of these strings.
pathBlacklist (Optional): An array of strings used to check against each exception's lines. The exception will not send if any line contains one of these strings.
errorBlacklist (Optional): An array of error types that will not be reported. Automatically adds the "SyntaxError" type since these errors are typically caught during development and not in production with real customers.
Define configurations in either the "common" area of the io-package.json file or in iobroker.data/iobroker.json at the main level, specifically for the js-controller.
To obtain a Sentry account as a developer, you have a couple of options:
Sentry.io: You can sign up for a free account on Sentry.io, which offers up to 5,000 monthly events at no cost. With this option, you have complete control over your account, but it's important to note that the service is hosted in the USA.
Contact @Apollon77: Another option is to reach out to @Apollon77 to discuss the possibility of getting an account on the ioBroker own Sentry Server instance. However, please be aware that this option may be subject to limitations based on available server resources, so it cannot be guaranteed.
The basic process to use the ioBroker Sentry system is as follows:
**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and instructions on disabling error reporting, please refer to the [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Use of Sentry reporting starts with js-controller 3.0.
Please follow these steps for smooth integration with the ioBroker Sentry system.
This plugin respects the "enabled" state created by system.adapter.name.X.plugins.sentry.enabled and will not initialize the error reporting if set to false.
Will not create additional states.
To catch uncaught exceptions and unhandled promises, add the configuration above to the common section of your io-package.json file. Once you have done that, you're all set. Automatic use of the plugin will occur when js-controller 3.0 is in use.
If you want to send current errors or errors you have already caught in your code to Sentry, you can use the following code in your adapter implementation. In the example, "error" refers to the Error object containing the error.
try {
...
throw new Error('...');
} catch(error) {
if (adapter.supportsFeature && adapter.supportsFeature('PLUGINS')) {
const sentryInstance = adapter.getPluginInstance('sentry');
if (sentryInstance) {
sentryInstance.getSentryObject().captureException(error);
}
}
}
You can also use other Sentry APIs offered by the JavaScript Sentry SDK to send additional events.
if (adapter.supportsFeature && adapter.supportsFeature('PLUGINS')) {
const sentryInstance = adapter.getPluginInstance('sentry');
if (sentryInstance) {
const Sentry = sentryInstance.getSentryObject();
Sentry && Sentry.withScope(scope => {
scope.setLevel('info');
scope.setExtra('key', 'value');
Sentry.captureMessage('Event name', 'info'); // Level "info"
});
}
}
The easiest way is to add an invalid call to your code, e.g.,
huhu();
or
setTimeout(huhu, 10000);
This should cause the adapter to crash and the exception to be shown in the sentry UI some seconds/minutes later
Breaking Changes: Due to the port to Plugin Base v2, init
now returns a promise instead of accepting a callback parameter, also the export has changed to a named export
FAQs
Sentry module for plugins for js-controller and adapters
The npm package @iobroker/plugin-sentry receives a total of 6,785 weekly downloads. As such, @iobroker/plugin-sentry popularity was classified as popular.
We found that @iobroker/plugin-sentry demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.