Socket
Socket
Sign inDemoInstall

@hypertrace/nodejsagent

Package Overview
Dependencies
147
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.8.1-dev to 1.8.2

2

lib/HypertraceAgent.d.ts
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
import { SpanExporter } from '@opentelemetry/sdk-trace-base';
import { Config } from './config/config';
import { ChannelCredentials } from "@grpc/grpc-js";
export declare const hypertraceDomain: any;

@@ -17,2 +18,3 @@ export declare class HypertraceAgent {

protected createExporter(traceReporterType: string): SpanExporter;
getGrpcCredentials(): ChannelCredentials;
}

@@ -174,5 +174,3 @@ "use strict";

Logging_1.logger.info(`Creating OTLP exporter reporting to: ${this.config.config.reporting.endpoint}`);
const credentials = this.config.config.reporting.cert_file.length > 0
? grpc.credentials.createSsl(fs.readFileSync(this.config.config.reporting.cert_file))
: grpc.credentials.createInsecure();
const credentials = this.getGrpcCredentials();
return new exporter_trace_otlp_grpc_1.OTLPTraceExporter({

@@ -184,3 +182,18 @@ url: this.config.config.reporting.endpoint,

}
getGrpcCredentials() {
if (this.config.config.reporting.cert_file.length > 0) {
try {
const certFileContent = fs.readFileSync(this.config.config.reporting.cert_file);
return grpc.credentials.createSsl(certFileContent);
}
catch (error) {
Logging_1.logger.error('Error reading TLS certificate file:', error);
return grpc.credentials.createInsecure();
}
}
else {
return grpc.credentials.createInsecure();
}
}
}
exports.HypertraceAgent = HypertraceAgent;

3

lib/instrumentation/HttpInstrumentationWrapper.js

@@ -182,2 +182,3 @@ "use strict";

if (eventName === 'data') {
bodyCapture.appendData(args[0]);
chunks.push(Buffer.from(args[0]));

@@ -187,3 +188,3 @@ }

const bodyBuffer = Buffer.concat(chunks);
let bodyString = bodyBuffer.toString('utf-8');
let bodyString = bodyCapture.dataString();
span.setAttribute("http.response.body", bodyString);

@@ -190,0 +191,0 @@ // @ts-ignore

{
"name": "@hypertrace/nodejsagent",
"version": "1.8.1-dev",
"version": "1.8.2",
"description": "Hypertrace Node.js Agent",

@@ -5,0 +5,0 @@ "author": "Traceable Inc.",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc