Skip to content

Commit 00a1695

Browse files
author
github-actions
committed
Merge remote-tracking branch 'upstream/main'
2 parents 27b4923 + c79152c commit 00a1695

File tree

9 files changed

+56
-33
lines changed

9 files changed

+56
-33
lines changed

.env

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ COLLECTOR_CONTRIB_IMAGE=otel/opentelemetry-collector-contrib:0.108.0
1010
FLAGD_IMAGE=ghcr.io/open-feature/flagd:v0.11.2
1111
GRAFANA_IMAGE=grafana/grafana:11.2.0
1212
JAEGERTRACING_IMAGE=jaegertracing/all-in-one:1.60
13-
# must also update version field in ./src/grafana/provisioning/datasources/opensearch.yaml
14-
OPENSEARCH_IMAGE=opensearchproject/opensearch:2.16.0
13+
OPENSEARCH_IMAGE_VERSION=2.17.1
14+
OPENSEARCH_IMAGE=opensearchproject/opensearch:${OPENSEARCH_IMAGE_VERSION}
1515
POSTGRES_IMAGE=postgres:16.4
1616
PROMETHEUS_IMAGE=quay.io/prometheus/prometheus:v2.54.1
1717
VALKEY_IMAGE=valkey/valkey:8.0-alpine

.github/workflows/run-integration-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
uses: actions/checkout@v4
1818
- name: run tracetesting
1919
run: |
20-
make build && make run-tracetesting
20+
make build && docker system prune -f && make run-tracetesting

CHANGELOG.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ the release.
1515
([#1709](https://github.com/open-telemetry/opentelemetry-demo/pull/1709))
1616
* [chore] Add depends on to otelcol to wait on healthy opensearch
1717
([#1724](https://github.com/open-telemetry/opentelemetry-demo/pull/1724))
18+
* [flagd-ui] Add UI for managing Flagd feature flags
19+
([#1725](https://github.com/open-telemetry/opentelemetry-demo/pull/1725))
1820
* [accountingservice] bump OpenTelemetry .NET Automatic Instrumentation
1921
to 1.8.0 together with other dependencies
2022
([#1727](https://github.com/open-telemetry/opentelemetry-demo/pull/1727))
@@ -23,8 +25,12 @@ the release.
2325
* [frontend] fix imageSlowLoad headers not applied
2426
to 1.8.0 together with other dependencies
2527
([#1733](https://github.com/open-telemetry/opentelemetry-demo/pull/1733))
26-
* [flagd-ui] Add UI for managing Flagd feature flags
27-
([#1725](https://github.com/open-telemetry/opentelemetry-demo/pull/1725))
28+
* [chore] Move opensearch image version to .env file
29+
([#1743](https://github.com/open-telemetry/opentelemetry-demo/pull/1743))
30+
* [cartservice] Propagate cartservice exceptions
31+
([#1744](https://github.com/open-telemetry/opentelemetry-demo/pull/1744))
32+
* [cartservice] Update cart service to fail when cartServiceFailure is enabled
33+
([#1748](https://github.com/open-telemetry/opentelemetry-demo/pull/1748))
2834

2935
## 1.11.1
3036

docker-compose.minimal.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ services:
565565
memory: 100M
566566
restart: unless-stopped
567567
environment:
568-
- "GF_INSTALL_PLUGINS=grafana-opensearch-datasource"
568+
- "GF_INSTALL_PLUGINS=grafana-opensearch-datasource ${OPENSEARCH_IMAGE_VERSION}"
569569
volumes:
570570
- ./src/grafana/grafana.ini:/etc/grafana/grafana.ini
571571
- ./src/grafana/provisioning/:/etc/grafana/provisioning/
@@ -658,7 +658,7 @@ services:
658658
ports:
659659
- "9200"
660660
healthcheck:
661-
test: curl -s http://localhost:9200/_cluster/health | grep '"status":"green"'
661+
test: curl -s http://localhost:9200/_cluster/health | grep -E '"status":"(green|yellow)"'
662662
start_period: 10s
663663
interval: 5s
664664
timeout: 10s

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ services:
707707
memory: 100M
708708
restart: unless-stopped
709709
environment:
710-
- "GF_INSTALL_PLUGINS=grafana-opensearch-datasource"
710+
- "GF_INSTALL_PLUGINS=grafana-opensearch-datasource ${OPENSEARCH_IMAGE_VERSION}"
711711
volumes:
712712
- ./src/grafana/grafana.ini:/etc/grafana/grafana.ini
713713
- ./src/grafana/provisioning/:/etc/grafana/provisioning/
@@ -800,7 +800,7 @@ services:
800800
ports:
801801
- "9200"
802802
healthcheck:
803-
test: curl -s http://localhost:9200/_cluster/health | grep '"status":"green"'
803+
test: curl -s http://localhost:9200/_cluster/health | grep -E '"status":"(green|yellow)"'
804804
start_period: 10s
805805
interval: 5s
806806
timeout: 10s

src/cartservice/src/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
# https://mcr.microsoft.com/v2/dotnet/sdk/tags/list
18-
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0.302 AS builder
18+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0.403 AS builder
1919
ARG TARGETARCH
2020

2121
WORKDIR /usr/src/app/
@@ -30,7 +30,7 @@ RUN dotnet publish ./src/cartservice.csproj -v d -r linux-musl-$TARGETARCH --no-
3030
# -----------------------------------------------------------------------------
3131

3232
# https://mcr.microsoft.com/v2/dotnet/runtime-deps/tags/list
33-
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0.6-alpine3.20
33+
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0.10-alpine3.20
3434

3535
WORKDIR /usr/src/app/
3636
COPY --from=builder /cartservice/ ./

src/cartservice/src/cartservice.csproj

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Grpc.AspNetCore" Version="2.63.0" />
19-
<PackageReference Include="Grpc.AspNetCore.HealthChecks" Version="2.63.0" />
18+
<PackageReference Include="Grpc.AspNetCore" Version="2.66.0" />
19+
<PackageReference Include="Grpc.AspNetCore.HealthChecks" Version="2.66.0" />
2020
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
2121
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
2222
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
2323
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.9.0-beta.1" />
2424
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
25-
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="0.5.0-beta.6" />
26-
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.0.0-rc9.15" />
25+
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="0.5.0-beta.7" />
26+
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.9.0-beta.1" />
2727
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
28-
<PackageReference Include="OpenTelemetry.Resources.Container" Version="1.0.0-beta.8" />
29-
<PackageReference Include="OpenTelemetry.Resources.Host" Version="0.1.0-beta.2" />
30-
<PackageReference Include="StackExchange.Redis" Version="2.7.33" />
31-
<PackageReference Include="OpenFeature.Contrib.Providers.Flagd" Version="0.1.9" />
32-
<PackageReference Include="OpenFeature.Contrib.Hooks.Otel" Version="0.1.4" />
33-
<PackageReference Include="OpenFeature" Version="1.5.1" />
28+
<PackageReference Include="OpenTelemetry.Resources.Container" Version="1.0.0-beta.9" />
29+
<PackageReference Include="OpenTelemetry.Resources.Host" Version="0.1.0-beta.3" />
30+
<PackageReference Include="StackExchange.Redis" Version="2.8.16" />
31+
<PackageReference Include="OpenFeature.Contrib.Providers.Flagd" Version="0.3.0" />
32+
<PackageReference Include="OpenFeature.Contrib.Hooks.Otel" Version="0.2.0" />
33+
<PackageReference Include="OpenFeature" Version="2.0.0" />
3434
</ItemGroup>
3535

3636
<ItemGroup>

src/cartservice/src/services/CartService.cs

+29-11
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,18 @@ public override async Task<Empty> AddItem(AddItemRequest request, ServerCallCont
3333
activity?.SetTag("app.product.id", request.Item.ProductId);
3434
activity?.SetTag("app.product.quantity", request.Item.Quantity);
3535

36-
await _cartStore.AddItemAsync(request.UserId, request.Item.ProductId, request.Item.Quantity);
37-
return Empty;
36+
try
37+
{
38+
await _cartStore.AddItemAsync(request.UserId, request.Item.ProductId, request.Item.Quantity);
39+
40+
return Empty;
41+
}
42+
catch (RpcException ex)
43+
{
44+
activity?.RecordException(ex);
45+
activity?.SetStatus(ActivityStatusCode.Error, ex.Message);
46+
throw;
47+
}
3848
}
3949

4050
public override async Task<Cart> GetCart(GetCartRequest request, ServerCallContext context)
@@ -43,15 +53,24 @@ public override async Task<Cart> GetCart(GetCartRequest request, ServerCallConte
4353
activity?.SetTag("app.user.id", request.UserId);
4454
activity?.AddEvent(new("Fetch cart"));
4555

46-
var cart = await _cartStore.GetCartAsync(request.UserId);
47-
var totalCart = 0;
48-
foreach (var item in cart.Items)
56+
try
4957
{
50-
totalCart += item.Quantity;
51-
}
52-
activity?.SetTag("app.cart.items.count", totalCart);
58+
var cart = await _cartStore.GetCartAsync(request.UserId);
59+
var totalCart = 0;
60+
foreach (var item in cart.Items)
61+
{
62+
totalCart += item.Quantity;
63+
}
64+
activity?.SetTag("app.cart.items.count", totalCart);
5365

54-
return cart;
66+
return cart;
67+
}
68+
catch (RpcException ex)
69+
{
70+
activity?.RecordException(ex);
71+
activity?.SetStatus(ActivityStatusCode.Error, ex.Message);
72+
throw;
73+
}
5574
}
5675

5776
public override async Task<Empty> EmptyCart(EmptyCartRequest request, ServerCallContext context)
@@ -62,8 +81,7 @@ public override async Task<Empty> EmptyCart(EmptyCartRequest request, ServerCall
6281

6382
try
6483
{
65-
// Throw 1/10 of the time to simulate a failure when the feature flag is enabled
66-
if (await _featureFlagHelper.GetBooleanValue("cartServiceFailure", false) && random.Next(10) == 0)
84+
if (await _featureFlagHelper.GetBooleanValueAsync("cartServiceFailure", false))
6785
{
6886
await _badCartStore.EmptyCartAsync(request.UserId);
6987
}

src/grafana/provisioning/datasources/opensearch.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ datasources:
1717
logMessageField: body
1818
pplEnabled: true
1919
timeField: observedTimestamp
20-
version: 2.16.0

0 commit comments

Comments
 (0)