Skip to content

Commit

Permalink
fix: lint markdown files
Browse files Browse the repository at this point in the history
Signed-off-by: Naseem <[email protected]>
  • Loading branch information
Naseem committed Jun 7, 2020
1 parent d909bf1 commit aa33b57
Show file tree
Hide file tree
Showing 41 changed files with 316 additions and 153 deletions.
89 changes: 72 additions & 17 deletions CHANGELOG.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ The Conventional Commits specification is a lightweight convention on top of com
We use [commitlint](https://github.com/conventional-changelog/commitlint) and [husky](https://github.com/typicode/husky) to prevent bad commit message.
For example, you want to submit the following commit message `git commit -s -am "my bad commit"`.
You will receive the following error :

```
✖ type must be one of [ci, feat, fix, docs, style, refactor, perf, test, revert, chore] [type-enum]
```

Here an exemple that will pass the verification: `git commit -s -am "chore(opentelemetry-core): update deps"`

### Fork

In the interest of keeping this repository clean and manageable, you should work from a fork. To create a fork, click the 'Fork' button at the top of the repository, then clone the fork locally using `git clone [email protected]:USERNAME/opentelemetry-js.git`.

You should also add this repository as an "upstream" repo to your local copy, in order to keep it up to date. You can add this as a remote like so:

```
git remote add upstream https://github.com/open-telemetry/opentelemetry-js.git
Expand All @@ -43,6 +46,7 @@ git remote -v
```

To update your fork, fetch the upstream repo's branches and commits, then merge your master with upstream's master:

```
git fetch upstream
git checkout master
Expand Down Expand Up @@ -90,12 +94,15 @@ The `opentelemetry-js` project is written in TypeScript.
- New or changed functionality is documented.

### Generating API documentation

- `npm run docs` to generate API documentation. Generates the documentation in `packages/opentelemetry-api/docs/out`

### Generating CHANGELOG documentation

- `npm run changelog` to generate CHANGELOG documentation in your terminal (see [RELEASING.md](RELEASING.md) for more details).

### Benchmarks

When two or more approaches must be compared, please write a benchmark in the benchmark/index.js module so that we can keep track of the most efficient algorithm.

- `npm run bench` to run your benchmark.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
---

## About this project

This is the JavaScript version of [OpenTelemetry](https://opentelemetry.io/), a framework for collecting traces and metrics from applications.

## Quick start
Expand Down Expand Up @@ -144,7 +145,7 @@ Maintainers ([@open-telemetry/js-maintainers](https://github.com/orgs/open-telem

*Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#maintainer).*

### Thanks to all the people who already contributed!
### Thanks to all the people who already contributed

<a href="https://github.com/open-telemetry/opentelemetry-js/graphs/contributors">
<img src="https://contributors-img.web.app/image?repo=open-telemetry/opentelemetry-js" />
Expand Down Expand Up @@ -188,7 +189,7 @@ OpenTelemetry can collect tracing data automatically using plugins. Vendors/User

##### Contrib

These plugins are hosted at https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node
These plugins are hosted at <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node>

- [@opentelemetry/plugin-mongodb][otel-contrib-plugin-mongodb]
- [@opentelemetry/plugin-mysql][otel-contrib-plugin-mysql]
Expand All @@ -207,7 +208,7 @@ These plugins are hosted at https://github.com/open-telemetry/opentelemetry-js-c

##### Contrib

These plugins are hosted at https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/web
These plugins are hosted at <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/web>

- [@opentelemetry/plugin-document-load][otel-contrib-plugin-document-load]
- [@opentelemetry/plugin-user-interaction][otel-contrib-plugin-user-interaction]
Expand Down
7 changes: 6 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ Decide on the next `major.minor.patch` release number based on [semver](http://s
Since we use `lerna`, we can use [lerna-changelog](https://github.com/lerna/lerna-changelog#lerna-changelog)

#### How to use

Pass your [github token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) to generate the changelog automatically.
For security reasons, when you create a Github token, select the permissions: under **repo**, select **Access public repositories**, **commit status**.

In your terminal, execute the following command:

```bash
GITHUB_AUTH=<your token> lerna-changelog
```

It will print something like:

```md
Expand All @@ -59,9 +62,11 @@ It will print something like:
- Helpful Hacker ([@helpful-hacker](https://github.com/helpful-hacker))
- [@careful-coder](https://github.com/careful-coder)
```

By default lerna-changelog will show all pull requests that have been merged since the latest tagged commit in the repository. That is however only true for pull requests **with certain labels applied** (see [lerna.json](lerna.json) for authorized labels).

You can also use the `--from` and `--to` options to view a different range of pull requests:

```
GITHUB_AUTH=xxxxx lerna-changelog --from=v1.0.0 --to=v2.0.0
```
Expand Down Expand Up @@ -97,6 +102,7 @@ done
Check your e-mail and make sure the number of “you’ve published this module” emails matches the number you expect.

## Publish the GitHub Release

Publish the GitHub release, ensuring that the tag points to the newly landed commit corresponding to release proposal `x.y.z`.

## Update CHANGELOG
Expand All @@ -105,7 +111,6 @@ Publish the GitHub release, ensuring that the tag points to the newly landed com
* Create a new commit with the exact title: `Post Release: update CHANGELOG.md`.
* Go through PR review and merge it to GitHub master branch.


## Known Issues

* The `examples/` and `getting-started/` folders are not part of lerna packages, we need to manually bump the version in `package.json`.
3 changes: 2 additions & 1 deletion benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
## How to run

To run your benchmark, just:

```sh
$ npm run bench
npm run bench
```

The minimum sample size is set to 10 to perform statistical analysis on benchmark, you can re-configure that in `benchmark.js`.
Expand Down
4 changes: 3 additions & 1 deletion doc/batcher-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Sometimes you may want to use a specific aggregator for one of your metric, export an average of the last X values instead of just the last one.

Here is what an aggregator that does that would look like:

```ts
import { Aggregator } from '@opentelemetry/metrics';
import { hrTime } from '@opentelemetry/core';
Expand Down Expand Up @@ -43,6 +44,7 @@ export class AverageAggregator implements Aggregator {
Now we will need to implement our own batcher to configure the sdk to use our new aggregator. To simplify even more, we will just extend the `UngroupedBatcher` (which is the default) to avoid re-implementing the whole `Aggregator` interface.

Here the result:

```ts
import {
UngroupedBatcher,
Expand Down Expand Up @@ -140,4 +142,4 @@ const requestsLatency = meter.createMeasure('requests', {
monotonic: true,
description: 'Average latency'
});
```
```
29 changes: 16 additions & 13 deletions doc/development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ manager such as [nvm](https://github.com/creationix/nvm) is recommended.
To get started once you have Node installed, run:

```sh
$ npm install
npm install
```

This will install all the necessary modules.
Expand All @@ -24,13 +24,13 @@ This will install all the necessary modules.
To run the all unit tests, use:

```sh
$ npm run test
npm run test
```

To run the unit tests continuously in watch mode while developing, use:

```sh
$ npm run tdd
npm run tdd
```

### Linting
Expand All @@ -40,39 +40,42 @@ We use [gts](https://www.npmjs.com/package/gts) to make sure that new code is co
Before raising a pull request, make sure there are no lint problems.

To check the linter, use:

```sh
$ npm run lint
npm run lint
```

To fix the linter, use:

```sh
$ npm run lint:fix
npm run lint:fix
```

### Continuous Integration

We rely on CircleCI 2.0 for our tests. If you want to test how the CI behaves
locally, you can use the CircleCI Command Line Interface as described here:
https://circleci.com/docs/2.0/local-jobs/
<https://circleci.com/docs/2.0/local-jobs/>

After installing the `circleci` CLI, simply run one of the following:

```sh
$ circleci build --job lint
$ circleci build --job node8
$ circleci build --job node10
$ circleci build --job node11
$ circleci build --job node12
$ circleci build --job node12-browsers
circleci build --job lint
circleci build --job node8
circleci build --job node10
circleci build --job node11
circleci build --job node12
circleci build --job node12-browsers
```

### Docs

We use [typedoc](https://www.npmjs.com/package/typedoc) to generate the api documentation.

To generate the docs, use:

```sh
$ npm run docs
npm run docs
```

The document will be available under `packages/opentelemetry-api/docs/out` path.
5 changes: 3 additions & 2 deletions doc/plugin-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ Each plugin must extend the abstract class [BasePlugin][base-plugin] implementin
- `unpatch`: A function describing how the module exports for a given file should be unpatched. This should generally mirror the logic in `patch`; for example, if `patch` wraps a method, `unpatch` should unwrap it.

The core `PluginLoader` class is responsible for loading the instrumented plugins that use a patch mechanism to enable automatic tracing for specific target modules. In order to load new plugin, it should export `plugin` identifier.

```typescript
export const plugin = new HttpPlugin(...);
```

> Example of simple module plugin created and used in the tests.
https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-node/test/instrumentation/node_modules/%40opentelemetry/plugin-simple-module/simple-module.js
<https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-node/test/instrumentation/node_modules/%40opentelemetry/plugin-simple-module/simple-module.js>
After the plugin is created, it must be added in the [list of default supported plugins][DEFAULT_INSTRUMENTATION_PLUGINS].

```typescript
export const DEFAULT_INSTRUMENTATION_PLUGINS: Plugins = {
http: {
Expand All @@ -42,7 +44,6 @@ We recommend using [`shimmer`][shimmer] to modify function properties on objects

Please refer to the [HTTP instrumentation][http-plugin] or [gRPC instrumentation][grpc-plugin] for more comprehensive examples.


[shimmer]: https://github.com/othiym23/shimmer
[builtin-plugins]: https://github.com/open-telemetry/opentelemetry-js#plugins
[base-plugin]: https://github.com/open-telemetry/opentelemetry-js/blob/master/packages/opentelemetry-core/src/trace/instrumentation/BasePlugin.ts#L29
Expand Down
10 changes: 5 additions & 5 deletions examples/basic-tracer-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@ Our example will export spans data simultaneously on `Console` and [Jaeger](http
## Installation

```sh
$ # from this directory
$ npm install
# from this directory
npm install
```

(Optional) Setup [Jaeger Tracing](https://www.jaegertracing.io/docs/latest/getting-started/#all-in-one): needs to be running on `localhost` port `16686`.


## Run the Application

```sh
$ # from this directory
$ npm start
# from this directory
npm start
```

#### Jaeger UI
Expand All @@ -34,6 +33,7 @@ Click on the trace to view its details.
<p align="center"><img src="./images/jaeger-ui-detail.png?raw=true"/></p>

## Useful links

- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more information on tracing, visit: <https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-tracing>

Expand Down
19 changes: 10 additions & 9 deletions examples/collector-exporter-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,34 @@ This example shows how to use [@opentelemetry/exporter-collector](https://github

This example will export spans data simultaneously using [Exporter Collector](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-exporter-collector) and grpc. It will use [proto format](https://github.com/open-telemetry/opentelemetry-proto).


## Installation

```shell script
$ # from this directory
$ npm install
# from this directory
npm install
```

## Run the Application

1. Run docker

```shell script
$ # from this directory
$ npm run docker:start
# from this directory
npm run docker:start
```

2. Run app

```shell script
$ # from this directory
$ npm start
# from this directory
npm start
```

3. Open page at http://localhost:9411/zipkin/ - you should be able to see the spans in zipkin
3. Open page at <http://localhost:9411/zipkin/> - you should be able to see the spans in zipkin
![Screenshot of the running example](images/spans.png)


## Useful links

- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more information on tracing, visit: <https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-tracing>

Expand Down
Loading

0 comments on commit aa33b57

Please sign in to comment.