Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@grafana/agent-web
Advanced tools
Grafana JavaScript Agent instrumentations, metas, transports for web.
DEPRECATED Project has been moved to @grafana/faro-web-sdk
Instrumentations, metas and transports for web applications.
Warning: currently pre-release and subject to frequent breaking changes. Use at your own risk.
console
global object. Only warn
, info
and error
levels by default.console
Basic set up, will automatically report errors and web vitals:
import { initializeGrafanaAgent } from '@grafana/agent-web';
const agent = initializeGrafanaAgent({
url: 'https://agent.myapp/collect',
apiKey: 'secret',
app: {
name: 'frontend',
version: '1.0.0',
},
});
// send a log message
agent.api.pushLog(['hello world']);
// will be captured
throw new Error('oh no');
// push error manually
agent.api.pushError(new Error('oh no'));
With OTel tracing and browser console capture:
import { TracingInstrumentation } from '@grafana/agent-tracing-web';
import { ConsoleInstrumentation, initializeGrafanaAgent, getWebInstrumentations } from '@grafana/agent-web';
const agent = initializeGrafanaAgent({
url: 'https://agent.myapp/collect',
apiKey: 'secret',
instrumentations: [...getWebInstrumentations({ captureConsole: true }), new TracingInstrumentation()],
app: {
name: 'frontend',
version: '1.0.0',
},
});
// start a span
agent.api
.getOTEL()
?.trace.getTracer('frontend')
.startActiveSpan('hello world', (span) => {
// send a log message
agent.api.pushLog(['hello world']);
span.end();
});
// will be captured
throw new Error('oh no');
FAQs
Grafana JavaScript Agent instrumentations, metas, transports for web.
The npm package @grafana/agent-web receives a total of 879 weekly downloads. As such, @grafana/agent-web popularity was classified as not popular.
We found that @grafana/agent-web demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 17 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.