Skip to content

Commit

Permalink
fix: added support for Opentelemetry 0.18 (#1234)
Browse files Browse the repository at this point in the history
* fix: added support for Opentelemetry 0.18

Introduces support for Opentelemetry 0.18 API which implements the
Tracing 1.0 specification.

* style: remove unused import declaration

* refactor: removed the `OpenTelemetryTracer`-class and just expose createSpan as function

* test: updated the span related tests

* test: updated the tests

* test: updated the tests

* refactor: move the tracer out of the `createSpan`-function

Small refactor to ensure no new tracer gets created for each call to the
`createSpan`-functio by initiating the `libraryTracer`-variable

* fix: get the unit test for publisher opentelemetry working again

* test: fix the subscriber unit tests for opentelemetry

* chore: remove describe.only

* chore: latest changes

* test: updated the tests

* test: improve the tests

* chore: maybe its need to be Google LLC?

* feat: add messaging attributes to otel spans

* fix: include package.json version as instrumentation version

* docs: update the opentelemetry example code

* style: remove unused code

* fix: remove peer name for now

* style: improve explanation regarding otel trace provider

* chore: update the opentelemetry versios in the samples `package.json`

* test: remove extranous logging in the opentelemetry example app

* test: remove the check for `traceId` that doesn't get outputted

* fix: remove unnecessary messaging span attribute and added comments

* style: use shiny new syntax for undefined check in `subscriber`-class

* fix: match the span name with the operation kind in `subscriber`-class

* chore: improved code based on PR feedback

* fix:

BREAKING CHANGE:
The Opentelemetry tracing span doesn't expose the `data`-attribute anymore
to avoid accidentally exposing privacy/personal data

* fix: only include `googclient_OpenTelemetrySpanContext`-attribute
when valid span context exists

* fix: change the way `package.json` is being imported

* fix: revert bad merge that removed tracing on devDependencies

At least I think that's what happened...

* style: remove unnecessary  comment

* style: remove unused imports

* build: downgrade @sinonjs/fake-timers to v6

The v10 of sinonjs comes with v7 of fake-timers which comes with
typescript type definitions that are generated by jsdoc comments which
seems to cause trouble when compiling the app it.

Downgrading to v6 to avoid needing to solve this problem now.

* style: cleanup type definition

Removed the `| undefined` for the `span` in the `Publisher`-class

Co-authored-by: Aaron Abbott <aaronabbott@google.com>

* build: remove `package.json` after compilation step

* build: put back package.json in the build

* build: explicitly add package.json to the npm pack build

* fix: revert "fix: change the way `package.json` is being imported"

This reverts commit 0c2c76f.

* fix: revert "build: explicitly add package.json to the npm pack build"

This reverts commit 14de625.

Co-authored-by: Weyert de Boer <weyert.deboer@tapico.io>
Co-authored-by: Megan Potter <57276408+feywind@users.noreply.github.com>
Co-authored-by: Megan Potter <mzp@google.com>
Co-authored-by: Aaron Abbott <aaronabbott@google.com>
  • Loading branch information
5 people committed Apr 14, 2021
1 parent e85b34c commit aedc36c
Show file tree
Hide file tree
Showing 14 changed files with 1,328 additions and 176 deletions.
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -53,8 +53,8 @@
"@google-cloud/precise-date": "^2.0.0",
"@google-cloud/projectify": "^2.0.0",
"@google-cloud/promisify": "^2.0.0",
"@opentelemetry/api": "^0.12.0",
"@opentelemetry/tracing": "^0.12.0",
"@opentelemetry/api": "^0.18.1",
"@opentelemetry/semantic-conventions": "^0.18.2",
"@types/duplexify": "^3.6.0",
"@types/long": "^4.0.0",
"arrify": "^2.0.0",
Expand All @@ -69,6 +69,7 @@
"@grpc/proto-loader": "^0.6.0",
"@microsoft/api-documenter": "^7.8.10",
"@microsoft/api-extractor": "^7.8.10",
"@opentelemetry/tracing": "^0.18.0",
"@types/execa": "^0.9.0",
"@types/extend": "^3.0.0",
"@types/lodash.snakecase": "^4.1.6",
Expand All @@ -77,7 +78,7 @@
"@types/ncp": "^2.0.1",
"@types/node": "^12.12.30",
"@types/proxyquire": "^1.3.28",
"@types/sinon": "^9.0.0",
"@types/sinon": "^9.0.11",
"@types/tmp": "^0.2.0",
"@types/uuid": "^8.0.0",
"c8": "^7.0.0",
Expand Down
249 changes: 249 additions & 0 deletions protos/protos.d.ts

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

0 comments on commit aedc36c

Please sign in to comment.