Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opencensus/instrumentation-http

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opencensus/instrumentation-http - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

7

build/src/http.d.ts

@@ -17,4 +17,3 @@ /// <reference types="node" />

*/
import { types } from '@opencensus/opencensus-core';
import { classes } from '@opencensus/opencensus-core';
import { BasePlugin, Func } from '@opencensus/core';
import * as httpModule from 'http';

@@ -24,3 +23,3 @@ export declare type HttpModule = typeof httpModule;

/** Http instrumentation plugin for Opencensus */
export declare class HttpPlugin extends classes.BasePlugin {
export declare class HttpPlugin extends BasePlugin {
/**

@@ -54,3 +53,3 @@ * Attributes Names according to Opencensus HTTP Specs

*/
protected getPatchOutgoingRequestFunction(): (original: types.Func<httpModule.ClientRequest>) => types.Func<httpModule.ClientRequest>;
protected getPatchOutgoingRequestFunction(): (original: Func<httpModule.ClientRequest>) => Func<httpModule.ClientRequest>;
/**

@@ -57,0 +56,0 @@ * Injects span's context to header for distributed tracing and finshes the

@@ -18,3 +18,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const opencensus_core_1 = require("@opencensus/opencensus-core");
const core_1 = require("@opencensus/core");
const semver = require("semver");

@@ -25,3 +25,3 @@ const shimmer = require("shimmer");

/** Http instrumentation plugin for Opencensus */
class HttpPlugin extends opencensus_core_1.classes.BasePlugin {
class HttpPlugin extends core_1.BasePlugin {
/** Constructs a new HttpPlugin instance. */

@@ -181,6 +181,5 @@ constructor(moduleName) {

plugin.logger.debug('makeRequestTrace');
const headers = options.headers;
const setter = {
setHeader(name, value) {
headers[name] = value;
request.setHeader(name, value);
}

@@ -202,2 +201,3 @@ };

const method = response.method ? response.method : 'GET';
const headers = options.headers;
const userAgent = headers ? (headers['user-agent'] || headers['User-Agent']) : null;

@@ -224,2 +224,8 @@ span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_HOST, options.hostname);

});
request.on('error', error => {
span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_ERROR_NAME, error.name);
span.addAttribute(HttpPlugin.ATTRIBUTE_HTTP_ERROR_MESSAGE, error.message);
span.status = TraceStatusCodes.UNKNOWN;
span.end();
});
plugin.logger.debug('makeRequestTrace retun request');

@@ -226,0 +232,0 @@ return request;

{
"name": "@opencensus/instrumentation-http",
"version": "0.0.2",
"version": "0.0.3",
"description": "Opencensus http automatic instrumentation package.",

@@ -58,3 +58,3 @@ "main": "build/src/index.js",

"dependencies": {
"@opencensus/opencensus-core": "^0.0.2",
"@opencensus/core": "^0.0.3",
"end-of-stream": "^1.4.1",

@@ -61,0 +61,0 @@ "semver": "^5.5.0",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc