diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1af53902e3..51bf0911e9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,12 +7,15 @@ the release.
## Unreleased
+* [accountingservice] convert from Go service to .NET service, uses
+ OpenTelemetry .NET Automatic Instrumentation.
+ ([#1538](https://github.com/open-telemetry/opentelemetry-demo/pull/1538))
+* [frontend] fixed default flagd port for HTTPS connections
+ ([#1609](https://github.com/open-telemetry/opentelemetry-demo/pull/1609))
* [cartservice] bump .NET package to 1.9.0 release
([#1610](https://github.com/open-telemetry/opentelemetry-demo/pull/1610))
* [Valkey] Replace Redis with Valkey
([#1619](https://github.com/open-telemetry/opentelemetry-demo/pull/1619))
-* [frontend] fixed default flagd port for HTTPS connections
- ([#1609](https://github.com/open-telemetry/opentelemetry-demo/pull/1609))
* ([recommendation] updated flag name to match flagd configuration
([#1634](https://github.com/open-telemetry/opentelemetry-demo/pull/1634))
diff --git a/docker-compose.yml b/docker-compose.yml
index bf2c75a3c9..511883c21f 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -29,11 +29,11 @@ services:
deploy:
resources:
limits:
- memory: 20M
+ memory: 50M
restart: unless-stopped
environment:
- KAFKA_SERVICE_ADDR
- - OTEL_EXPORTER_OTLP_ENDPOINT
+ - OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_HTTP}
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=accountingservice
diff --git a/src/accountingservice/AccountingService.csproj b/src/accountingservice/AccountingService.csproj
new file mode 100644
index 0000000000..3a26192587
--- /dev/null
+++ b/src/accountingservice/AccountingService.csproj
@@ -0,0 +1,32 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+ Linux
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/accountingservice/AccountingService.sln b/src/accountingservice/AccountingService.sln
new file mode 100644
index 0000000000..ee5a41ca9f
--- /dev/null
+++ b/src/accountingservice/AccountingService.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.9.34701.34
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccountingService", "AccountingService.csproj", "{C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C66C35E2-DF04-4DCF-8F6A-87B6D6433FF6}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {6340CDDC-E917-4532-A056-5526E0A7BDDA}
+ EndGlobalSection
+EndGlobal
diff --git a/src/accountingservice/Consumer.cs b/src/accountingservice/Consumer.cs
new file mode 100644
index 0000000000..70f9357fea
--- /dev/null
+++ b/src/accountingservice/Consumer.cs
@@ -0,0 +1,93 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+using Confluent.Kafka;
+using Microsoft.Extensions.Logging;
+using Oteldemo;
+
+namespace AccountingService;
+
+internal class Consumer : IDisposable
+{
+ private const string TopicName = "orders";
+
+ private ILogger _logger;
+ private IConsumer _consumer;
+ private bool _isListening;
+
+ public Consumer(ILogger logger)
+ {
+ _logger = logger;
+
+ var servers = Environment.GetEnvironmentVariable("KAFKA_SERVICE_ADDR")
+ ?? throw new ArgumentNullException("KAFKA_SERVICE_ADDR");
+
+ _consumer = BuildConsumer(servers);
+ _consumer.Subscribe(TopicName);
+
+ _logger.LogInformation($"Connecting to Kafka: {servers}");
+ }
+
+ public void StartListening()
+ {
+ _isListening = true;
+
+ try
+ {
+ while (_isListening)
+ {
+ try
+ {
+ var consumeResult = _consumer.Consume();
+
+ ProcessMessage(consumeResult.Message);
+ }
+ catch (ConsumeException e)
+ {
+ _logger.LogError(e, "Consume error: {0}", e.Error.Reason);
+ }
+ }
+ }
+ catch (OperationCanceledException)
+ {
+ _logger.LogInformation("Closing consumer");
+
+ _consumer.Close();
+ }
+ }
+
+ private void ProcessMessage(Message message)
+ {
+ try
+ {
+ var order = OrderResult.Parser.ParseFrom(message.Value);
+
+ Log.OrderReceivedMessage(_logger, order);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Order parsing failed:");
+ }
+ }
+
+ private IConsumer BuildConsumer(string servers)
+ {
+ var conf = new ConsumerConfig
+ {
+ GroupId = $"accountingservice",
+ BootstrapServers = servers,
+ // https://github.com/confluentinc/confluent-kafka-dotnet/tree/07de95ed647af80a0db39ce6a8891a630423b952#basic-consumer-example
+ AutoOffsetReset = AutoOffsetReset.Earliest,
+ EnableAutoCommit = true
+ };
+
+ return new ConsumerBuilder(conf)
+ .Build();
+ }
+
+ public void Dispose()
+ {
+ _isListening = false;
+ _consumer?.Dispose();
+ }
+}
diff --git a/src/accountingservice/Dockerfile b/src/accountingservice/Dockerfile
index 8a1ab6556b..f2410184cc 100644
--- a/src/accountingservice/Dockerfile
+++ b/src/accountingservice/Dockerfile
@@ -1,32 +1,31 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
-
-FROM golang:1.22-alpine AS builder
-
-WORKDIR /usr/src/app
-
-RUN apk update \
- && apk add --no-cache make protobuf-dev
-
-RUN --mount=type=cache,target=/go/pkg/mod/ \
- --mount=type=bind,source=./src/accountingservice/go.sum,target=go.sum \
- --mount=type=bind,source=./src/accountingservice/go.mod,target=go.mod \
- --mount=type=bind,source=./src/accountingservice/tools.go,target=tools.go \
- go mod download \
- && go list -e -f '{{range .Imports}}{{.}} {{end}}' tools.go | CGO_ENABLED=0 xargs go install -mod=readonly
-
-RUN --mount=type=cache,target=/go/pkg/mod/ \
- --mount=type=cache,target=/root/.cache/go-build \
- --mount=type=bind,rw,source=./src/accountingservice,target=. \
- --mount=type=bind,rw,source=./pb,target=./pb \
- protoc -I ./pb ./pb/demo.proto --go_out=./ --go-grpc_out=./ \
- && go build -ldflags "-s -w" -o /go/bin/accountingservice/ ./
-
-FROM alpine
-
-WORKDIR /usr/src/app/
-
-COPY --from=builder /go/bin/accountingservice/ ./
-
-ENTRYPOINT [ "./accountingservice" ]
+FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
+USER app
+WORKDIR /app
+
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+ARG BUILD_CONFIGURATION=Release
+WORKDIR /src
+COPY ["/src/accountingservice/", "AccountingService/"]
+COPY ["/pb/demo.proto", "AccountingService/proto/"]
+RUN dotnet restore "./AccountingService/AccountingService.csproj"
+WORKDIR "/src/AccountingService"
+
+RUN dotnet build "./AccountingService.csproj" -c $BUILD_CONFIGURATION -o /app/build
+
+FROM build AS publish
+ARG BUILD_CONFIGURATION=Release
+RUN dotnet publish "./AccountingService.csproj" --use-current-runtime -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
+
+FROM base AS final
+WORKDIR /app
+COPY --from=publish /app/publish .
+
+USER root
+RUN mkdir -p "/var/log/opentelemetry/dotnet"
+RUN chown app "/var/log/opentelemetry/dotnet"
+USER app
+
+ENTRYPOINT ["./instrument.sh", "dotnet", "AccountingService.dll"]
diff --git a/src/accountingservice/Helpers.cs b/src/accountingservice/Helpers.cs
new file mode 100644
index 0000000000..c757378338
--- /dev/null
+++ b/src/accountingservice/Helpers.cs
@@ -0,0 +1,34 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+using System.Collections;
+
+namespace AccountingService
+{
+ internal static class Helpers
+ {
+ private static List RelevantPrefixes = ["DOTNET_", "CORECLR_", "OTEL_", "KAFKA_"];
+
+ public static IEnumerable FilterRelevant(this IDictionary envs)
+ {
+ foreach (DictionaryEntry env in envs)
+ {
+ foreach (var prefix in RelevantPrefixes)
+ {
+ if (env.Key.ToString()?.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase) ?? false)
+ {
+ yield return env;
+ }
+ }
+ }
+ }
+
+ public static void OutputInOrder(this IEnumerable envs)
+ {
+ foreach (var env in envs.OrderBy(x => x.Key))
+ {
+ Console.WriteLine(env);
+ }
+ }
+ }
+}
diff --git a/src/accountingservice/Log.cs b/src/accountingservice/Log.cs
new file mode 100644
index 0000000000..73bfb3f557
--- /dev/null
+++ b/src/accountingservice/Log.cs
@@ -0,0 +1,16 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+using Microsoft.Extensions.Logging;
+using Oteldemo;
+
+namespace AccountingService
+{
+ internal static partial class Log
+ {
+ [LoggerMessage(
+ Level = LogLevel.Information,
+ Message = "Order details: {@OrderResult}.")]
+ public static partial void OrderReceivedMessage(ILogger logger, OrderResult orderResult);
+ }
+}
diff --git a/src/accountingservice/Program.cs b/src/accountingservice/Program.cs
new file mode 100644
index 0000000000..1f122a7ebc
--- /dev/null
+++ b/src/accountingservice/Program.cs
@@ -0,0 +1,24 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+using AccountingService;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+
+Console.WriteLine("Accounting service started");
+
+Environment.GetEnvironmentVariables()
+ .FilterRelevant()
+ .OutputInOrder();
+
+var host = Host.CreateDefaultBuilder(args)
+ .ConfigureServices(services =>
+ {
+ services.AddSingleton();
+ })
+ .Build();
+
+var consumer = host.Services.GetRequiredService();
+consumer.StartListening();
+
+host.Run();
diff --git a/src/accountingservice/README.md b/src/accountingservice/README.md
index 6cd79fb6ba..9c0f57ef13 100644
--- a/src/accountingservice/README.md
+++ b/src/accountingservice/README.md
@@ -7,7 +7,8 @@ This service consumes new orders from a Kafka topic.
To build the service binary, run:
```sh
-go build -o /go/bin/accountingservice/
+cp pb/demo.proto src/accoutingservice/proto/demo.proto # root context
+dotnet build # accounting service context
```
## Docker Build
@@ -18,22 +19,10 @@ From the root directory, run:
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:
+To bump all dependencies run in Package manager:
```sh
-go get -u -t ./...
-go mod tidy
+Update-Package -ProjectName AccountingService
```
diff --git a/src/accountingservice/go.mod b/src/accountingservice/go.mod
deleted file mode 100644
index 494f8aa8b2..0000000000
--- a/src/accountingservice/go.mod
+++ /dev/null
@@ -1,47 +0,0 @@
-module github.com/open-telemetry/opentelemetry-demo/src/accountingservice
-
-go 1.22
-
-require (
- github.com/IBM/sarama v1.43.2
- github.com/sirupsen/logrus v1.9.3
- go.opentelemetry.io/otel v1.27.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0
- go.opentelemetry.io/otel/sdk v1.27.0
- go.opentelemetry.io/otel/trace v1.27.0
- google.golang.org/grpc v1.64.0
- google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.4.0
- google.golang.org/protobuf v1.34.1
-)
-
-require (
- github.com/cenkalti/backoff/v4 v4.3.0 // indirect
- github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/eapache/go-resiliency v1.6.0 // indirect
- github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
- github.com/eapache/queue v1.1.0 // indirect
- github.com/go-logr/logr v1.4.2 // indirect
- github.com/go-logr/stdr v1.2.2 // indirect
- github.com/golang/snappy v0.0.4 // indirect
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
- github.com/hashicorp/errwrap v1.1.0 // indirect
- github.com/hashicorp/go-multierror v1.1.1 // indirect
- github.com/hashicorp/go-uuid v1.0.3 // indirect
- github.com/jcmturner/aescts/v2 v2.0.0 // indirect
- github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
- github.com/jcmturner/gofork v1.7.6 // indirect
- github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
- github.com/jcmturner/rpc/v2 v2.0.3 // indirect
- github.com/klauspost/compress v1.17.8 // indirect
- github.com/pierrec/lz4/v4 v4.1.21 // indirect
- github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect
- go.opentelemetry.io/otel/metric v1.27.0 // indirect
- go.opentelemetry.io/proto/otlp v1.2.0 // indirect
- golang.org/x/crypto v0.23.0 // indirect
- golang.org/x/net v0.25.0 // indirect
- golang.org/x/sys v0.20.0 // indirect
- golang.org/x/text v0.15.0 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
-)
diff --git a/src/accountingservice/go.sum b/src/accountingservice/go.sum
deleted file mode 100644
index 5c502781bc..0000000000
--- a/src/accountingservice/go.sum
+++ /dev/null
@@ -1,140 +0,0 @@
-github.com/IBM/sarama v1.43.2 h1:HABeEqRUh32z8yzY2hGB/j8mHSzC/HA9zlEjqFNCzSw=
-github.com/IBM/sarama v1.43.2/go.mod h1:Kyo4WkF24Z+1nz7xeVUFWIuKVV8RS3wM8mkvPKMdXFQ=
-github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
-github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
-github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/eapache/go-resiliency v1.6.0 h1:CqGDTLtpwuWKn6Nj3uNUdflaq+/kIPsg0gfNzHton30=
-github.com/eapache/go-resiliency v1.6.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho=
-github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws=
-github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0=
-github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
-github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
-github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
-github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
-github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
-github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
-github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
-github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
-github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
-github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
-github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
-github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
-github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
-github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
-github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
-github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
-github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
-github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
-github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
-github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
-github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
-github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
-github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
-github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
-github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
-github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=
-github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM=
-github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg=
-github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo=
-github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o=
-github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg=
-github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8=
-github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs=
-github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=
-github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc=
-github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=
-github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
-github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
-github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
-github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
-github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
-github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
-github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
-github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
-github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
-go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg=
-go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 h1:R9DE4kQ4k+YtfLI2ULwX82VtNQ2J8yZmA7ZIF/D+7Mc=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0/go.mod h1:OQFyQVrDlbe+R7xrEyDr/2Wr67Ol0hRUgsfA+V5A95s=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ=
-go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik=
-go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak=
-go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI=
-go.opentelemetry.io/otel/sdk v1.27.0/go.mod h1:Ha9vbLwJE6W86YstIywK2xFfPjbWlCuwPtMkKdz/Y4A=
-go.opentelemetry.io/otel/trace v1.27.0 h1:IqYb813p7cmbHk0a5y6pD5JPakbVfftRXABGt5/Rscw=
-go.opentelemetry.io/otel/trace v1.27.0/go.mod h1:6RiD1hkAprV4/q+yd2ln1HG9GoPx39SuvvstaLBl+l4=
-go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94=
-go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A=
-go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
-go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
-golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
-golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
-golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
-golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
-golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
-golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
-golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
-golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
-golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
-golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
-golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
-golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
-golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
-golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw=
-google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
-google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
-google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg=
-google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.4.0 h1:9SxA29VM43MF5Z9dQu694wmY5t8E/Gxr7s+RSxiIDmc=
-google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.4.0/go.mod h1:yZOK5zhQMiALmuweVdIVoQPa6eIJyXn2B9g5dJDhqX4=
-google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
-google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
-gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/src/accountingservice/kafka/consumer.go b/src/accountingservice/kafka/consumer.go
deleted file mode 100644
index 2b1ab2b490..0000000000
--- a/src/accountingservice/kafka/consumer.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright The OpenTelemetry Authors
-// SPDX-License-Identifier: Apache-2.0
-package kafka
-
-import (
- "context"
- pb "github.com/open-telemetry/opentelemetry-demo/src/accountingservice/genproto/oteldemo"
-
- "github.com/IBM/sarama"
- "github.com/sirupsen/logrus"
- "google.golang.org/protobuf/proto"
-)
-
-var (
- Topic = "orders"
- ProtocolVersion = sarama.V3_0_0_0
- GroupID = "accountingservice"
-)
-
-func StartConsumerGroup(ctx context.Context, brokers []string, log *logrus.Logger) (sarama.ConsumerGroup, error) {
- saramaConfig := sarama.NewConfig()
- saramaConfig.Version = ProtocolVersion
- // So we can know the partition and offset of messages.
- saramaConfig.Producer.Return.Successes = true
- saramaConfig.Consumer.Interceptors = []sarama.ConsumerInterceptor{NewOTelInterceptor(GroupID)}
-
- consumerGroup, err := sarama.NewConsumerGroup(brokers, GroupID, saramaConfig)
- if err != nil {
- return nil, err
- }
-
- handler := groupHandler{
- log: log,
- }
-
- err = consumerGroup.Consume(ctx, []string{Topic}, &handler)
- if err != nil {
- return nil, err
- }
-
- return consumerGroup, nil
-}
-
-type groupHandler struct {
- log *logrus.Logger
-}
-
-func (g *groupHandler) Setup(_ sarama.ConsumerGroupSession) error {
- return nil
-}
-
-func (g *groupHandler) Cleanup(_ sarama.ConsumerGroupSession) error {
- return nil
-}
-
-func (g *groupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error {
- for {
- select {
- case message := <-claim.Messages():
- orderResult := pb.OrderResult{}
- err := proto.Unmarshal(message.Value, &orderResult)
- if err != nil {
- return err
- }
-
- g.log.WithFields(logrus.Fields{
- "orderId": orderResult.OrderId,
- "messageTimestamp": message.Timestamp,
- "messageTopic": message.Topic,
- }).Info("Message claimed")
- session.MarkMessage(message, "")
-
- case <-session.Context().Done():
- return nil
- }
- }
-}
diff --git a/src/accountingservice/kafka/trace_interceptor.go b/src/accountingservice/kafka/trace_interceptor.go
deleted file mode 100644
index 91d26539a0..0000000000
--- a/src/accountingservice/kafka/trace_interceptor.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright The OpenTelemetry Authors
-// SPDX-License-Identifier: Apache-2.0
-package kafka
-
-import (
- "context"
- "fmt"
-
- "go.opentelemetry.io/otel"
- "go.opentelemetry.io/otel/attribute"
- "go.opentelemetry.io/otel/propagation"
- semconv "go.opentelemetry.io/otel/semconv/v1.24.0"
- "go.opentelemetry.io/otel/trace"
-
- "github.com/IBM/sarama"
-)
-
-type OTelInterceptor struct {
- tracer trace.Tracer
- fixedAttrs []attribute.KeyValue
-}
-
-// NewOTelInterceptor processes span for intercepted messages and add some
-// headers with the span data.
-func NewOTelInterceptor(groupID string) *OTelInterceptor {
- oi := OTelInterceptor{}
- oi.tracer = otel.Tracer("accountingservice")
-
- oi.fixedAttrs = []attribute.KeyValue{
- semconv.MessagingSystemKafka,
- semconv.MessagingOperationReceive,
- semconv.MessagingKafkaConsumerGroup(groupID),
- semconv.NetworkTransportTCP,
- }
- return &oi
-}
-
-func (oi *OTelInterceptor) OnConsume(msg *sarama.ConsumerMessage) {
- headers := propagation.MapCarrier{}
-
- for _, recordHeader := range msg.Headers {
- headers[string(recordHeader.Key)] = string(recordHeader.Value)
- }
-
- propagator := otel.GetTextMapPropagator()
- ctx := propagator.Extract(context.Background(), headers)
-
- _, span := oi.tracer.Start(
- ctx,
- fmt.Sprintf("%s receive", msg.Topic),
- trace.WithSpanKind(trace.SpanKindConsumer),
- trace.WithAttributes(oi.fixedAttrs...),
- trace.WithAttributes(
- semconv.MessagingDestinationName(msg.Topic),
- semconv.MessagingKafkaMessageOffset(int(msg.Offset)),
- semconv.MessagingMessageBodySize(len(msg.Value)),
- semconv.MessagingOperationReceive,
- semconv.MessagingKafkaDestinationPartition(int(msg.Partition)),
- ),
- )
- defer span.End()
-}
diff --git a/src/accountingservice/main.go b/src/accountingservice/main.go
deleted file mode 100644
index e2eb7a3dd0..0000000000
--- a/src/accountingservice/main.go
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright The OpenTelemetry Authors
-// SPDX-License-Identifier: Apache-2.0
-package main
-
-//go:generate go install google.golang.org/protobuf/cmd/protoc-gen-go
-//go:generate go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
-//go:generate protoc --go_out=./ --go-grpc_out=./ --proto_path=../../pb ../../pb/demo.proto
-
-import (
- "context"
- "fmt"
- "os"
- "os/signal"
- "strings"
- "sync"
- "syscall"
- "time"
-
- "github.com/IBM/sarama"
- "github.com/sirupsen/logrus"
- "go.opentelemetry.io/otel"
- "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
- "go.opentelemetry.io/otel/propagation"
- sdkresource "go.opentelemetry.io/otel/sdk/resource"
- sdktrace "go.opentelemetry.io/otel/sdk/trace"
-
- "github.com/open-telemetry/opentelemetry-demo/src/accountingservice/kafka"
-)
-
-var log *logrus.Logger
-var resource *sdkresource.Resource
-var initResourcesOnce sync.Once
-
-func init() {
- log = logrus.New()
- log.Level = logrus.DebugLevel
- log.Formatter = &logrus.JSONFormatter{
- FieldMap: logrus.FieldMap{
- logrus.FieldKeyTime: "timestamp",
- logrus.FieldKeyLevel: "severity",
- logrus.FieldKeyMsg: "message",
- },
- TimestampFormat: time.RFC3339Nano,
- }
- log.Out = os.Stdout
-}
-
-func initResource() *sdkresource.Resource {
- initResourcesOnce.Do(func() {
- extraResources, _ := sdkresource.New(
- context.Background(),
- sdkresource.WithOS(),
- sdkresource.WithProcess(),
- sdkresource.WithContainer(),
- sdkresource.WithHost(),
- )
- resource, _ = sdkresource.Merge(
- sdkresource.Default(),
- extraResources,
- )
- })
- return resource
-}
-
-func initTracerProvider() (*sdktrace.TracerProvider, error) {
- ctx := context.Background()
-
- exporter, err := otlptracegrpc.New(ctx)
- if err != nil {
- return nil, err
- }
- tp := sdktrace.NewTracerProvider(
- sdktrace.WithBatcher(exporter),
- sdktrace.WithResource(initResource()),
- )
- otel.SetTracerProvider(tp)
- otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
- return tp, nil
-}
-
-func main() {
- tp, err := initTracerProvider()
- if err != nil {
- log.Fatal(err)
- }
- defer func() {
- if err := tp.Shutdown(context.Background()); err != nil {
- log.Printf("Error shutting down tracer provider: %v", err)
- }
- log.Println("Shutdown trace provider")
- }()
-
- var brokers string
- mustMapEnv(&brokers, "KAFKA_SERVICE_ADDR")
-
- brokerList := strings.Split(brokers, ",")
- log.Printf("Kafka brokers: %s", strings.Join(brokerList, ", "))
-
- ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM, syscall.SIGKILL)
- defer cancel()
- var consumerGroup sarama.ConsumerGroup
- if consumerGroup, err = kafka.StartConsumerGroup(ctx, brokerList, log); err != nil {
- log.Fatal(err)
- }
- defer func() {
- if err := consumerGroup.Close(); err != nil {
- log.Printf("Error closing consumer group: %v", err)
- }
- log.Println("Closed consumer group")
- }()
-
- <-ctx.Done()
-
- log.Println("Accounting service exited")
-}
-
-func mustMapEnv(target *string, envKey string) {
- v := os.Getenv(envKey)
- if v == "" {
- panic(fmt.Sprintf("environment variable %q not set", envKey))
- }
- *target = v
-}
diff --git a/src/accountingservice/tools.go b/src/accountingservice/tools.go
deleted file mode 100644
index 3557ee5358..0000000000
--- a/src/accountingservice/tools.go
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright The OpenTelemetry Authors
-// SPDX-License-Identifier: Apache-2.0
-
-//go:build tools
-// +build tools
-
-package tools
-
-// This file follows the recommendation at
-// https://go.dev/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
-// on how to pin tooling dependencies to a go.mod file.
-// This ensures that all systems use the same version of tools in addition to regular dependencies.
-
-import (
- _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc"
- _ "google.golang.org/protobuf/cmd/protoc-gen-go"
-)
diff --git a/test/tracetesting/frontend-service/06-checking-out-cart.yaml b/test/tracetesting/frontend-service/06-checking-out-cart.yaml
index b1372d2597..d8d4748e63 100644
--- a/test/tracetesting/frontend-service/06-checking-out-cart.yaml
+++ b/test/tracetesting/frontend-service/06-checking-out-cart.yaml
@@ -62,8 +62,3 @@ spec:
selector: span[tracetest.span.type="messaging" name="orders publish" messaging.system="kafka" messaging.destination.name="orders" messaging.operation="publish"]
assertions:
- attr:messaging.destination.name = "orders"
- - name: The order was sent to accountability
- # captures the span emitted by Kafka instrumentation for Go
- selector: span[tracetest.span.type="messaging" name="orders receive" messaging.system="kafka" messaging.destination.name="orders" messaging.operation="receive"]
- assertions:
- - attr:name = "orders receive"