Skip to content

Commit

Permalink
Merge branch 'main' into add-post-query-attributes-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
rauno56 committed Jan 6, 2022
2 parents 07924d6 + 81b3190 commit f724864
Show file tree
Hide file tree
Showing 69 changed files with 495 additions and 303 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ jobs:
npx lerna bootstrap --no-ci
# Release Please has already incremented versions and published tags, so we just
# need to publish all unpublished versions to NPM here
# need to publish all unpublished versions to npm here
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
- name: Publish to NPM
- name: Publish to npm
if: ${{ steps.release.outputs.releases_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/test-all-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Test-all-versions
on:
pull_request:
branches: [main]

jobs:
tav:
# skip the workflow for now #816
if: false
name: run test-all-version (tav)
runs-on: ubuntu-latest
services:
memcached:
image: memcached:1.6.9-alpine
ports:
- 11211:11211
mongo:
image: mongo
ports:
- 27017:27017
mysql:
image: circleci/mysql:5.7
env:
MYSQL_USER: otel
MYSQL_PASSWORD: secret
MYSQL_DATABASE: circle_database
MYSQL_ROOT_PASSWORD: rootpw
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: circleci/postgres:9.6-alpine
env:
POSTGRES_USER: postgres
POSTGRES_DB: circle_database
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
cassandra:
image: bitnami/cassandra:3
ports:
- 9042:9042
env:
RUN_CASSANDRA_TESTS: 1
RUN_MEMCACHED_TESTS: 1
RUN_MONGODB_TESTS: 1
RUN_MYSQL_TESTS: 1
RUN_POSTGRES_TESTS: 1
RUN_REDIS_TESTS: 1
OPENTELEMETRY_MEMCACHED_HOST: memcached
OPENTELEMETRY_MEMCACHED_PORT: 11211
POSTGRES_USER: postgres
POSTGRES_DB: circle_database
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
OPENTELEMETRY_REDIS_HOST: redis
OPENTELEMETRY_REDIS_PORT: 6379
MONGODB_DB: opentelemetry-tests
MONGODB_HOST: 127.0.0.1
MONGODB_PORT: 27017
MYSQL_USER: otel
MYSQL_PASSWORD: secret
MYSQL_DATABASE: circle_database
MYSQL_HOST: mysql
MYSQL_PORT: 3306
NPM_CONFIG_UNSAFE_PERM: true
CASSANDRA_HOST: cassandra
CASSANDRA_PORT: 9042
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- run: npm install --ignore-scripts
- run: lerna bootstrap --since origin/main --include-dependencies
- run: lerna run compile --since origin/main --include-dependencies
- run: lerna run test-all-versions --since origin/main --stream --concurrency=1
46 changes: 23 additions & 23 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ jobs:
strategy:
fail-fast: false
matrix:
container: ["node:8", "node:10", "node:12", "node:14", "node:16"]
node: ["8", "10", "12", "14", "16"]
include:
- container: "node:8"
- node: "8"
lerna-extra-args: >-
--ignore @opentelemetry/instrumentation-aws-sdk
--ignore @opentelemetry/instrumentation-pino
- container: "node:10"
- node: "10"
lerna-extra-args: >-
--ignore @opentelemetry/instrumentation-pino
runs-on: ubuntu-latest
container:
image: ${{ matrix.container }}
services:
memcached:
image: memcached:1.6.9-alpine
Expand Down Expand Up @@ -76,28 +74,32 @@ jobs:
RUN_MYSQL_TESTS: 1
RUN_POSTGRES_TESTS: 1
RUN_REDIS_TESTS: 1
OPENTELEMETRY_MEMCACHED_HOST: memcached
OPENTELEMETRY_MEMCACHED_HOST: localhost
OPENTELEMETRY_MEMCACHED_PORT: 11211
POSTGRES_USER: postgres
POSTGRES_DB: circle_database
POSTGRES_HOST: postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
OPENTELEMETRY_REDIS_HOST: redis
OPENTELEMETRY_REDIS_HOST: localhost
OPENTELEMETRY_REDIS_PORT: 6379
MONGODB_DB: opentelemetry-tests
MONGODB_HOST: mongo
MONGODB_HOST: localhost
MONGODB_PORT: 27017
MYSQL_USER: otel
MYSQL_PASSWORD: secret
MYSQL_DATABASE: circle_database
MYSQL_HOST: mysql
MYSQL_HOST: localhost
MYSQL_PORT: 3306
NPM_CONFIG_UNSAFE_PERM: true
CASSANDRA_HOST: cassandra
CASSANDRA_PORT: 9042
CASSANDRA_HOST: localhost
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -110,22 +112,18 @@ jobs:
plugins/node/*/node_modules
plugins/web/*/node_modules
propagators/*/node_modules
key: ${{ runner.os }}-${{ matrix.container }}-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/package.json') }}
- name: Legacy Peer Dependencies for npm 7
if: matrix.container == 'node:16'
if: matrix.node == '16'
run: npm config set legacy-peer-deps=true
- name: Install Root Dependencies
run: npm install --ignore-scripts
- name: Fix npm cache permissions
run: |
chown -R 1001:121 "/github/home/.npm"
[ -e /__w/opentelemetry-js-contrib/opentelemetry-js-contrib/package-lock.json ] && chown 1001:121 /__w/opentelemetry-js-contrib/opentelemetry-js-contrib/package-lock.json
- name: Bootstrap Dependencies
run: npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --nohoist='mocha' --nohoist='ts-mocha'
- name: Unit tests
run: npm run test:ci:changed -- ${{ matrix.lerna-extra-args }}
- name: Report Coverage
if: matrix.container == 'node:14'
if: matrix.node == '14'
run: npm run codecov:ci:changed
browser-tests:
runs-on: ubuntu-latest
Expand All @@ -134,10 +132,12 @@ jobs:
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Permission Setup
run: sudo chmod -R 777 /github /__w
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -150,7 +150,7 @@ jobs:
plugins/node/*/node_modules
plugins/web/*/node_modules
propagators/*/node_modules
key: ${{ runner.os }}-node:12-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-browser-${{ hashFiles('**/package.json') }}
- name: Install Root Dependencies
run: npm install --ignore-scripts
- name: Bootstrap Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.26.1","detectors/node/opentelemetry-resource-detector-aws":"1.0.2","detectors/node/opentelemetry-resource-detector-gcp":"0.26.1","detectors/node/opentelemetry-resource-detector-github":"0.26.0","metapackages/auto-instrumentations-node":"0.27.1","metapackages/auto-instrumentations-web":"0.27.1","packages/opentelemetry-browser-extension-autoinjection":"0.27.1","packages/opentelemetry-host-metrics":"0.27.0","packages/opentelemetry-id-generator-aws-xray":"1.0.0","packages/opentelemetry-test-utils":"0.28.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.28.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.4.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.27.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.27.0","plugins/node/opentelemetry-instrumentation-connect":"0.27.0","plugins/node/opentelemetry-instrumentation-dns":"0.27.0","plugins/node/opentelemetry-instrumentation-express":"0.27.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.27.0","plugins/node/opentelemetry-instrumentation-graphql":"0.27.1","plugins/node/opentelemetry-instrumentation-hapi":"0.27.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.27.0","plugins/node/opentelemetry-instrumentation-knex":"0.27.0","plugins/node/opentelemetry-instrumentation-koa":"0.28.0","plugins/node/opentelemetry-instrumentation-memcached":"0.27.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.27.0","plugins/node/opentelemetry-instrumentation-mysql":"0.27.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.27.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.28.0","plugins/node/opentelemetry-instrumentation-net":"0.27.0","plugins/node/opentelemetry-instrumentation-pg":"0.27.0","plugins/node/opentelemetry-instrumentation-pino":"0.28.0","plugins/node/opentelemetry-instrumentation-redis":"0.27.0","plugins/node/opentelemetry-instrumentation-restify":"0.27.0","plugins/node/opentelemetry-instrumentation-router":"0.27.0","plugins/node/opentelemetry-instrumentation-winston":"0.27.0","plugins/web/opentelemetry-instrumentation-document-load":"0.27.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.28.0","plugins/web/opentelemetry-plugin-react-load":"0.26.0","propagators/opentelemetry-propagator-aws-xray":"1.0.0","propagators/opentelemetry-propagator-grpc-census-binary":"0.25.0","propagators/opentelemetry-propagator-ot-trace":"0.25.0"}
{"detectors/node/opentelemetry-resource-detector-alibaba-cloud":"0.26.1","detectors/node/opentelemetry-resource-detector-aws":"1.0.2","detectors/node/opentelemetry-resource-detector-gcp":"0.26.1","detectors/node/opentelemetry-resource-detector-github":"0.26.0","metapackages/auto-instrumentations-node":"0.27.1","metapackages/auto-instrumentations-web":"0.27.1","packages/opentelemetry-browser-extension-autoinjection":"0.27.1","packages/opentelemetry-host-metrics":"0.27.0","packages/opentelemetry-id-generator-aws-xray":"1.0.0","packages/opentelemetry-test-utils":"0.28.0","plugins/node/opentelemetry-instrumentation-aws-lambda":"0.28.0","plugins/node/opentelemetry-instrumentation-aws-sdk":"0.4.0","plugins/node/opentelemetry-instrumentation-bunyan":"0.27.0","plugins/node/opentelemetry-instrumentation-cassandra":"0.27.0","plugins/node/opentelemetry-instrumentation-connect":"0.27.0","plugins/node/opentelemetry-instrumentation-dns":"0.27.0","plugins/node/opentelemetry-instrumentation-express":"0.27.0","plugins/node/opentelemetry-instrumentation-generic-pool":"0.27.0","plugins/node/opentelemetry-instrumentation-graphql":"0.27.1","plugins/node/opentelemetry-instrumentation-hapi":"0.27.0","plugins/node/opentelemetry-instrumentation-ioredis":"0.27.0","plugins/node/opentelemetry-instrumentation-knex":"0.27.0","plugins/node/opentelemetry-instrumentation-koa":"0.28.0","plugins/node/opentelemetry-instrumentation-memcached":"0.27.0","plugins/node/opentelemetry-instrumentation-mongodb":"0.27.0","plugins/node/opentelemetry-instrumentation-mysql":"0.27.0","plugins/node/opentelemetry-instrumentation-mysql2":"0.27.0","plugins/node/opentelemetry-instrumentation-nestjs-core":"0.28.1","plugins/node/opentelemetry-instrumentation-net":"0.27.0","plugins/node/opentelemetry-instrumentation-pg":"0.27.0","plugins/node/opentelemetry-instrumentation-pino":"0.28.0","plugins/node/opentelemetry-instrumentation-redis":"0.27.0","plugins/node/opentelemetry-instrumentation-restify":"0.27.0","plugins/node/opentelemetry-instrumentation-router":"0.27.0","plugins/node/opentelemetry-instrumentation-winston":"0.27.0","plugins/web/opentelemetry-instrumentation-document-load":"0.27.0","plugins/web/opentelemetry-instrumentation-user-interaction":"0.28.0","plugins/web/opentelemetry-plugin-react-load":"0.26.0","propagators/opentelemetry-propagator-aws-xray":"1.0.0","propagators/opentelemetry-propagator-grpc-census-binary":"0.25.0","propagators/opentelemetry-propagator-ot-trace":"0.25.0"}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ This repo is generally meant for hosting components that work with popular open-

### Adding a New Vendor Component

Vendor components that are hosted in this repo will be versioned the same as all other contrib components, and released in lockstep with them under the `@opentelemetry` org in NPM.
Vendor components that are hosted in this repo will be versioned the same as all other contrib components, and released in lockstep with them under the `@opentelemetry` org in npm.

In exchange, vendor component contributors are expected to:

Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Releasing OpenTelemetry Packages (for Maintainers Only)

This repository uses [Release Please](https://github.com/googleapis/release-please) to manage its releases automatically and independently.
Modified packages are automatically published to NPM when the auto-generated Release Please PR is merged.
Modified packages are automatically published to npm when the auto-generated Release Please PR is merged.

## Manual Publishing Process

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"compile": "npm run version:update && tsc -p .",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"precompile": "tsc --version && lerna run version --scope @opentelemetry/resource-detector-alibaba-cloud --include-filtered-dependencies",
"precompile": "tsc --version && lerna run version --scope @opentelemetry/resource-detector-alibaba-cloud --include-dependencies",
"prewatch": "npm run precompile",
"prepare": "npm run compile",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"compile": "npm run version:update && tsc -p .",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"precompile": "tsc --version && lerna run version --scope @opentelemetry/resource-detector-aws --include-filtered-dependencies",
"precompile": "tsc --version && lerna run version --scope @opentelemetry/resource-detector-aws --include-dependencies",
"prewatch": "npm run precompile",
"prepare": "npm run compile",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
} from '@opentelemetry/resources';
import {
CloudProviderValues,
CloudPlatformValues,
SemanticResourceAttributes,
} from '@opentelemetry/semantic-conventions';

Expand All @@ -43,6 +44,9 @@ export class AwsLambdaDetector implements Detector {
[SemanticResourceAttributes.CLOUD_PROVIDER]: String(
CloudProviderValues.AWS
),
[SemanticResourceAttributes.CLOUD_PLATFORM]: String(
CloudPlatformValues.AWS_LAMBDA
),
};
if (region) {
attributes[SemanticResourceAttributes.CLOUD_REGION] = region;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"compile": "npm run version:update && tsc -p .",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"precompile": "tsc --version && lerna run version --scope @opentelemetry/resource-detector-gcp --include-filtered-dependencies",
"precompile": "tsc --version && lerna run version --scope @opentelemetry/resource-detector-gcp --include-dependencies",
"prewatch": "npm run precompile",
"prepare": "npm run compile",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ const CLUSTER_NAME_PATH = BASE_PATH + '/instance/attributes/cluster-name';
.get(INSTANCE_PATH)
.reply(200, {}, HEADERS)
.get(INSTANCE_ID_PATH)
.reply(200, () => 4520031799277581759, HEADERS)
// This number is too large to be safely represented by a JS number
// See https://github.com/googleapis/gcp-metadata/tree/fc2f0778138b36285643b2f716c485bf9614611f#take-care-with-large-number-valued-properties
.reply(200, () => '4520031799277581759', HEADERS)
.get(PROJECT_ID_PATH)
.reply(200, () => 'my-project-id', HEADERS)
.get(ZONE_PATH)
Expand All @@ -92,7 +94,7 @@ const CLUSTER_NAME_PATH = BASE_PATH + '/instance/attributes/cluster-name';
accountId: 'my-project-id',
zone: 'my-zone',
});
assertHostResource(resource, { id: '4520031799277582000' });
assertHostResource(resource, { id: '4520031799277581759' });
});

it('should populate K8s attributes when KUBERNETES_SERVICE_HOST is set', async () => {
Expand All @@ -104,7 +106,7 @@ const CLUSTER_NAME_PATH = BASE_PATH + '/instance/attributes/cluster-name';
.get(INSTANCE_PATH)
.reply(200, {}, HEADERS)
.get(INSTANCE_ID_PATH)
.reply(200, () => 4520031799277581759, HEADERS)
.reply(200, () => '4520031799277581759', HEADERS)
.get(CLUSTER_NAME_PATH)
.reply(200, () => 'my-cluster', HEADERS)
.get(PROJECT_ID_PATH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"compile": "npm run version:update && tsc -p .",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"precompile": "tsc --version && lerna run version --scope @opentelemetry/resource-detector-github --include-filtered-dependencies",
"precompile": "tsc --version && lerna run version --scope @opentelemetry/resource-detector-github --include-dependencies",
"prewatch": "npm run precompile",
"prepare": "npm run compile",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
Expand Down
4 changes: 2 additions & 2 deletions examples/react-load/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ npm run build
npm start
```

By default, the application runs on port 5000.
By default, the application runs on port 3000.

Open Zipkin page at <http://localhost:9411/zipkin/> - you should be able to see the spans in zipkin

Expand All @@ -39,7 +39,7 @@ Take note of the parent-child relationships.

### First load

Upon loading, <http://localhost:5000> mounting spans will be exported
Upon loading, <http://localhost:3000> mounting spans will be exported
<p align="center"><img src="./images/mounting.png?raw=true"/></p>
<p align="center"><img src="./images/zipkin-mounting.png?raw=true"/></p>

Expand Down
10 changes: 6 additions & 4 deletions examples/react-load/react/docker/collector-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
receivers:
otlp:
endpoint: 0.0.0.0:55678
protocols:
http:
endpoint: 0.0.0.0:55678
cors_allowed_origins: http://localhost:3000

exporters:
zipkin:
url: "http://zipkin-all-in-one:9411/api/v2/spans"
endpoint: "http://zipkin-all-in-one:9411/api/v2/spans"

processors:
batch:
queued_retry:

service:
pipelines:
traces:
receivers: [otlp]
exporters: [zipkin]
processors: [batch, queued_retry]
processors: [batch]
4 changes: 2 additions & 2 deletions examples/react-load/react/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ services:

# Collector
collector:
image: omnition/opentelemetry-collector-contrib:0.2.8
command: ["--config=/conf/collector-config.yaml", "--log-level=DEBUG"]
image: otel/opentelemetry-collector-contrib:0.40.0
command: ["--config=/conf/collector-config.yaml"]
volumes:
- ./collector-config.yaml:/conf/collector-config.yaml
ports:
Expand Down
4 changes: 3 additions & 1 deletion examples/react-load/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"ts-loader": "^6.0.4"
},
"dependencies": {
"@opentelemetry/api": "^1.0.4",
"@opentelemetry/context-zone": "^0.25.0",
"@opentelemetry/core": "^0.25.0",
"@opentelemetry/exporter-collector": "^0.25.0",
Expand All @@ -46,7 +47,8 @@
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.1",
"reactstrap": "^8.5.1"
"reactstrap": "^8.5.1",
"serve": "^13.0.2"
},
"browserslist": {
"production": [
Expand Down

0 comments on commit f724864

Please sign in to comment.