Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@opentelemetry/opentelemetry-browser-detector
Advanced tools
OpenTelemetry Resource Detector for Browser
Note: This is an experimental package under active development. New releases may include breaking changes.
This module provides detector for browser environments
npm install --save @opentelemetry/opentelemetry-browser-detector
import { Resource, detectResources } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { browserDetector } from '@opentelemetry/opentelemetry-browser-detector';
async function start(){
let resource= new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'Test App Name',
});
let detectedResources= await detectResources({detectors:[browserDetector]});
resource=resource.merge(detectedResources);
const provider = new WebTracerProvider({
resource
});
provider.addSpanProcessor(new BatchSpanProcessor(new OTLPTraceExporter( {url:CONF.url ,headers:{}}),{exportTimeoutMillis:CONF.timeOutMillis,scheduledDelayMillis:CONF.delayMillis}));
provider.register({
// Changing default contextManager to use ZoneContextManager - supports asynchronous operations - optional
contextManager: new ZoneContextManager(),
});
// Registering instrumentations
registerInstrumentations({
instrumentations: [
new DocumentLoadInstrumentation(),
new XMLHttpRequestInstrumentation(),
new FetchInstrumentation(),
],
});
}
start().then(()=> console.log("Instrumentation started"));
The browser identification attributes will be added to the resource spans when traces are created. These attributes include platform, brands, mobile, language if the browser supports the userAgentData api, otherwise it will contain only the user_agent informations
FAQs
OpenTelemetry Resource Detector for Browser
The npm package @opentelemetry/opentelemetry-browser-detector receives a total of 21,194 weekly downloads. As such, @opentelemetry/opentelemetry-browser-detector popularity was classified as popular.
We found that @opentelemetry/opentelemetry-browser-detector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.