zipkin-transport-http: Provides its own types (#39577)

This commit is contained in:
Alexander T 2019-11-07 19:37:13 +02:00 committed by Nathan Shively-Sanders
parent dbd07f931e
commit d728ea97f1
7 changed files with 8 additions and 71 deletions

View File

@ -5178,6 +5178,12 @@
"sourceRepoURL": "https://github.com/zetapush/zetapush-js",
"asOfVersion": "3.1.2"
},
{
"libraryName": "zipkin-transport-http",
"typingsPackageName": "zipkin-transport-http",
"sourceRepoURL": "https://github.com/openzipkin/zipkin-js#readme",
"asOfVersion": "0.12.0"
},
{
"libraryName": "zipkin-instrumentation-express",
"typingsPackageName": "zipkin-instrumentation-express",

View File

@ -1,6 +1,7 @@
{
"private": true,
"dependencies": {
"zipkin": ">=0.11.0"
"zipkin": ">=0.11.0",
"zipkin-transport-http": "^0.12.0"
}
}

View File

@ -1,19 +0,0 @@
// Type definitions for zipkin-transport-http 0.11
// Project: https://github.com/openzipkin/zipkin-js#readme
// Definitions by: York Yao <https://github.com/plantain-00>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { JsonEncoder, Logger, model } from 'zipkin';
export interface Options {
endpoint: string;
jsonEncoder?: JsonEncoder;
httpInterval?: number;
headers?: { [name: string]: string };
}
export class HttpLogger implements Logger {
logSpan(span: model.Span): void;
constructor(options: Options)
}

View File

@ -1,6 +0,0 @@
{
"private": true,
"dependencies": {
"zipkin": ">=0.11.0"
}
}

View File

@ -1,24 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"zipkin-transport-http-tests.ts"
]
}

View File

@ -1 +0,0 @@
{ "extends": "dtslint/dt.json" }

View File

@ -1,20 +0,0 @@
import {
Tracer,
BatchRecorder,
jsonEncoder,
} from 'zipkin';
import CLSContext = require('zipkin-context-cls');
import { HttpLogger } from 'zipkin-transport-http';
// Setup the tracer to use http and implicit trace context
const tracer = new Tracer({
ctxImpl: new CLSContext('zipkin'),
recorder: new BatchRecorder({
logger: new HttpLogger({
endpoint: 'http://localhost:9411/api/v2/spans',
jsonEncoder: jsonEncoder.JSON_V2
})
}),
localServiceName: 'service-a'
});