Skip to content

Commit

Permalink
feat(extension-tracing): add tracing extension for open tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondfeng committed Nov 4, 2019
1 parent 2c11c6d commit 602f7ed
Show file tree
Hide file tree
Showing 15 changed files with 618 additions and 0 deletions.
1 change: 1 addition & 0 deletions extensions/tracing/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=true
25 changes: 25 additions & 0 deletions extensions/tracing/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright (c) IBM Corp. 2019. All Rights Reserved.
Node module: @loopback/extension-tracing
This project is licensed under the MIT License, full text below.

--------

MIT license

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
52 changes: 52 additions & 0 deletions extensions/tracing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# @loopback/extension-tracing

This module contains a component to report tracing status using
[Jaeger Tracing](https://github.com/jaegertracing/jaeger-client-node).

## Stability: :warning:Experimental:warning:

> Experimental packages provide early access to advanced or experimental
> functionality to get community feedback. Such modules are published to npm
> using `0.x.y` versions. Their APIs and functionality may be subject to
> breaking changes in future releases.
## Installation

```sh
npm install --save @loopback/extension-tracing
```

## Basic use

The component should be loaded in the constructor of your custom Application
class.

Start by importing the component class:

```ts
import {TracingComponent} from '@loopback/extension-tracing';
```

In the constructor, add the component to your application:

```ts
this.component(TracingComponent);
```

## Contributions

- [Guidelines](https://github.com/strongloop/loopback-next/blob/master/docs/CONTRIBUTING.md)
- [Join the team](https://github.com/strongloop/loopback-next/issues/110)

## Tests

Run `npm test` from the root folder.

## Contributors

See
[all contributors](https://github.com/strongloop/loopback-next/graphs/contributors).

## License

MIT
6 changes: 6 additions & 0 deletions extensions/tracing/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright IBM Corp. 2019. All Rights Reserved.
// Node module: @loopback/extension-tracing
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

export * from './dist';
6 changes: 6 additions & 0 deletions extensions/tracing/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright IBM Corp. 2019. All Rights Reserved.
// Node module: @loopback/extension-tracing
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

module.exports = require('./dist');
8 changes: 8 additions & 0 deletions extensions/tracing/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright IBM Corp. 2019. All Rights Reserved.
// Node module: @loopback/extension-tracing
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

// DO NOT EDIT THIS FILE
// Add any additional (re)exports to src/index.ts instead.
export * from './src';
194 changes: 194 additions & 0 deletions extensions/tracing/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions extensions/tracing/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "@loopback/extension-tracing",
"version": "0.0.1",
"description": "LoopBack Distributed Tracing",
"engines": {
"node": ">=8.9"
},
"scripts": {
"build": "lb-tsc",
"clean": "lb-clean loopback-extension-tracing*.tgz dist tsconfig.build.tsbuildinfo package",
"pretest": "npm run build",
"test": "lb-mocha \"dist/__tests__/**/*.js\"",
"verify": "npm pack && tar xf loopback-extension-tracing*.tgz && tree package && npm run clean",
"demo": "./src/__examples__/demo.sh"
},
"author": "IBM Corp.",
"copyright.owner": "IBM Corp.",
"license": "MIT",
"dependencies": {
"@loopback/core": "^1.10.6",
"@loopback/rest": "^1.22.0",
"@types/jaeger-client": "^3.15.1",
"debug": "^4.1.1",
"jaeger-client": "^3.17.1",
"opentracing": "^0.14.4",
"p-event": "^4.1.0"
},
"devDependencies": {
"@loopback/build": "^2.0.15",
"@loopback/eslint-config": "^4.1.3",
"@loopback/testlab": "^1.9.3",
"@types/debug": "^4.1.5",
"@types/node": "^10.14.13"
},
"keywords": [
"LoopBack",
"Cloud Native",
"Tracing"
],
"files": [
"README.md",
"index.js",
"index.d.ts",
"dist",
"src",
"!*/__tests__"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/strongloop/loopback-next.git",
"directory": "extensions/tracing"
}
}
Loading

0 comments on commit 602f7ed

Please sign in to comment.