Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@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 834 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.