Skip to content

Commit

Permalink
rename proto package from hipstershop to oteldemo
Browse files Browse the repository at this point in the history
Wanted to see how much work was involved here, open to alternative names. Figured oteldemo was short and to the point :)

Fixes #638

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten committed Feb 10, 2023
1 parent db4cfd3 commit 2d0a369
Show file tree
Hide file tree
Showing 23 changed files with 105 additions and 70 deletions.
39 changes: 37 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ release.

## Unreleased

* [docs] Drop docs folder as step in migration to OTel website
([#729](https://github.com/open-telemetry/opentelemetry-demo/issues/729))
* rename proto package from hipstershop to oteldemo
([#740](https://github.com/open-telemetry/opentelemetry-demo/pull/740))

## v0.1.0

* The initial code base is donated from a
[fork](https://github.com/julianocosta89/opentelemetry-microservices-demo) of
the [Google microservices
Expand All @@ -19,6 +26,9 @@ significant modifications will be credited to OpenTelemetry Authors.
([#82](https://github.com/open-telemetry/opentelemetry-demo/pull/82))
* Rewrote shipping service in Rust
([#35](https://github.com/open-telemetry/opentelemetry-demo/issues/35))

## v0.2.0

* Added feature flag service implementation
([#141](https://github.com/open-telemetry/opentelemetry-demo/pull/141))
* Added additional attributes to productcatalog service
Expand All @@ -35,6 +45,9 @@ significant modifications will be credited to OpenTelemetry Authors.
([#164](https://github.com/open-telemetry/opentelemetry-demo/pull/164))
* Added Grafana service and enhanced metric experience
([#175](https://github.com/open-telemetry/opentelemetry-demo/pull/175))

## v0.3.0

* Enhanced cart service attributes
([#183](https://github.com/open-telemetry/opentelemetry-demo/pull/183))
* Re-implemented currency service using C++
Expand Down Expand Up @@ -87,12 +100,18 @@ significant modifications will be credited to OpenTelemetry Authors.
([#332](https://github.com/open-telemetry/opentelemetry-demo/pull/332))
* Add `synthetic_request=true` baggage to load generator requests
([#331](https://github.com/open-telemetry/opentelemetry-demo/pull/331))

## v0.4.0

* Add span events to shipping service
([#344](https://github.com/open-telemetry/opentelemetry-demo/pull/344))
* Add PHP quote service
([#345](https://github.com/open-telemetry/opentelemetry-demo/pull/345))
* Improve initial run time, without a build
([#362](https://github.com/open-telemetry/opentelemetry-demo/pull/362))

## v0.5.0

* Add custom span and custom span attributes for Feature Flag Service
([#371](https://github.com/open-telemetry/opentelemetry-demo/pull/371))
* Change Cart Service to be async
Expand All @@ -111,19 +130,28 @@ significant modifications will be credited to OpenTelemetry Authors.
([#409](https://github.com/open-telemetry/opentelemetry-demo/pull/409))
* Added hero scenario metric to Checkout Service on cache leak
([#339](https://github.com/open-telemetry/opentelemetry-demo/pull/339))

## v0.6.0-beta

* Added basic metrics support for recommendation service (Python)
([#416](https://github.com/open-telemetry/opentelemetry-demo/pull/416))
* Added metrics auto-instrumentation + minor metrics refactor for recommendation
service (Python)
[#432](https://github.com/open-telemetry/opentelemetry-demo/pull/432)
* Replaced the Jaeger exporter to the OTLP exporter in the OTel Collector
([#435](https://github.com/open-telemetry/opentelemetry-demo/pull/435))

## v0.6.1-beta

* Set resource memory limits for all services
([#460](https://github.com/open-telemetry/opentelemetry-demo/pull/460))
* Added cache scenario to recommendation service
([#455](https://github.com/open-telemetry/opentelemetry-demo/pull/455))
* Update cartservice Dockerfile to support ARM64
([#439](https://github.com/open-telemetry/opentelemetry-demo/pull/439))

## v0.7.0-beta

* Update shippingservice to add resource data to spans
([#504](https://github.com/open-telemetry/opentelemetry-demo/pull/504))
* Add Envoy as reverse proxy for all user-facing services
Expand All @@ -132,6 +160,9 @@ significant modifications will be credited to OpenTelemetry Authors.
([#513](https://github.com/open-telemetry/opentelemetry-demo/pull/513))
* Added frontend instrumentation exporter custom url
([#512](https://github.com/open-telemetry/opentelemetry-demo/pull/512))

## v1.1.0

* Replaced PHP-CLI to PHP-Apache for a more realistic service
([#563](https://github.com/open-telemetry/opentelemetry-demo/pull/563))
* Optimize currencyservice build time with parallel build jobs
Expand All @@ -140,6 +171,9 @@ significant modifications will be credited to OpenTelemetry Authors.
([#536](https://github.com/open-telemetry/opentelemetry-demo/pull/536))
* Add basic metrics support for payment service
([#583](https://github.com/open-telemetry/opentelemetry-demo/pull/583))

## 1.2.0

* Change ZipCode data type from int to string
([#587](https://github.com/open-telemetry/opentelemetry-demo/pull/587))
* Pass product's `categories` as an input for the Ad service
Expand All @@ -154,6 +188,9 @@ significant modifications will be credited to OpenTelemetry Authors.
([#613](https://github.com/open-telemetry/opentelemetry-demo/pull/613))
* Build Kafka image
([#617](https://github.com/open-telemetry/opentelemetry-demo/pull/617))

## 1.3.0

* Use `frontend-web` as service name for browser/web requests
([#628](https://github.com/open-telemetry/opentelemetry-demo/pull/628))
* Update `quoteservice` to use opentelemetry-php beta release
Expand Down Expand Up @@ -212,7 +249,5 @@ significant modifications will be credited to OpenTelemetry Authors.
([#705](https://github.com/open-telemetry/opentelemetry-demo/pull/705))
* Enable exemplar support in the metrics exporter, Prometheus, and Grafana
([#704](https://github.com/open-telemetry/opentelemetry-demo/pull/704))
* [docs] Drop docs folder as step in migration to OTel website
([#729](https://github.com/open-telemetry/opentelemetry-demo/issues/729))
* Add cross-compilation for shipping service
([#715](https://github.com/open-telemetry/opentelemetry-demo/issues/715))
4 changes: 2 additions & 2 deletions pb/demo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ syntax = "proto3";

import "google/protobuf/timestamp.proto";

package hipstershop;
package oteldemo;

option go_package = "genproto/hipstershop";
option go_package = "genproto/oteldemo";

// -----------------Cart service-----------------

Expand Down
4 changes: 2 additions & 2 deletions src/accountingservice/kafka/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"log"

"github.com/open-telemetry/opentelemetry-demo/src/accountingservice/genproto/hipstershop"
"github.com/open-telemetry/opentelemetry-demo/src/accountingservice/genproto/oteldemo"

"github.com/Shopify/sarama"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -57,7 +57,7 @@ func (g *groupHandler) ConsumeClaim(session sarama.ConsumerGroupSession, claim s
for {
select {
case message := <-claim.Messages():
orderResult := hipstershop.OrderResult{}
orderResult := oteldemo.OrderResult{}
err := proto.Unmarshal(message.Value, &orderResult)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions src/adservice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ To build Ad Service, run:
```

It will create an executable script
`src/adservice/build/install/hipstershop/bin/AdService`.
`src/adservice/build/install/oteldemo/bin/AdService`.

To run the Ad Service:

```sh
export AD_SERVICE_PORT=8080
export FEATURE_FLAG_GRPC_SERVICE_ADDR=featureflagservice:50053
./build/install/hipstershop/bin/AdService
./build/install/oteldemo/bin/AdService
```

### Upgrading Gradle
Expand Down
8 changes: 4 additions & 4 deletions src/adservice/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ googleJavaFormat {
sourceSets {
main {
java {
srcDirs 'hipstershop'
srcDirs 'build/generated/source/proto/main/java/hipstershop'
srcDirs 'build/generated/source/proto/main/grpc/hipstershop'
srcDirs 'oteldemo'
srcDirs 'build/generated/source/proto/main/java/oteldemo'
srcDirs 'build/generated/source/proto/main/grpc/oteldemo'
}
}
}
Expand All @@ -125,7 +125,7 @@ task downloadRepos(type: Copy) {
}

task adService(type: CreateStartScripts) {
mainClass.set('hipstershop.AdService')
mainClass.set('oteldemo.AdService')
applicationName = 'AdService'
outputDir = new File(project.buildDir, 'tmp')
classpath = startScripts.classpath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* limitations under the License.
*/

package hipstershop;
package oteldemo;

import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.Iterables;
import hipstershop.Demo.Ad;
import hipstershop.Demo.AdRequest;
import hipstershop.Demo.AdResponse;
import hipstershop.Demo.GetFlagResponse;
import hipstershop.FeatureFlagServiceGrpc.FeatureFlagServiceBlockingStub;
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 Down Expand Up @@ -130,7 +130,7 @@ private enum AdResponseType {
RANDOM
}

private static class AdServiceImpl extends hipstershop.AdServiceGrpc.AdServiceImplBase {
private static class AdServiceImpl extends oteldemo.AdServiceGrpc.AdServiceImplBase {

private static final String ADSERVICE_FAIL_FEATURE_FLAG = "adServiceFailure";

Expand Down Expand Up @@ -212,7 +212,7 @@ boolean checkAdFailure() {

GetFlagResponse response =
featureFlagServiceStub.getFlag(
hipstershop.Demo.GetFlagRequest.newBuilder()
oteldemo.Demo.GetFlagRequest.newBuilder()
.setName(ADSERVICE_FAIL_FEATURE_FLAG)
.build());
return response.getFlag().getEnabled();
Expand Down
2 changes: 1 addition & 1 deletion src/cartservice/src/cartstore/ICartStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface ICartStore
Task AddItemAsync(string userId, string productId, int quantity);
Task EmptyCartAsync(string userId);

Task<Hipstershop.Cart> GetCartAsync(string userId);
Task<Oteldemo.Cart> GetCartAsync(string userId);

bool Ping();
}
Expand Down
16 changes: 8 additions & 8 deletions src/cartservice/src/cartstore/LocalCartStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ namespace cartservice.cartstore
internal class LocalCartStore : ICartStore
{
// Maps between user and their cart
private ConcurrentDictionary<string, Hipstershop.Cart> userCartItems = new ConcurrentDictionary<string, Hipstershop.Cart>();
private readonly Hipstershop.Cart emptyCart = new Hipstershop.Cart();
private ConcurrentDictionary<string, Oteldemo.Cart> userCartItems = new ConcurrentDictionary<string, Oteldemo.Cart>();
private readonly Oteldemo.Cart emptyCart = new Oteldemo.Cart();

public Task InitializeAsync()
{
Expand All @@ -36,10 +36,10 @@ public Task InitializeAsync()
public Task AddItemAsync(string userId, string productId, int quantity)
{
Console.WriteLine($"AddItemAsync called with userId={userId}, productId={productId}, quantity={quantity}");
var newCart = new Hipstershop.Cart
var newCart = new Oteldemo.Cart
{
UserId = userId,
Items = { new Hipstershop.CartItem { ProductId = productId, Quantity = quantity } }
Items = { new Oteldemo.CartItem { ProductId = productId, Quantity = quantity } }
};
userCartItems.AddOrUpdate(userId, newCart,
(k, exVal) =>
Expand All @@ -52,7 +52,7 @@ public Task AddItemAsync(string userId, string productId, int quantity)
}
else
{
exVal.Items.Add(new Hipstershop.CartItem { ProductId = productId, Quantity = quantity });
exVal.Items.Add(new Oteldemo.CartItem { ProductId = productId, Quantity = quantity });
}

return exVal;
Expand All @@ -67,14 +67,14 @@ public Task EmptyCartAsync(string userId)
eventTags.Add("userId", userId);
Activity.Current?.AddEvent(new ActivityEvent("EmptyCartAsync called.", default, eventTags));

userCartItems[userId] = new Hipstershop.Cart();
userCartItems[userId] = new Oteldemo.Cart();
return Task.CompletedTask;
}

public Task<Hipstershop.Cart> GetCartAsync(string userId)
public Task<Oteldemo.Cart> GetCartAsync(string userId)
{
Console.WriteLine($"GetCartAsync called with userId={userId}");
Hipstershop.Cart cart = null;
Oteldemo.Cart cart = null;
if (!userCartItems.TryGetValue(userId, out cart))
{
Console.WriteLine($"No carts for user {userId}");
Expand Down
18 changes: 9 additions & 9 deletions src/cartservice/src/cartstore/RedisCartStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class RedisCartStore : ICartStore
public RedisCartStore(string redisAddress)
{
// Serialize empty cart into byte array.
var cart = new Hipstershop.Cart();
var cart = new Oteldemo.Cart();
emptyCartBytes = cart.ToByteArray();
connectionString = $"{redisAddress},ssl=false,allowAdmin=true,abortConnect=false";

Expand Down Expand Up @@ -126,20 +126,20 @@ public async Task AddItemAsync(string userId, string productId, int quantity)
// Access the cart from the cache
var value = await db.HashGetAsync(userId, CART_FIELD_NAME);

Hipstershop.Cart cart;
Oteldemo.Cart cart;
if (value.IsNull)
{
cart = new Hipstershop.Cart();
cart = new Oteldemo.Cart();
cart.UserId = userId;
cart.Items.Add(new Hipstershop.CartItem { ProductId = productId, Quantity = quantity });
cart.Items.Add(new Oteldemo.CartItem { ProductId = productId, Quantity = quantity });
}
else
{
cart = Hipstershop.Cart.Parser.ParseFrom(value);
cart = Oteldemo.Cart.Parser.ParseFrom(value);
var existingItem = cart.Items.SingleOrDefault(i => i.ProductId == productId);
if (existingItem == null)
{
cart.Items.Add(new Hipstershop.CartItem { ProductId = productId, Quantity = quantity });
cart.Items.Add(new Oteldemo.CartItem { ProductId = productId, Quantity = quantity });
}
else
{
Expand Down Expand Up @@ -173,7 +173,7 @@ public async Task EmptyCartAsync(string userId)
}
}

public async Task<Hipstershop.Cart> GetCartAsync(string userId)
public async Task<Oteldemo.Cart> GetCartAsync(string userId)
{
Console.WriteLine($"GetCartAsync called with userId={userId}");

Expand All @@ -188,11 +188,11 @@ public async Task EmptyCartAsync(string userId)

if (!value.IsNull)
{
return Hipstershop.Cart.Parser.ParseFrom(value);
return Oteldemo.Cart.Parser.ParseFrom(value);
}

// We decided to return empty cart in cases when user wasn't in the cache before
return new Hipstershop.Cart();
return new Oteldemo.Cart();
}
catch (Exception ex)
{
Expand Down
4 changes: 2 additions & 2 deletions src/cartservice/src/services/CartService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
using System.Threading.Tasks;
using Grpc.Core;
using cartservice.cartstore;
using Hipstershop;
using Oteldemo;

namespace cartservice.services
{
public class CartService : Hipstershop.CartService.CartServiceBase
public class CartService : Oteldemo.CartService.CartServiceBase
{
private readonly static Empty Empty = new Empty();
private readonly ICartStore _cartStore;
Expand Down
4 changes: 2 additions & 2 deletions src/cartservice/tests/CartServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
using System;
using System.Threading.Tasks;
using Grpc.Net.Client;
using Hipstershop;
using Oteldemo;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Extensions.Hosting;
using Xunit;
using static Hipstershop.CartService;
using static Oteldemo.CartService;

namespace cartservice.tests
{
Expand Down
2 changes: 1 addition & 1 deletion src/checkoutservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"

pb "github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/genproto/hipstershop"
pb "github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/genproto/oteldemo"
"github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/kafka"
"github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/money"
)
Expand Down
2 changes: 1 addition & 1 deletion src/checkoutservice/money/money.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package money
import (
"errors"

pb "github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/genproto/hipstershop"
pb "github.com/open-telemetry/opentelemetry-demo/src/checkoutservice/genproto/oteldemo"
)

const (
Expand Down
Loading

0 comments on commit 2d0a369

Please sign in to comment.