
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
@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.consoleBasic 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.
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.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.