@opencensus/instrumentation-http2
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -0,1 +1,16 @@ | ||
/** | ||
* Copyright 2018, OpenCensus Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
/// <reference types="node" /> | ||
@@ -17,9 +32,9 @@ import { HttpPlugin } from '@opencensus/instrumentation-http'; | ||
protected applyUnpatch(): void; | ||
private getPatchConnectFunction(); | ||
private getPatchRequestFunction(); | ||
private getMakeHttp2RequestTraceFunction(request, headers, authority, plugin); | ||
private getPatchCreateServerFunction(); | ||
private getPatchEmitFunction(); | ||
private getPatchConnectFunction; | ||
private getPatchRequestFunction; | ||
private getMakeHttp2RequestTraceFunction; | ||
private getPatchCreateServerFunction; | ||
private getPatchEmitFunction; | ||
} | ||
declare const plugin: Http2Plugin; | ||
export { plugin }; |
@@ -18,2 +18,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const core_1 = require("@opencensus/core"); | ||
const instrumentation_http_1 = require("@opencensus/instrumentation-http"); | ||
@@ -69,3 +70,3 @@ const shimmer = require("shimmer"); | ||
name: `${headers[':method'] || 'GET'} ${headers[':path']}`, | ||
kind: 'CLIENT', | ||
kind: core_1.SpanKind.CLIENT, | ||
}; | ||
@@ -101,4 +102,3 @@ // Checks if this outgoing request is part of an operation by checking | ||
span.addAttribute(Http2Plugin.ATTRIBUTE_HTTP_STATUS_CODE, `${responseHeaders[':status']}`); | ||
span.status = | ||
Http2Plugin.convertTraceStatus(+responseHeaders[':status']); | ||
span.setStatus(Http2Plugin.parseResponseStatus(+responseHeaders[':status'])); | ||
}); | ||
@@ -114,3 +114,3 @@ request.on('end', () => { | ||
} | ||
span.addMessageEvent('MessageEventTypeSent', uuid.v4().split('-').join('')); | ||
span.addMessageEvent(core_1.MessageEventType.SENT, uuid.v4().split('-').join('')); | ||
span.end(); | ||
@@ -153,3 +153,3 @@ }); | ||
name: headers[':path'], | ||
kind: 'SERVER', | ||
kind: core_1.SpanKind.SERVER, | ||
spanContext: propagation ? propagation.extract(getter) : null | ||
@@ -184,4 +184,4 @@ }; | ||
rootSpan.addAttribute(Http2Plugin.ATTRIBUTE_HTTP_STATUS_CODE, `${statusCode}`); | ||
rootSpan.status = Http2Plugin.convertTraceStatus(statusCode); | ||
rootSpan.addMessageEvent('MessageEventTypeRecv', uuid.v4().split('-').join('')); | ||
rootSpan.setStatus(Http2Plugin.parseResponseStatus(statusCode)); | ||
rootSpan.addMessageEvent(core_1.MessageEventType.RECEIVED, uuid.v4().split('-').join('')); | ||
rootSpan.end(); | ||
@@ -188,0 +188,0 @@ return returned; |
{ | ||
"name": "@opencensus/instrumentation-http2", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Opencensus http2 automatic instrumentation package.", | ||
@@ -9,3 +9,4 @@ "main": "build/src/index.js", | ||
"scripts": { | ||
"test": "nyc -x '**/test/**' --reporter=html --reporter=text mocha 'build/test/**/*.js'", | ||
"test": "nyc mocha build/test/**/*.js", | ||
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json", | ||
"clean": "rimraf build/*", | ||
@@ -49,14 +50,15 @@ "check": "gts check", | ||
"@types/uuid": "^3.4.3", | ||
"codecov": "^3.1.0", | ||
"gts": "^0.9.0", | ||
"mocha": "^5.0.4", | ||
"ncp": "^2.0.0", | ||
"nock": "^9.2.6", | ||
"nyc": "^11.7.1", | ||
"nock": "^10.0.0", | ||
"nyc": "^13.0.0", | ||
"rimraf": "^2.6.2", | ||
"ts-node": "^7.0.1", | ||
"typescript": "~2.6.1" | ||
"typescript": "~2.9.0" | ||
}, | ||
"dependencies": { | ||
"@opencensus/core": "^0.0.8", | ||
"@opencensus/instrumentation-http": "^0.0.8", | ||
"@opencensus/core": "^0.0.9", | ||
"@opencensus/instrumentation-http": "^0.0.9", | ||
"semver": "^5.5.0", | ||
@@ -63,0 +65,0 @@ "shimmer": "^1.2.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
26210
268
0
16
+ Added@opencensus/core@0.0.9(transitive)
+ Added@opencensus/instrumentation-http@0.0.9(transitive)
- Removed@opencensus/core@0.0.8(transitive)
- Removed@opencensus/instrumentation-http@0.0.8(transitive)
Updated@opencensus/core@^0.0.9