Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telemetry final changes #4798

Merged
merged 26 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
02e036b
remove outdated filebeat config & Dockerfile
zeeshanakram3 Jun 1, 2023
cca088b
add @opentelemetry/ dependencies & instrumentation
zeeshanakram3 Jun 1, 2023
b3c9a43
added otlp.endpoint & otlp.attributes configuration options
zeeshanakram3 Jun 2, 2023
257e492
add docker-compose.elasticsearch.yml & start-elasticsearch-stack.sh
zeeshanakram3 Jun 2, 2023
967060a
update distributor-node/docker-compose.yml
zeeshanakram3 Jun 2, 2023
8c0494e
fix lint
zeeshanakram3 Jun 2, 2023
19301d4
Merge remote-tracking branch 'upstream/master' into origo_opentelemet…
zeeshanakram3 Jun 13, 2023
55765b0
generate config docs
zeeshanakram3 Jun 13, 2023
a0515b9
update Argus CHANGELOG
zeeshanakram3 Jun 13, 2023
b619040
remove otel configuration from distributor-node package
zeeshanakram3 Jul 10, 2023
b4855dc
add generalized @joystream/opentelemetry package
zeeshanakram3 Jul 10, 2023
4f5d034
add otel instrumentation for query node
zeeshanakram3 Jul 10, 2023
8d4eb8c
add otel instrumentation for storage node
zeeshanakram3 Jul 10, 2023
08ed70d
WIP: a0515b9492 update Argus CHANGELOG
zeeshanakram3 Jul 10, 2023
a4e7154
run docker services wit otel tracing
zeeshanakram3 Jul 10, 2023
c964667
fix: loading otel env vars
zeeshanakram3 Jul 10, 2023
fabd8bb
fix: query node build script
zeeshanakram3 Jul 10, 2023
c5f2699
otel: remove span names from diretibutor/storage-node instrumentations
zeeshanakram3 Jul 12, 2023
d3a473f
install @joystream/opentelemetry inside docker images
zeeshanakram3 Jul 12, 2023
80d7169
Merge branch 'origo_opentelemetry_instrumentation' of https://github.…
zeeshanakram3 Jul 12, 2023
b9aa169
print service token generation error in start-elasticsearch-stach.sh …
zeeshanakram3 Jul 13, 2023
ad084e9
address change requests
zeeshanakram3 Jul 13, 2023
7c658a8
fix: disable dns instrumentation in the default opentelemetry instrum…
zeeshanakram3 Jul 13, 2023
3f987d2
fix no bind volumes docker image tests
mnaamani Jul 13, 2023
b33e3bd
no docker login in pull_request flow
mnaamani Jul 13, 2023
3ec8eeb
docker-compose fix db name and running tests in apps workflow
mnaamani Jul 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 34 additions & 56 deletions .github/workflows/joystream-apps-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Publish Colossus/Argus/QueryNode Docker images

on:
workflow_dispatch:
pull_request:

jobs:
build_and_publish:
Expand All @@ -26,6 +27,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: github.event_name == 'workflow_dispatch'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down Expand Up @@ -58,67 +60,43 @@ jobs:
push: false
load: true
tags: joystream/distributor-node:latest

- name: Test with latest images
run: |
yarn build:packages
cp docker-compose-no-bind-volumes.yml docker-compose.yml
./tests/network-tests/run-tests.sh content-directory

- name: Push storage-node
uses: docker/build-push-action@v3
with:
# Do not use local dir context to ensure we can build from a commit directly
# context: .
file: colossus.Dockerfile
push: true
tags: joystream/storage-node:${{ steps.extract_versions.outputs.colossus_version }}

- name: Push distributor-node
uses: docker/build-push-action@v3
with:
# Do not use local dir context to ensure we can build from a commit directly
# context: .
file: distributor-node.Dockerfile
push: true
tags: joystream/distributor-node:${{ steps.extract_versions.outputs.argus_version }}

- name: Push query-node
- name: Build query-node
uses: docker/build-push-action@v3
with:
# Do not use local dir context to ensure we can build from a commit directly
# context: .
file: query-node.Dockerfile
push: true
tags: joystream/query-node:${{ steps.extract_versions.outputs.qn_version }}
push: false
load: true
tags: joystream/query-node:latest

# Push latest tag if on master branch
- name: Push joystream/storage-node:latest
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
# Do not use local dir context to ensure we can build from a commit directly
# context: .
file: colossus.Dockerfile
push: true
tags: joystream/storage-node:latest
- name: Test with latest images
run: |
yarn build:packages
cp docker-compose-no-bind-volumes.yml docker-compose.yml
./tests/network-tests/run-test-node-docker.sh
sleep 15
docker compose up -d db indexer hydra-indexer-gateway processor graphql-server
sleep 30
./tests/network-tests/start-storage.sh
export REUSE_KEYS=true
export SKIP_STORAGE_AND_DISTRIBUTION=true
IGNORE_HIRED_LEADS=true ./tests/network-tests/run-test-scenario.sh content-directory

- name: Push joystream/distributor-node:latest
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
# Do not use local dir context to ensure we can build from a commit directly
# context: .
file: distributor-node.Dockerfile
push: true
tags: joystream/distributor-node:latest
- name: Push new versions
if: github.event_name == 'workflow_dispatch'
run: |
docker image tag joystream/storage-node:latest joystream/storage-node:${{ steps.extract_versions.outputs.colossus_version }}
docker image tag joystream/distributor:latest joystream/distributor-node:${{ steps.extract_versions.outputs.argus_version }}
docker image tag joystream/query-node:latest joystream/query-node:${{ steps.extract_versions.outputs.qn_version }}
docker push joystream/storage-node:${{ steps.extract_versions.outputs.colossus_version }}
docker push joystream/distributor-node:${{ steps.extract_versions.outputs.argus_version }}
docker push joystream/query-node:${{ steps.extract_versions.outputs.qn_version }}

- name: Push latest tag
if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch'
run: |
docker push joystream/storage-node:latest
docker push joystream/distributor:latest
docker push joystream/query-node:latest

- name: Push query-node image
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
# Do not use local dir context to ensure we can build from a commit directly
# context: .
file: query-node.Dockerfile
push: true
tags: joystream/query-node:latest
1 change: 1 addition & 0 deletions build-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ yarn --frozen-lockfile
yarn workspace @joystream/types build
yarn workspace @joystream/metadata-protobuf build
yarn workspace @joystream/js build
yarn workspace @joystream/opentelemetry build
yarn workspace query-node-root build
yarn workspace @joystream/cli build
yarn workspace storage-node build
Expand Down
5 changes: 4 additions & 1 deletion colossus.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ COPY ./devops/eslint-config/package.json ./devops/eslint-config/package.json
COPY ./devops/prettier-config/package.json ./devops/prettier-config/package.json
COPY ./storage-node/package.json storage-node/package.json
COPY ./storage-node/client/package.json storage-node/client/package.json
COPY ./opentelemetry/package.json opentelemetry/package.json
COPY ./package.json package.json

RUN yarn --frozen-lockfile
Expand All @@ -19,10 +20,12 @@ COPY ./metadata-protobuf metadata-protobuf
COPY ./devops/eslint-config ./devops/eslint-config
COPY ./devops/prettier-config ./devops/prettier-config
COPY ./storage-node storage-node
COPY ./opentelemetry opentelemetry
COPY ./tsconfig.json ./tsconfig.json

RUN yarn workspace @joystream/types build
RUN yarn workspace @joystream/metadata-protobuf build
RUN yarn workspace @joystream/opentelemetry build
RUN yarn workspace storage-node build
RUN yarn cache clean

Expand All @@ -38,4 +41,4 @@ VOLUME ["/data", "/keystore", "/logs"]
EXPOSE 3333

ENTRYPOINT ["yarn", "storage-node"]
CMD ["server"]
CMD ["server"]
3 changes: 3 additions & 0 deletions distributor-node.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ COPY ./storage-node/package.json storage-node/package.json
COPY ./storage-node/client/package.json storage-node/client/package.json
COPY ./distributor-node/package.json distributor-node/package.json
COPY ./distributor-node/client/package.json distributor-node/client/package.json
COPY ./opentelemetry/package.json opentelemetry/package.json
COPY ./package.json package.json

RUN yarn --frozen-lockfile
Expand All @@ -22,6 +23,7 @@ COPY ./storage-node ./storage-node
COPY ./devops/eslint-config ./devops/eslint-config
COPY ./devops/prettier-config ./devops/prettier-config
COPY ./distributor-node distributor-node
COPY ./opentelemetry opentelemetry
COPY ./tsconfig.json ./tsconfig.json

# Build & cleanup
Expand All @@ -30,6 +32,7 @@ RUN \
yarn workspace @joystream/types build &&\
yarn workspace @joystream/metadata-protobuf build &&\
yarn workspace @joystream/storage-node-client build &&\
yarn workspace @joystream/opentelemetry build &&\
yarn workspace @joystream/distributor-cli build &&\
yarn cache clean

Expand Down
3 changes: 2 additions & 1 deletion distributor-node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 1.2.0
### 1.2.1

- Integrates OpenTelemetry API/SDK with Argus for exporting improved tracing logs & metrics to Elasticsearch. Adds `./start-elasticsearch-stack.sh` script to bootstrap elasticsearch services (Elasticsearch + Kibana + APM Server) with all the required configurations.
- Add support for Elasticsearch authentication (`logs.elastic.auth` config section)
- **FIX:** Objects belonging to group `0` of LRU-SP cache were never fully dropped from the state because of a bug in `StateCacheService.dropById`

Expand Down
6 changes: 6 additions & 0 deletions distributor-node/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ export interface StatusResponse {
* @memberof StatusResponse
*/
'version': string;
/**
*
* @type {number}
* @memberof StatusResponse
*/
'workerId'?: number;
/**
*
* @type {number}
Expand Down
5 changes: 0 additions & 5 deletions distributor-node/config/docker/filebeat.Dockerfile

This file was deleted.

19 changes: 0 additions & 19 deletions distributor-node/config/docker/filebeat.docker.yml

This file was deleted.

39 changes: 1 addition & 38 deletions distributor-node/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,9 @@ services:
- 127.0.0.1:3334:3334
working_dir: /joystream/distributor-node
init: true
entrypoint: ['./bin/run']
command: ['start', './config/docker/distributor-dev.docker.yml']
# Ref: https://www.elastic.co/guide/en/elasticsearch/reference/7.13/docker.html
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.2
container_name: elasticsearch
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- es-data:/usr/share/elasticsearch/data
ports:
- 127.0.0.1:9200:9200
# Ref: https://www.elastic.co/guide/en/kibana/7.13/docker.html
kibana:
image: docker.elastic.co/kibana/kibana:7.13.2
container_name: kibana
ports:
- 127.0.0.1:5601:5601
environment:
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
# Ref: https://www.elastic.co/guide/en/beats/filebeat/current/running-on-docker.html
filebeat:
user: root
image: joystream/distributor-filebeat
build:
context: ./config/docker
dockerfile: ./filebeat.Dockerfile
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- logs:/logs
command: ['yarn', 'start']

volumes:
es-data:
driver: local
logs:
driver: local
cache:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## joystreamNodeWs Type

`string`

## joystreamNodeWs Constraints

**URI**: the string must be a URI, according to [RFC 3986](https://tools.ietf.org/html/rfc3986 "check the specification")
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## queryNode Type

`string`

## queryNode Constraints

**URI**: the string must be a URI, according to [RFC 3986](https://tools.ietf.org/html/rfc3986 "check the specification")
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Query node graphql server uri (for example: <http://localhost:8081/graphql>)

`string`

### queryNode Constraints

**URI**: the string must be a URI, according to [RFC 3986](https://tools.ietf.org/html/rfc3986 "check the specification")

## joystreamNodeWs

Joystream node websocket api uri (for example: ws\://localhost:9944)
Expand All @@ -44,3 +48,7 @@ Joystream node websocket api uri (for example: ws\://localhost:9944)
### joystreamNodeWs Type

`string`

### joystreamNodeWs Constraints

**URI**: the string must be a URI, according to [RFC 3986](https://tools.ietf.org/html/rfc3986 "check the specification")
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## endpoint Type

`string`

## endpoint Constraints

**URI**: the string must be a URI, according to [RFC 3986](https://tools.ietf.org/html/rfc3986 "check the specification")
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ Elastichsearch endpoint to push the logs to (for example: <http://localhost:9200

`string`

### endpoint Constraints

**URI**: the string must be a URI, according to [RFC 3986](https://tools.ietf.org/html/rfc3986 "check the specification")

## index

Elasticsearch index to push the logs to. If not provided, will fallback to "distributor-node"
Expand Down
7 changes: 5 additions & 2 deletions distributor-node/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@joystream/distributor-cli",
"description": "Joystream distributor node CLI",
"version": "1.2.0",
"version": "1.2.1",
"author": "Joystream contributors",
"bin": {
"joystream-distributor": "./bin/run"
Expand All @@ -11,6 +11,7 @@
"@apollo/client": "^3.2.5",
"@elastic/ecs-winston-format": "^1.1.0",
"@joystream/metadata-protobuf": "^2.8.0",
"@joystream/opentelemetry": "1.0.0",
"@joystream/storage-node-client": "^3.0.0",
"@joystream/types": "^2.0.0",
"@oclif/command": "^1",
Expand Down Expand Up @@ -157,7 +158,9 @@
"lint": "eslint ./src --ext .ts",
"format": "prettier ./ --write",
"checks": "tsc --noEmit --pretty && prettier ./ --check && yarn lint",
"cli": "./bin/run"
"cli": "./bin/run",
"start": "./bin/run start",
"start:with-instrumentation": "export OTEL_APPLICATION=distributor-node; node --require @joystream/opentelemetry ./bin/run start"
},
"types": "lib/index.d.ts"
}
Loading
Loading