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

Merge upstream after services rename #131

Closed
wants to merge 45 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
43f448c
[cartservice] - Add Exemplars to Cart Service (#1830)
julianocosta89 Dec 13, 2024
9b7cfad
[otel-collector] - rename otelcol to otel-collector (#1841)
puckpuck Dec 16, 2024
fa7847e
[grafana] Add Exemplars Dashboard (#1836)
julianocosta89 Dec 16, 2024
90a1bf1
build(deps): bump the go-production-dependencies group across 2 direc…
dependabot[bot] Dec 18, 2024
897beda
build(deps): bump gradle/actions from 4.2.1 to 4.2.2 (#1849)
dependabot[bot] Dec 18, 2024
5dbe836
[quote] rename quoteservice to quote (#1838)
puckpuck Dec 19, 2024
d6efe7f
[ad] rename adService to ad (#1832)
Sozhan308 Dec 19, 2024
a0897a6
[flagd-ui]: rename flagdui to flagd-ui (#1840)
puckpuck Dec 19, 2024
4f8ddef
[cart]: rename cartservice to cart (#1839)
puckpuck Dec 19, 2024
37b9ed2
build(deps): bump the go-production-dependencies group across 2 direc…
dependabot[bot] Dec 19, 2024
623c0e4
[paymentservice] Bump dependencies (#1854)
julianocosta89 Dec 19, 2024
fca8fd1
[shipping] rename shippingservice to shipping (#1842)
Sozhan308 Dec 19, 2024
cb75eba
Add a React Native example app to the demo (#1781)
jpmunz Dec 19, 2024
d2caef6
[chore] - update demo dependencies (#1855)
puckpuck Dec 21, 2024
d75a68d
[load-generator] rename loadgenerator to load-generator (#1856)
puckpuck Dec 22, 2024
d5c0efe
[image-provider] rename imageprovider to image-provider (#1857)
puckpuck Dec 22, 2024
e3548c6
[currency] Rename currencyservice to currency (#1858)
puckpuck Dec 22, 2024
5416e18
Merge remote-tracking branch 'origin-otel/main' into merge-upstream-2
rogercoll Dec 23, 2024
969fe3b
[email] rename emailservice to email (#1861)
puckpuck Dec 23, 2024
3868f0e
[fraud-detection] rename frauddetectionservice to fraud-detection (#1…
puckpuck Dec 23, 2024
e965205
fix: services reference name
rogercoll Dec 23, 2024
4c8e43f
[payment] rename paymentservice to payment (#1863)
puckpuck Dec 23, 2024
2210b5b
[recommendation] rename recommendationservice to recommendation (#1865)
puckpuck Dec 23, 2024
19cbfea
[react-native-app] cleanup build instructions (#1860)
puckpuck Dec 23, 2024
7543c59
build(deps): bump the go-production-dependencies group across 2 direc…
dependabot[bot] Dec 24, 2024
c43b84b
Merge remote-tracking branch 'origin/main' into merge-upstream-2
rogercoll Dec 27, 2024
004fdcf
build(deps): bump the go-production-dependencies group across 1 direc…
dependabot[bot] Jan 8, 2025
43c5175
Update dependabot.yml (#1870)
CharlieTLe Jan 8, 2025
5e8133f
build(deps): bump docker/build-push-action from 6.10.0 to 6.11.0 (#1878)
dependabot[bot] Jan 8, 2025
c217f58
build(deps): bump the go-production-dependencies group across 2 direc…
dependabot[bot] Jan 8, 2025
1efe410
Generate proto for C++ (#1871)
CharlieTLe Jan 8, 2025
8cb101d
[product-catalog] rename productcatalogservice to product-catalog (#1…
puckpuck Jan 10, 2025
0a39d44
[checkout] rename checkoutservice to checkout (#1867)
puckpuck Jan 10, 2025
933b7b9
build(deps): bump the nuget-production-dependencies group across 4 di…
dependabot[bot] Jan 10, 2025
9673c12
build(deps): bump the actions-production-dependencies group across 1 …
dependabot[bot] Jan 10, 2025
2f4e30b
build(deps): bump the npm-development-dependencies group across 4 dir…
dependabot[bot] Jan 10, 2025
93991f5
build(deps): bump the composer-production-dependencies group across 1…
dependabot[bot] Jan 10, 2025
1fdc947
Revert "build(deps): bump the composer-production-dependencies group …
julianocosta89 Jan 10, 2025
0c7c104
fix(docker): add workaround for JDK-8345296 on OSX with _JAVA_OPTIONS…
CharlieTLe Jan 13, 2025
d534e42
[chore] drop _SERVICE for dependent service env variables (#1897)
puckpuck Jan 14, 2025
f135bff
build(deps): bump the composer-production-dependencies group across 1…
dependabot[bot] Jan 14, 2025
ea8456f
[frontend-proxy] Rename frontend proxy service (#1910)
puckpuck Jan 14, 2025
b604d28
remove -service and _service suffixes (#1914)
puckpuck Jan 15, 2025
2a73b7f
Merge remote-tracking branch 'origin-otel/main' into merge-upstream-2
rogercoll Jan 15, 2025
b5e2312
fix: docker compose services path
rogercoll Jan 15, 2025
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
Next Next commit
[cartservice] - Add Exemplars to Cart Service (open-telemetry#1830)
* WIP-Add Exemplars to Cart Service

* Bump AspNetCore instrumentation

Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>

* Add source and meter

* Remove logs and add boundaries

* Add HistogramBucketBoundaries

* Drop trailing space

* Apply suggestions from code review

Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>

* changelog

* indent

---------

Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
julianocosta89 and Kielek authored Dec 13, 2024
commit 43f448c61f8ea993603027efad7b9a59dae47f1b
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -7,10 +7,6 @@ the release.

## Unreleased

* [flagd] Update `paymentServiceFailure` to use a list of variants.
* [paymentservice] Add loyalty level attributes to spans.
Added `service.name` to logs.
([#1815](https://github.com/open-telemetry/opentelemetry-demo/pull/1815))
* [grafana] Update grafana to 11.3.0
([#1764](https://github.com/open-telemetry/opentelemetry-demo/pull/1764))
* [chore] Move build args to .env file
@@ -29,8 +25,13 @@ the release.
([#1794](https://github.com/open-telemetry/opentelemetry-demo/pull/1784))
* [paymentservice] Add nodejs instrumentation for runtime metrics
([#1797](https://github.com/open-telemetry/opentelemetry-demo/pull/1797))
* [flagd and paymentservice] Update `paymentServiceFailure` to use a list of
variants and add loyalty level attributes to spans. Added `service.name` to logs.
([#1815](https://github.com/open-telemetry/opentelemetry-demo/pull/1815))
* [accounting] rename accountingservice to accounting
([#1827](https://github.com/open-telemetry/opentelemetry-demo/pull/1827))
* [cartservice] - Add Exemplars to Cart Service
([#1830](https://github.com/open-telemetry/opentelemetry-demo/pull/1830))

## 1.12.0

3 changes: 3 additions & 0 deletions src/cartservice/src/Program.cs
Original file line number Diff line number Diff line change
@@ -61,16 +61,19 @@
builder.Services.AddOpenTelemetry()
.ConfigureResource(appResourceBuilder)
.WithTracing(tracerBuilder => tracerBuilder
.AddSource("OpenTelemetry.Demo.Cart")
.AddRedisInstrumentation(
options => options.SetVerboseDatabaseStatements = true)
.AddAspNetCoreInstrumentation()
.AddGrpcClientInstrumentation()
.AddHttpClientInstrumentation()
.AddOtlpExporter())
.WithMetrics(meterBuilder => meterBuilder
.AddMeter("OpenTelemetry.Demo.Cart")
.AddProcessInstrumentation()
.AddRuntimeInstrumentation()
.AddAspNetCoreInstrumentation()
.SetExemplarFilter(ExemplarFilterType.TraceBased)
.AddOtlpExporter());
OpenFeature.Api.Instance.AddHooks(new TracingHook());
builder.Services.AddGrpc();
28 changes: 14 additions & 14 deletions src/cartservice/src/cartservice.csproj
Original file line number Diff line number Diff line change
@@ -15,22 +15,22 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.AspNetCore" Version="2.66.0" />
<PackageReference Include="Grpc.AspNetCore.HealthChecks" Version="2.66.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.9.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="0.5.0-beta.7" />
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.9.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Resources.Container" Version="1.0.0-beta.9" />
<PackageReference Include="OpenTelemetry.Resources.Host" Version="0.1.0-beta.3" />
<PackageReference Include="StackExchange.Redis" Version="2.8.16" />
<PackageReference Include="Grpc.AspNetCore" Version="2.67.0" />
<PackageReference Include="Grpc.AspNetCore.HealthChecks" Version="2.67.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.10.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.10.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="1.10.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.10.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Resources.Container" Version="1.10.0-beta.1" />
<PackageReference Include="OpenTelemetry.Resources.Host" Version="1.10.0-beta.1" />
<PackageReference Include="StackExchange.Redis" Version="2.8.22" />
<PackageReference Include="OpenFeature.Contrib.Providers.Flagd" Version="0.3.0" />
<PackageReference Include="OpenFeature.Contrib.Hooks.Otel" Version="0.2.0" />
<PackageReference Include="OpenFeature" Version="2.0.0" />
<PackageReference Include="OpenFeature" Version="2.1.0" />
</ItemGroup>

<ItemGroup>
26 changes: 26 additions & 0 deletions src/cartservice/src/cartstore/ValkeyCartStore.cs
Original file line number Diff line number Diff line change
@@ -7,6 +7,8 @@
using StackExchange.Redis;
using Google.Protobuf;
using Microsoft.Extensions.Logging;
using System.Diagnostics.Metrics;
using System.Diagnostics;

namespace cartservice.cartstore;

@@ -23,6 +25,20 @@ public class ValkeyCartStore : ICartStore
private readonly byte[] _emptyCartBytes;
private readonly string _connectionString;

private static readonly ActivitySource CartActivitySource = new("OpenTelemetry.Demo.Cart");
private static readonly Meter CartMeter = new Meter("OpenTelemetry.Demo.Cart");
private static readonly Histogram<long> addItemHistogram = CartMeter.CreateHistogram<long>(
"app.cart.add_item.latency",
advice: new InstrumentAdvice<long>
{
HistogramBucketBoundaries = [ 500000, 600000, 700000, 800000, 900000, 1000000, 1100000 ]
});
private static readonly Histogram<long> getCartHistogram = CartMeter.CreateHistogram<long>(
"app.cart.get_cart.latency",
advice: new InstrumentAdvice<long>
{
HistogramBucketBoundaries = [ 300000, 400000, 500000, 600000, 700000, 800000, 900000 ]
});
private readonly ConfigurationOptions _redisConnectionOptions;

public ValkeyCartStore(ILogger<ValkeyCartStore> logger, string valkeyAddress)
@@ -105,6 +121,7 @@ private void EnsureRedisConnected()

public async Task AddItemAsync(string userId, string productId, int quantity)
{
var stopwatch = Stopwatch.StartNew();
_logger.LogInformation("AddItemAsync called with userId={userId}, productId={productId}, quantity={quantity}", userId, productId, quantity);

try
@@ -146,6 +163,10 @@ public async Task AddItemAsync(string userId, string productId, int quantity)
{
throw new RpcException(new Status(StatusCode.FailedPrecondition, $"Can't access cart storage. {ex}"));
}
finally
{
addItemHistogram.Record(stopwatch.ElapsedTicks);
}
}

public async Task EmptyCartAsync(string userId)
@@ -169,6 +190,7 @@ public async Task EmptyCartAsync(string userId)

public async Task<Oteldemo.Cart> GetCartAsync(string userId)
{
var stopwatch = Stopwatch.StartNew();
_logger.LogInformation("GetCartAsync called with userId={userId}", userId);

try
@@ -192,6 +214,10 @@ public async Task EmptyCartAsync(string userId)
{
throw new RpcException(new Status(StatusCode.FailedPrecondition, $"Can't access cart storage. {ex}"));
}
finally
{
getCartHistogram.Record(stopwatch.ElapsedTicks);
}
}

public bool Ping()
7 changes: 3 additions & 4 deletions src/cartservice/src/services/CartService.cs
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
using System.Threading.Tasks;
using System;
using Grpc.Core;
using OpenTelemetry.Trace;
using cartservice.cartstore;
using OpenFeature;
using Oteldemo;
@@ -41,7 +40,7 @@ public override async Task<Empty> AddItem(AddItemRequest request, ServerCallCont
}
catch (RpcException ex)
{
activity?.RecordException(ex);
activity?.AddException(ex);
activity?.SetStatus(ActivityStatusCode.Error, ex.Message);
throw;
}
@@ -67,7 +66,7 @@ public override async Task<Cart> GetCart(GetCartRequest request, ServerCallConte
}
catch (RpcException ex)
{
activity?.RecordException(ex);
activity?.AddException(ex);
activity?.SetStatus(ActivityStatusCode.Error, ex.Message);
throw;
}
@@ -92,7 +91,7 @@ public override async Task<Empty> EmptyCart(EmptyCartRequest request, ServerCall
}
catch (RpcException ex)
{
Activity.Current?.RecordException(ex);
Activity.Current?.AddException(ex);
Activity.Current?.SetStatus(ActivityStatusCode.Error, ex.Message);
throw;
}
10 changes: 5 additions & 5 deletions src/cartservice/tests/cartservice.tests.csproj
Original file line number Diff line number Diff line change
@@ -5,11 +5,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Net.Client" Version="2.63.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="Grpc.Net.Client" Version="2.67.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.11" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>