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

Upstream changes needed merge #41

Merged
merged 7 commits into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ PROMETHEUS_SERVICE_PORT=9090
PROMETHEUS_SERVICE_HOST=prometheus
PROMETHEUS_ADDR=${PROMETHEUS_SERVICE_HOST}:${PROMETHEUS_SERVICE_PORT}

# OpenSearch versionins
VERSION=2.8.0

# OpenSearch Node1
OPENSEARCH1_PORT=9200
OPENSEARCH1_HOST=opensearch-node1
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,13 @@ src/frontend/cypress/screenshots
src/shippingservice/target/

# Ignore copied/generated protobuf files
/src/accountingservice/genproto/
/src/cartservice/src/protos/
/src/checkoutservice/genproto/
/src/featureflagservice/proto/
/src/featureflagservice/src/ffs_demo_pb.erl
/src/featureflagservice/src/ffs_service_*.erl
/src/featureflagservice/src/oteldemo_*.erl
/src/frontend/pb/
/src/frontend/protos/
/src/paymentservice/demo.proto
/src/productcatalogservice/genproto/
/src/recommendationservice/demo_pb2*.py
/src/shippingservice/proto/
3 changes: 3 additions & 0 deletions .licenserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@
],
"ignore": [
"node_modules/",
"src/accountingservice/genproto/",
"src/cartservice/src/obj/",
"src/cartservice/tests/obj/",
"src/checkoutservice/genproto/",
"src/featureflagservice/assets/vendor/",
"src/featureflagservice/priv/",
"src/productcatalogservice/genproto/",
"internal/tools/"
]
}
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ We welcome any vendor to fork the project to demonstrate their services and
adding a link below. The community is committed to maintaining the project and
keeping it up to date for you.

| | | |
| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |----------------------------------------------------------------------------------------------|
| [AlibabaCloud LogService](https://github.com/aliyun-sls/opentelemetry-demo) | [Grafana Labs](https://github.com/grafana/opentelemetry-demo) | [Sentry](https://github.com/getsentry/opentelemetry-demo) |
| [AppDynamics](https://www.appdynamics.com/blog/cloud/how-to-observe-opentelemetry-demo-app-in-appdynamics-cloud/) | [Helios](https://otelsandbox.gethelios.dev) | [Splunk](https://github.com/signalfx/opentelemetry-demo) |
| [Aspecto](https://github.com/aspecto-io/opentelemetry-demo) | [Honeycomb.io](https://github.com/honeycombio/opentelemetry-demo) | [Sumo Logic](https://www.sumologic.com/blog/common-opentelemetry-demo-application/) |
| [Coralogix](https://coralogix.com/blog/configure-otel-demo-send-telemetry-data-coralogix) | [Instana](https://github.com/instana/opentelemetry-demo) | [TelemetryHub](https://github.com/TelemetryHub/opentelemetry-demo/tree/telemetryhub-backend) |
| [Datadog](https://github.com/DataDog/opentelemetry-demo) | [Kloudfuse](https://github.com/kloudfuse/opentelemetry-demo) | [Teletrace](https://github.com/teletrace/opentelemetry-demo) |
| [Dynatrace](https://www.dynatrace.com/news/blog/opentelemetry-demo-application-with-dynatrace/) | [Lightstep](https://github.com/lightstep/opentelemetry-demo) | [Uptrace](https://github.com/uptrace/uptrace/tree/master/example/opentelemetry-demo) |
| [Elastic](https://github.com/elastic/opentelemetry-demo) | [New Relic](https://github.com/newrelic/opentelemetry-demo) | [OpenSearch](https://github.com/opensearch-project/opentelemetry-demo) |
| | | |
| | | |
| ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [AlibabaCloud LogService](https://github.com/aliyun-sls/opentelemetry-demo) | [Elastic](https://github.com/elastic/opentelemetry-demo) | [OpenSearch](https://github.com/opensearch-project/opentelemetry-demo) |
| [AppDynamics](https://www.appdynamics.com/blog/cloud/how-to-observe-opentelemetry-demo-app-in-appdynamics-cloud/) | [Grafana Labs](https://github.com/grafana/opentelemetry-demo) | [Sentry](https://github.com/getsentry/opentelemetry-demo) |
| [Aspecto](https://github.com/aspecto-io/opentelemetry-demo) | [Helios](https://otelsandbox.gethelios.dev) | [Splunk](https://github.com/signalfx/opentelemetry-demo) |
| [Axiom](https://play.axiom.co/axiom-play-qf1k/dashboards/otel.traces.otel-demo-traces) | [Honeycomb.io](https://github.com/honeycombio/opentelemetry-demo) | [Sumo Logic](https://www.sumologic.com/blog/common-opentelemetry-demo-application/) |
| [Azure Data Explorer](https://github.com/Azure/Azure-kusto-opentelemetry-demo) | [Instana](https://github.com/instana/opentelemetry-demo) | [TelemetryHub](https://github.com/TelemetryHub/opentelemetry-demo/tree/telemetryhub-backend) |
| [Coralogix](https://coralogix.com/blog/configure-otel-demo-send-telemetry-data-coralogix) | [Kloudfuse](https://github.com/kloudfuse/opentelemetry-demo) | [Teletrace](https://github.com/teletrace/opentelemetry-demo) |
| [Datadog](https://github.com/DataDog/opentelemetry-demo) | [Lightstep](https://github.com/lightstep/opentelemetry-demo) | [Uptrace](https://github.com/uptrace/uptrace/tree/master/example/opentelemetry-demo) |
| [Dynatrace](https://www.dynatrace.com/news/blog/opentelemetry-demo-application-with-dynatrace/) | [New Relic](https://github.com/newrelic/opentelemetry-demo) | |

## Contributing

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -711,22 +711,22 @@
logging: *logging

# OpenSearch store - node1
opensearch-node1: # This is also the hostname of the container within the Docker network (i.e. https://opensearch-node1/)

Check warning on line 714 in docker-compose.yml

View workflow job for this annotation

GitHub Actions / yamllint

714:21 [comments] too few spaces before comment
image: opensearchproject/opensearch:2.7.0 # Specifying the latest available image - modify if you want a specific version
image: opensearchproject/opensearch:2.8.0 # Specifying the latest available image - modify if you want a specific version

Check warning on line 715 in docker-compose.yml

View workflow job for this annotation

GitHub Actions / yamllint

715:47 [comments] too few spaces before comment
container_name: opensearch-node1
environment:
- cluster.name=opensearch-cluster # Name the cluster

Check warning on line 718 in docker-compose.yml

View workflow job for this annotation

GitHub Actions / yamllint

718:41 [comments] too few spaces before comment
- node.name=opensearch-node1 # Name the node that will run in this container

Check warning on line 719 in docker-compose.yml

View workflow job for this annotation

GitHub Actions / yamllint

719:36 [comments] too few spaces before comment
- discovery.seed_hosts=opensearch-node1,opensearch-node2 # Nodes to look for when discovering the cluster

Check warning on line 720 in docker-compose.yml

View workflow job for this annotation

GitHub Actions / yamllint

720:64 [comments] too few spaces before comment
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2 # Nodes eligible to serve as cluster manager

Check warning on line 721 in docker-compose.yml

View workflow job for this annotation

GitHub Actions / yamllint

721:81 [comments] too few spaces before comment
- bootstrap.memory_lock=true # Disable JVM heap memory swapping

Check warning on line 722 in docker-compose.yml

View workflow job for this annotation

GitHub Actions / yamllint

722:36 [comments] too few spaces before comment
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # Set min and max JVM heap sizes to at least 50% of system RAM

Check warning on line 723 in docker-compose.yml

View workflow job for this annotation

GitHub Actions / yamllint

723:50 [comments] too few spaces before comment
ulimits:
memlock:
soft: -1 # Set memlock to unlimited (no soft or hard limit)

Check warning on line 726 in docker-compose.yml

View workflow job for this annotation

GitHub Actions / yamllint

726:18 [comments] too few spaces before comment
hard: -1
nofile:
soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536

Check warning on line 729 in docker-compose.yml

View workflow job for this annotation

GitHub Actions / yamllint

729:21 [comments] too few spaces before comment
hard: 65536
volumes:
- opensearch-data1:/usr/share/opensearch/data # Creates volume called opensearch-data1 and mounts it to the container
Expand All @@ -741,7 +741,7 @@

# OpenSearch store - node2
opensearch-node2:
image: opensearchproject/opensearch:2.7.0 # This should be the same image used for opensearch-node1 to avoid issues
image: opensearchproject/opensearch:2.8.0 # This should be the same image used for opensearch-node1 to avoid issues
container_name: opensearch-node2
environment:
- cluster.name=opensearch-cluster
Expand All @@ -762,7 +762,7 @@

# OpenSearch store - dashboard
opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:2.7.0 # Make sure the version of opensearch-dashboards matches the version of opensearch installed on other nodes
image: opensearchproject/opensearch-dashboards:2.8.0 # Make sure the version of opensearch-dashboards matches the version of opensearch installed on other nodes
container_name: opensearch-dashboards
ports:
- 5601:5601 # Map host port 5601 to container port 5601
Expand Down
114 changes: 114 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"schedule": "every weekend",
"packageRules": [
{
"matchPaths": ["*"],
"ignorePaths": ["src/"],
"groupName": "config-no-service"
},
{
"matchPaths": ["src/accountingservice"],
"groupName": "accountingservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/adservice"],
"groupName": "adservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/cartservice"],
"groupName": "cartservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/checkoutservice"],
"groupName": "checkoutservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/currencyservice"],
"groupName": "currencyservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/emailservice"],
"groupName": "emailservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/featureflagservice"],
"groupName": "featureflagservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/frauddetectionservice"],
"groupName": "frauddetectionservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/frontend"],
"groupName": "frontend",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/frontendproxy"],
"groupName": "frontendproxy",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/grafana"],
"groupName": "grafana",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/kakfa"],
"groupName": "kakfa",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/loadgenerator"],
"groupName": "loadgenerator",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/otelcollector"],
"groupName": "otelcollector",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/paymentservice"],
"groupName": "paymentservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/productcatalogservice"],
"groupName": "productcatalogservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/prometheus"],
"groupName": "prometheus",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/quoteservice"],
"groupName": "quoteservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/recommendationservice"],
"groupName": "recommendationservice",
"assigneesFromCodeOwners": true
},
{
"matchPaths": ["src/shippingservice"],
"groupName": "shippingservice",
"assigneesFromCodeOwners": true
}
]
}
18 changes: 1 addition & 17 deletions src/accountingservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,10 @@


FROM golang:1.19.2-alpine AS builder
RUN apk add build-base protobuf-dev protoc
RUN apk add --no-cache git
RUN apk add --no-cache curl

WORKDIR /usr/src/app/

# Restore dependencies
COPY ./src/accountingservice/ ./
COPY ./pb/ ./proto/

ENV GOPROXY=direct
ENV GOSUMDB=off

RUN go mod download
RUN go install google.golang.org/protobuf/cmd/[email protected]
RUN go install google.golang.org/grpc/cmd/[email protected]

# Build executable
RUN protoc -I ./proto/ ./proto/demo.proto --go_out=./ --go-grpc_out=./
RUN go build -o /go/bin/accountingservice/ ./
RUN go build -o /go/bin/accountingservice/

# -----------------------------------------------------------------------------

Expand Down
25 changes: 22 additions & 3 deletions src/accountingservice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ This service consumes new orders from a Kafka topic.

## Local Build

To build the protos and the service binary, run:
To build the service binary, run:

```sh
protoc -I ../../pb/ ../../pb/demo.proto --go_out=./ --go-grpc_out=./
go build -o /go/bin/accountingservice/ ./
go build -o /go/bin/accountingservice/
```

## Docker Build
Expand All @@ -18,3 +17,23 @@ From the root directory, run:
```sh
docker compose build accountingservice
```

## Regenerate protos

> **Note**
> [`protoc`](https://grpc.io/docs/protoc-installation/) is required.
To regenerate gRPC code run:

```sh
go generate
```

## Bump dependencies

To bump all dependencies run:

```sh
go get -u -t ./...
go mod tidy
```
Loading
Loading