Skip to content

Commit

Permalink
Merge branch 'main' into ffs.add-probability-based-flags
Browse files Browse the repository at this point in the history
  • Loading branch information
puckpuck authored Dec 3, 2023
2 parents 729561a + 8124353 commit 53697ac
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 25 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ release.

## Unreleased

* [currencyservice] bring back multistage build
([#1276](https://github.com/open-telemetry/opentelemetry-demo/pull/1276))
* [currencyservice]: update opentelemetry-cpp to 1.12.0
([#1275](https://github.com/open-telemetry/opentelemetry-demo/pull/1275))
* update loadgenerator dependencies and the base image
([#1274](https://github.com/open-telemetry/opentelemetry-demo/pull/1274))
* add env var for pinning trace-based test tool version
Expand All @@ -15,6 +19,8 @@ release.
([#1237](https://github.com/open-telemetry/opentelemetry-demo/pull/1237))
* update PHP quoteservice to use 1.0.0
([#1236](https://github.com/open-telemetry/opentelemetry-demo/pull/1236))
* [cartservice] Add .NET memory, CPU, and thread metrics
([#1265](https://github.com/open-telemetry/opentelemetry-demo/pull/1265))
* enable browser traffic in loadgenerator using playwright ([#1266](https://github.com/open-telemetry/opentelemetry-demo/pull/1266))

## 1.6.0
Expand Down
1 change: 1 addition & 0 deletions src/cartservice/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
.AddHttpClientInstrumentation()
.AddOtlpExporter())
.WithMetrics(meterBuilder => meterBuilder
.AddProcessInstrumentation()
.AddRuntimeInstrumentation()
.AddAspNetCoreInstrumentation()
.AddOtlpExporter());
Expand Down
5 changes: 3 additions & 2 deletions src/cartservice/src/cartservice.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.AspNetCore" Version="2.58.0" />
<PackageReference Include="Grpc.AspNetCore.HealthChecks" Version="2.58.0" />
<PackageReference Include="Grpc.AspNetCore" Version="2.59.0" />
<PackageReference Include="Grpc.AspNetCore.HealthChecks" Version="2.59.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.6.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.6.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.5.1-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.5.1-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.5.1-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="0.5.0-beta.3" />
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.0.0-rc9.12" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.1" />
<PackageReference Include="OpenTelemetry.ResourceDetectors.Container" Version="1.0.0-beta.4" />
Expand Down
4 changes: 2 additions & 2 deletions src/cartservice/tests/cartservice.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Net.Client" Version="2.57.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.59.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.13" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
Expand Down
6 changes: 2 additions & 4 deletions src/checkoutservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ func main() {
}

var srv = grpc.NewServer(
grpc.UnaryInterceptor(otelgrpc.UnaryServerInterceptor()),
grpc.StreamInterceptor(otelgrpc.StreamServerInterceptor()),
grpc.StatsHandler(otelgrpc.NewServerHandler()),
)
pb.RegisterCheckoutServiceServer(srv, svc)
healthpb.RegisterHealthServer(srv, svc)
Expand Down Expand Up @@ -343,8 +342,7 @@ func (cs *checkoutService) prepareOrderItemsAndShippingQuoteFromCart(ctx context
func createClient(ctx context.Context, svcAddr string) (*grpc.ClientConn, error) {
return grpc.DialContext(ctx, svcAddr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()),
grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
)
}

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

FROM alpine
FROM alpine as builder

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

ARG OPENTELEMETRY_CPP_VERSION=1.10.0
ARG OPENTELEMETRY_CPP_VERSION=1.12.0

RUN git clone https://github.com/open-telemetry/opentelemetry-cpp \
&& cd opentelemetry-cpp/ \
&& git checkout tags/v${OPENTELEMETRY_CPP_VERSION} -b v${OPENTELEMETRY_CPP_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF \
-DWITH_EXAMPLES=OFF -DWITH_OTLP_GRPC=ON \
&& make -j$(nproc || sysctl -n hw.ncpu || echo 1) install && cd ../.. && rm -rf opentelemetry-cpp
&& cd opentelemetry-cpp/ \
&& git checkout tags/v${OPENTELEMETRY_CPP_VERSION} -b v${OPENTELEMETRY_CPP_VERSION} \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF \
-DWITH_EXAMPLES=OFF -DWITH_OTLP_GRPC=ON \
&& make -j$(nproc || sysctl -n hw.ncpu || echo 1) install && cd ../..

COPY . /currencyservice

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


FROM alpine as release

RUN apk update && apk add grpc-dev protobuf-dev
COPY --from=builder /usr/local /usr/local

EXPOSE ${CURRENCY_SERVICE_PORT}
ENTRYPOINT ./usr/local/bin/currencyservice ${CURRENCY_SERVICE_PORT}
2 changes: 1 addition & 1 deletion src/currencyservice/src/meter_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace
otlp_exporter::OtlpGrpcMetricExporterOptions otlpOptions;

// Configuration via environment variable not supported yet
otlpOptions.aggregation_temporality = metric_sdk::AggregationTemporality::kDelta;
otlpOptions.aggregation_temporality = otlp_exporter::PreferredAggregationTemporality::kDelta;
auto exporter = otlp_exporter::OtlpGrpcMetricExporterFactory::Create(otlpOptions);

// Build MeterProvider and Reader
Expand Down
6 changes: 2 additions & 4 deletions src/productcatalogservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ func main() {
}

srv := grpc.NewServer(
grpc.UnaryInterceptor(otelgrpc.UnaryServerInterceptor()),
grpc.StreamInterceptor(otelgrpc.StreamServerInterceptor()),
grpc.StatsHandler(otelgrpc.NewServerHandler()),
)

reflection.Register(srv)
Expand Down Expand Up @@ -278,7 +277,6 @@ func (p *productCatalog) checkProductFailure(ctx context.Context, id string) boo
func createClient(ctx context.Context, svcAddr string) (*grpc.ClientConn, error) {
return grpc.DialContext(ctx, svcAddr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()),
grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
)
}

0 comments on commit 53697ac

Please sign in to comment.