![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@locker/instrumentation
Advanced tools
The instrumentation package provides utility functions, also known as beacons, to facilitate instrumenting Locker vNext code without having to bind the entire codebase to an external interface.
There are 3 beacons provided, 1 for instrumenting errors, 1 for generic logging and 1 for metrics (activity).
import { LockerInstrumentation } from '@locker/instrumentation';
const { activityBeacon, errorBeacon, logBeacon } = new LockerInstrumentation();
The beacons can now be used to instrument code in Locker.
Due to possible restrictions on the instrumentation service, the high volume of method calls and privacy considerations in sandboxed code, Locker cannot instrument serialized method parameters or method return values. As a consequence, the beacons will invoke the instrumentation client using specific information.
const { activityBeacon } = new LockerInstrumentation(myService);
// instrumented activity is started for current sandboxKey
const myActivity = activityBeacon(sandboxKey, 'fooActivity');
myActivity.start();
// or use chaining
// const myActivity = activityBeacon(sandboxKey, 'fooActivity').start();
foo();
// we stop the activity after last instrumeted call
myActivity.stop();
const { logBeacon } = new LockerInstrumentation(myService);
const foo: Array = bar();
logBeacon(sandboxKey, `bar method returned ${foo.length} results.`);
const { errorBeacon } = new LockerInstrumentation(myService);
try {
foo();
} catch (e) {
errorBeacon(sandboxKey, e);
throw e;
}
To plug in an external service in Locker vNext the following steps are required:
class MyInstrumentation extends LockerInstrumentation {
activityBeacon(sandboxKey, nameOrDescription) {
return new Activity(sandboxKey, nameOrDescription, startCallback, stopCallback);
}
errorBeacon(sandboxKey, e) {
errorCallback(sandboxKey, e.message, e.type, e.stack);
}
logBeacon(sandboxKey, message) {
logCallback(sandboxKey, message);
}
}
evaluateInSandbox
or evaluateInCoreSandbox
and provide MyInstrumentation
as an argumentconst instrumentation = new MyInstrumentation();
evaluateInSandbox(key, code, null, null, instrumentation);
FAQs
Lightning Web Security instrumentation utilities
The npm package @locker/instrumentation receives a total of 305 weekly downloads. As such, @locker/instrumentation popularity was classified as not popular.
We found that @locker/instrumentation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.