Skip to content

Commit

Permalink
Merge branch 'main' into featureflagservice-update-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
austinlparker authored Jul 21, 2023
2 parents 6f52716 + 3bcf333 commit 7b5032b
Show file tree
Hide file tree
Showing 32 changed files with 371 additions and 164 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ src/shippingservice/target/
/src/featureflagservice/src/ffs_demo_pb.erl
/src/featureflagservice/src/ffs_service_*.erl
/src/featureflagservice/src/oteldemo_*.erl
/src/frauddetectionservice/src/main/proto
/src/frontend/pb/
/src/frontend/protos/
/src/paymentservice/demo.proto
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ release.
([#983](https://github.com/open-telemetry/opentelemetry-demo/pull/983))
* [FeatureFlagService] Update dependencies
([#992](https://github.com/open-telemetry/opentelemetry-demo/pull/992))
* [currencyService] Update OTel dependency
([#991](https://github.com/open-telemetry/opentelemetry-demo/pull/991))
* [LoadGenerator & RecommendatationService] update dependencies
([#988](https://github.com/open-telemetry/opentelemetry-demo/pull/988))
* [FraudDetectionService] Updated Kotlin version and OTel dependencies
([#987](https://github.com/open-telemetry/opentelemetry-demo/pull/987))

## 1.4.0

Expand Down
3 changes: 2 additions & 1 deletion docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ services:
- LOCUST_HOST
- LOCUST_HEADLESS
- LOCUST_AUTOSTART
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:4318/v1/traces
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=loadgenerator
- PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ services:
- LOCUST_HOST
- LOCUST_HEADLESS
- LOCUST_AUTOSTART
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:4318/v1/traces
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=loadgenerator
- PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
Expand Down
2 changes: 1 addition & 1 deletion src/adservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN ./gradlew installDist -PprotoSourceDir=./proto

FROM eclipse-temurin:17-jre

ARG version=1.24.0
ARG version=1.28.0
WORKDIR /usr/src/app/

COPY --from=builder /usr/src/app/ ./
Expand Down
17 changes: 9 additions & 8 deletions src/adservice/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

plugins {
id 'com.google.protobuf' version '0.8.18'
id 'com.google.protobuf' version '0.9.4'
id 'com.github.sherter.google-java-format' version '0.9'
id 'idea'
id 'application'
id 'com.github.ben-manes.versions' version '0.47.0'
}

repositories {
Expand All @@ -15,10 +16,10 @@ description = 'Ad Service'
group = "adservice"
version = "0.1.0-SNAPSHOT"

def opentelemetryVersion = "1.19.0"
def opentelemetryInstrumentationAlphaVersion = "1.19.1-alpha"
def grpcVersion = "1.45.1"
def jacksonVersion = "2.13.2"
def opentelemetryVersion = "1.28.0"
def opentelemetryInstrumentationAlphaVersion = "1.28.0-alpha"
def grpcVersion = "1.56.1"
def jacksonVersion = "2.15.2"
def protocVersion = "3.20.0"

tasks.withType(JavaCompile) {
Expand All @@ -38,7 +39,7 @@ dependencies {
implementation platform("io.opentelemetry:opentelemetry-bom:${opentelemetryVersion}")
implementation platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${opentelemetryInstrumentationAlphaVersion}")

implementation "com.google.api.grpc:proto-google-common-protos:2.8.0",
implementation "com.google.api.grpc:proto-google-common-protos:2.22.0",
"javax.annotation:javax.annotation-api:1.3.2",
"io.grpc:grpc-protobuf:${grpcVersion}",
"io.grpc:grpc-stub:${grpcVersion}",
Expand All @@ -47,11 +48,11 @@ dependencies {
"io.opentelemetry:opentelemetry-api",
"io.opentelemetry:opentelemetry-sdk",
"io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations",
"org.apache.logging.log4j:log4j-core:2.17.2"
"org.apache.logging.log4j:log4j-core:2.20.0"

runtimeOnly "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}",
"com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}",
"io.netty:netty-tcnative-boringssl-static:2.0.51.Final"
"io.netty:netty-tcnative-boringssl-static:2.0.61.Final"
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/adservice/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Wed Jul 19 11:27:42 EDT 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
24 changes: 12 additions & 12 deletions src/adservice/src/main/java/oteldemo/AdService.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package oteldemo;

import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.Iterables;
import oteldemo.Demo.Ad;
import oteldemo.Demo.AdRequest;
import oteldemo.Demo.AdResponse;
import oteldemo.Demo.GetFlagResponse;
import oteldemo.FeatureFlagServiceGrpc.FeatureFlagServiceBlockingStub;
import io.grpc.*;
import io.grpc.health.v1.HealthCheckResponse.ServingStatus;
import io.grpc.protobuf.services.*;
Expand All @@ -36,6 +31,11 @@
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import oteldemo.Demo.Ad;
import oteldemo.Demo.AdRequest;
import oteldemo.Demo.AdResponse;
import oteldemo.Demo.GetFlagResponse;
import oteldemo.FeatureFlagServiceGrpc.FeatureFlagServiceBlockingStub;

public final class AdService {

Expand Down Expand Up @@ -73,12 +73,12 @@ private void start() throws IOException {
healthMgr = new HealthStatusManager();

String featureFlagServiceAddr =
Optional.ofNullable(System.getenv("FEATURE_FLAG_GRPC_SERVICE_ADDR"))
.orElse("");
Optional.ofNullable(System.getenv("FEATURE_FLAG_GRPC_SERVICE_ADDR")).orElse("");
FeatureFlagServiceBlockingStub featureFlagServiceStub = null;
if (!featureFlagServiceAddr.isEmpty()) {
featureFlagServiceStub = oteldemo.FeatureFlagServiceGrpc.newBlockingStub(
ManagedChannelBuilder.forTarget(featureFlagServiceAddr).usePlaintext().build());
featureFlagServiceStub =
oteldemo.FeatureFlagServiceGrpc.newBlockingStub(
ManagedChannelBuilder.forTarget(featureFlagServiceAddr).usePlaintext().build());
}

server =
Expand Down
4 changes: 2 additions & 2 deletions src/cartservice/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

# https://mcr.microsoft.com/v2/dotnet/sdk/tags/list
FROM mcr.microsoft.com/dotnet/sdk:7.0.306 AS builder
FROM mcr.microsoft.com/dotnet/sdk:6.0.402 AS builder

WORKDIR /usr/src/app/

Expand All @@ -35,7 +35,7 @@ RUN \
# -----------------------------------------------------------------------------

# https://mcr.microsoft.com/v2/dotnet/runtime-deps/tags/list
FROM mcr.microsoft.com/dotnet/runtime-deps:7.0.7-alpine3.17
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0.9-alpine3.16

WORKDIR /usr/src/app/
COPY --from=builder /cartservice/ ./
Expand Down
2 changes: 1 addition & 1 deletion src/cartservice/src/cartservice.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<StaticWebAssetsEnabled>false</StaticWebAssetsEnabled>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/cartservice/tests/cartservice.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
17 changes: 4 additions & 13 deletions src/currencyservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine as builder
FROM alpine

RUN apk update
RUN apk add git cmake make g++ grpc-dev re2-dev protobuf-dev c-ares-dev

ARG OPENTELEMETRY_CPP_VERSION=1.9.0
ARG OPENTELEMETRY_CPP_VERSION=1.10.0

RUN git clone https://github.com/open-telemetry/opentelemetry-cpp \
&& cd opentelemetry-cpp/ \
Expand All @@ -28,7 +28,7 @@ RUN git clone https://github.com/open-telemetry/opentelemetry-cpp \
&& cd build \
&& cmake .. -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF \
-DWITH_EXAMPLES=OFF -DWITH_OTLP=ON -DWITH_OTLP_GRPC=ON \
-DWITH_EXAMPLES=OFF -DWITH_OTLP_GRPC=ON \
&& make -j$(nproc || sysctl -n hw.ncpu || echo 1) install && cd ../.. && rm -rf opentelemetry-cpp

COPY . /currencyservice
Expand All @@ -38,14 +38,5 @@ RUN cd /currencyservice \
&& cmake .. \
&& make -j$(nproc || sysctl -n hw.ncpu || echo 1) install

FROM alpine

WORKDIR /usr/src/app/

RUN apk update
RUN apk add grpc-dev re2-dev protobuf-dev c-ares-dev

COPY --from=builder /usr/local/bin/currencyservice ./

EXPOSE ${CURRENCY_SERVICE_PORT}
ENTRYPOINT ./currencyservice ${CURRENCY_SERVICE_PORT}
ENTRYPOINT ./usr/local/bin/currencyservice ${CURRENCY_SERVICE_PORT}
11 changes: 7 additions & 4 deletions src/currencyservice/src/tracer_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "opentelemetry/exporters/ostream/span_exporter_factory.h"
#include "opentelemetry/nostd/shared_ptr.h"
#include "opentelemetry/sdk/trace/simple_processor_factory.h"
#include "opentelemetry/sdk/trace/tracer_context.h"
#include "opentelemetry/sdk/trace/tracer_context_factory.h"
#include "opentelemetry/sdk/trace/tracer_provider_factory.h"
#include "opentelemetry/trace/propagation/http_trace_context.h"
Expand Down Expand Up @@ -76,14 +77,16 @@ void initTracer()
opentelemetry::sdk::trace::SimpleSpanProcessorFactory::Create(std::move(exporter));
std::vector<std::unique_ptr<opentelemetry::sdk::trace::SpanProcessor>> processors;
processors.push_back(std::move(processor));
std::shared_ptr<opentelemetry::sdk::trace::TracerContext> context =

auto context =
opentelemetry::sdk::trace::TracerContextFactory::Create(std::move(processors));
std::shared_ptr<opentelemetry::trace::TracerProvider> provider =
opentelemetry::sdk::trace::TracerProviderFactory::Create(context);
// Set the global trace provider
opentelemetry::sdk::trace::TracerProviderFactory::Create(std::move(context));

// Set the global trace provider
opentelemetry::trace::Provider::SetTracerProvider(provider);

// set global propagator
// set global propagator
opentelemetry::context::propagation::GlobalTextMapPropagator::SetGlobalPropagator(
opentelemetry::nostd::shared_ptr<opentelemetry::context::propagation::TextMapPropagator>(
new opentelemetry::trace::propagation::HttpTraceContext()));
Expand Down
2 changes: 1 addition & 1 deletion src/emailservice/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.1.4
6 changes: 3 additions & 3 deletions src/emailservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# SPDX-License-Identifier: Apache-2.0


FROM ruby:3.1.2-alpine as base
FROM ruby:3.1.4-slim as base

FROM base as builder

WORKDIR /tmp

COPY Gemfile Gemfile.lock .

RUN apk update && apk add make gcc musl-dev && bundle install

#RUN apk update && apk add make gcc musl-dev gcompat && bundle install
RUN apt-get update && apt-get install build-essential -y && bundle install
FROM base as release

WORKDIR /email_server
Expand Down
10 changes: 5 additions & 5 deletions src/emailservice/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ source "https://rubygems.org"

gem "net-smtp", "~> 0.3"
gem "pony", "~> 1.13"
gem "puma", "~> 5.6"
gem "sinatra", "~> 2.2"
gem "puma", "~> 6.3"
gem "sinatra", "~> 3.0"

gem "opentelemetry-sdk", "~> 1.1"
gem "opentelemetry-exporter-otlp", "~> 0.21"
gem "opentelemetry-instrumentation-sinatra", "~> 0.19"
gem "opentelemetry-sdk", "~> 1.2"
gem "opentelemetry-exporter-otlp", "~> 0.24"
gem "opentelemetry-instrumentation-all", "~> 0.39"
Loading

0 comments on commit 7b5032b

Please sign in to comment.