From 4dd18450fb2edb1d3793c3e32fd3b7b447f277f1 Mon Sep 17 00:00:00 2001 From: Felix Date: Sat, 22 Jun 2024 19:13:43 +0200 Subject: [PATCH 01/39] [productcatalogservice] Added MongoDB This adds a MongoDB to the demo instead of parsing the JSON before usage. The implementation is not yet perfect but it works for now. Thus far, only docker compose is supported. Things that still need more work are: - The Go application still uses static MongoDB username and password and the hostname and port are also static. This should be changed to use environmental variables instead. - I wasn't able to check whether the healthcheck of the MongoDB works or not. - Is the resource limit too generous? - Should we fix the port inside the MongoDB container to its default value (i.e. change using a secret here to 27017)? --- .env | 6 ++ docker-compose.minimal.yml | 24 ++++++ docker-compose.yml | 24 ++++++ src/productcatalogservice/go.mod | 10 +++ src/productcatalogservice/go.sum | 16 ++++ src/productcatalogservice/main.go | 121 ++++++++++++++++++++++++++++-- 6 files changed, 196 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 8383b2ec71..34d355868e 100644 --- a/.env +++ b/.env @@ -15,6 +15,7 @@ OPENSEARCH_IMAGE=opensearchproject/opensearch:2.14.0 POSTGRES_IMAGE=postgres:16.3 PROMETHEUS_IMAGE=quay.io/prometheus/prometheus:v2.52.0 VALKEY_IMAGE=valkey/valkey:7.2-alpine +MONGO_IMAGE=mongo:8.0.0-rc9 # must also update the version arg in ./test/tracetesting/Dockerfile TRACETEST_IMAGE=kubeshop/tracetest:v1.3.0 @@ -133,6 +134,11 @@ KAFKA_SERVICE_ADDR=kafka:${KAFKA_SERVICE_PORT} VALKEY_PORT=6379 VALKEY_ADDR=valkey-cart:${VALKEY_PORT} +# MongoDB +MONGO_PORT=27017 +MONGO_USERNAME=mongo +MONGO_PASSWORD=mongo_product_catalog + # ******************** # Telemetry Components # ******************** diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index 2f8a5eae88..e8428eac81 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -397,6 +397,8 @@ services: depends_on: otelcol: condition: service_started + mongo: + condition: service_started logging: *logging # Quote service @@ -529,6 +531,28 @@ services: - "${VALKEY_PORT}" logging: *logging + # MongoDB used by Product Catalog Service + mongo: + image: ${MONGO_IMAGE} + container_name: mongodb-catalog + deploy: + resources: + limits: + memory: 256M + restart: unless-stopped + ports: + - "${MONGO_PORT}:${MONGO_PORT}" + environment: + - MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME} + - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD} + healthcheck: + test: echo 'db.runCommand("ping").ok' | mongosh localhost:${MONGO_PORT}/test --quiet + start_period: 10s + interval: 5s + timeout: 10s + retries: 10 + logging: *logging + # ******************** # Telemetry Components diff --git a/docker-compose.yml b/docker-compose.yml index 6bdb0374fe..2167d7268f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -475,6 +475,8 @@ services: condition: service_started flagd: condition: service_started + mongo: + condition: service_started logging: *logging # Quote service @@ -639,6 +641,28 @@ services: - "${VALKEY_PORT}" logging: *logging + # MongoDB used by Product Catalog Service + mongo: + image: ${MONGO_IMAGE} + container_name: mongodb-catalog + deploy: + resources: + limits: + memory: 256M + restart: unless-stopped + ports: + - "${MONGO_PORT}:${MONGO_PORT}" + environment: + - MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME} + - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD} + healthcheck: + test: echo 'db.runCommand("ping").ok' | mongosh localhost:${MONGO_PORT}/test --quiet + start_period: 10s + interval: 5s + timeout: 10s + retries: 10 + logging: *logging + # ******************** # Telemetry Components diff --git a/src/productcatalogservice/go.mod b/src/productcatalogservice/go.mod index 35aaf0a697..d7b536cf86 100644 --- a/src/productcatalogservice/go.mod +++ b/src/productcatalogservice/go.mod @@ -34,28 +34,38 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/zapr v1.3.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.15.9 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect github.com/open-feature/flagd-schemas v0.2.9-0.20240408192555-ea4f119d2bd7 // indirect github.com/open-feature/flagd/core v0.9.2 // indirect github.com/twmb/murmur3 v1.1.8 // indirect + github.com/xdg-go/pbkdf2 v1.0.0 // indirect + github.com/xdg-go/scram v1.1.2 // indirect + github.com/xdg-go/stringprep v1.0.4 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect + github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect github.com/zeebo/xxh3 v1.0.2 // indirect + go.mongodb.org/mongo-driver v1.15.1 // 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 go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.23.0 // indirect golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.25.0 // indirect + golang.org/x/sync v0.7.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 diff --git a/src/productcatalogservice/go.sum b/src/productcatalogservice/go.sum index 38ab689920..0c4d9ec8c3 100644 --- a/src/productcatalogservice/go.sum +++ b/src/productcatalogservice/go.sum @@ -1296,6 +1296,7 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -1395,6 +1396,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -1405,6 +1408,7 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:C github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= +github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= @@ -1435,6 +1439,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= @@ -1501,6 +1507,12 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -1508,6 +1520,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1519,6 +1533,8 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +go.mongodb.org/mongo-driver v1.15.1 h1:l+RvoUOoMXFmADTLfYDm7On9dRm7p4T80/lEQM+r7HU= +go.mongodb.org/mongo-driver v1.15.1/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= diff --git a/src/productcatalogservice/main.go b/src/productcatalogservice/main.go index 2330212d79..5d45052186 100644 --- a/src/productcatalogservice/main.go +++ b/src/productcatalogservice/main.go @@ -44,6 +44,12 @@ import ( "google.golang.org/grpc/reflection" "google.golang.org/grpc/status" "google.golang.org/protobuf/encoding/protojson" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "encoding/json" + "io/ioutil" ) var ( @@ -53,14 +59,119 @@ var ( initResourcesOnce sync.Once ) -func init() { - log = logrus.New() +var mongoClient *mongo.Client + +func initMongoDB() { var err error - catalog, err = readProductFiles() + mongoClient, err = mongo.Connect(context.Background(), options.Client().ApplyURI("mongodb://mongo:mongo_product_catalog@mongo:27017")) // FIXME: hardcoded username and password for now, same with hostname and port of MongoDB + if err != nil { + log.Fatalf("Failed to connect to MongoDB: %v", err) + } else { + log.Println("Successfully connected to MongoDB!") + } +} + +type Price struct { + CurrencyCode string `bson:"currencyCode"` + Units int `bson:"units"` + Nanos int `bson:"nanos"` +} + +type Product struct { + ID string `bson:"id"` + Name string `bson:"name"` + Description string `bson:"description"` + Picture string `bson:"picture"` + PriceUsd Price `bson:"priceUsd"` + Categories []string `bson:"categories"` +} + +func loadProductsIntoMongoDB() { + productsData, err := ioutil.ReadFile("./products/products.json") + if err != nil { + log.Fatalf("Failed to read products.json: %v", err) + } else { + log.Println("Successfully read products.json!") + } + + var products struct { + Products []Product `json:"products"` + } + + err = json.Unmarshal(productsData, &products) if err != nil { - log.Fatalf("Reading Product Files: %v", err) - os.Exit(1) + log.Fatalf("Failed to unmarshal products.json: %v", err) + } else { + log.Println("Successfully unmarshaled products.json!") } + + collection := mongoClient.Database("productCatalog").Collection("products") + for _, product := range products.Products { + _, err = collection.InsertOne(context.Background(), product) + if err != nil { + log.Fatalf("Failed to insert product into MongoDB: %v", err) + } else { + log.Printf("Successfully inserted product with ID: %s into MongoDB!\n", product.ID) + } + } + log.Println("Successfully loaded products into MongoDB!") +} + +func fetchProductsFromMongoDB() ([]Product, error) { + var products []Product + collection := mongoClient.Database("productCatalog").Collection("products") + cursor, err := collection.Find(context.Background(), bson.D{}) + if err != nil { + return nil, err + } + defer cursor.Close(context.Background()) + + for cursor.Next(context.Background()) { + var product Product + if err := cursor.Decode(&product); err != nil { + return nil, err + } + products = append(products, product) + } + + return products, nil +} + +func convertProductsToPbProducts(products []Product) []*pb.Product { + pbProducts := make([]*pb.Product, 0, len(products)) + for _, product := range products { + pbProduct := &pb.Product{ + Id: product.ID, + Name: product.Name, + Description: product.Description, + Picture: product.Picture, + PriceUsd: &pb.Money{ + CurrencyCode: product.PriceUsd.CurrencyCode, + Units: int64(product.PriceUsd.Units), + Nanos: int32(product.PriceUsd.Nanos), + }, + Categories: product.Categories, + } + pbProducts = append(pbProducts, pbProduct) + } + return pbProducts +} + +func init() { + log = logrus.New() + + // Init MongoDB and load products into MongoDB + initMongoDB() + loadProductsIntoMongoDB() + + var err error + var fetechedProducts []Product + fetechedProducts, err = fetchProductsFromMongoDB() + if err != nil { + log.Fatalf("Error while fetching Products from MongoDB: %v", err) + os.Exit(1) + } + catalog = convertProductsToPbProducts(fetechedProducts) } func initResource() *sdkresource.Resource { From 85b53ec4fa9af39553b9c8dfc78840a834e44ad0 Mon Sep 17 00:00:00 2001 From: Felix Date: Sun, 23 Jun 2024 14:32:38 +0200 Subject: [PATCH 02/39] [productcatalogservice] Changed to use env vars This changes the productcatalogservice to use environmental variables for the MongoDB username, password, hostname and port. --- docker-compose.minimal.yml | 4 ++++ docker-compose.yml | 8 ++++++-- src/productcatalogservice/go.mod | 1 + src/productcatalogservice/main.go | 29 +++++++++++++++++++++++------ 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index e8428eac81..1ddb48689a 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -394,6 +394,10 @@ services: - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=productcatalogservice + - MONGO_USERNAME=${MONGO_USERNAME} + - MONGO_PASSWORD=${MONGO_PASSWORD} + - MONGO_HOSTNAME=mongo + - MONGO_PORT=${MONGO_PORT} depends_on: otelcol: condition: service_started diff --git a/docker-compose.yml b/docker-compose.yml index 2167d7268f..0d36bfc27c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -470,6 +470,10 @@ services: - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE - OTEL_RESOURCE_ATTRIBUTES - OTEL_SERVICE_NAME=productcatalogservice + - MONGO_USERNAME=${MONGO_USERNAME} + - MONGO_PASSWORD=${MONGO_PASSWORD} + - MONGO_HOSTNAME=mongo + - MONGO_PORT=${MONGO_PORT} depends_on: otelcol: condition: service_started @@ -651,12 +655,12 @@ services: memory: 256M restart: unless-stopped ports: - - "${MONGO_PORT}:${MONGO_PORT}" + - "${MONGO_PORT}:27017" environment: - MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME} - MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD} healthcheck: - test: echo 'db.runCommand("ping").ok' | mongosh localhost:${MONGO_PORT}/test --quiet + test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet start_period: 10s interval: 5s timeout: 10s diff --git a/src/productcatalogservice/go.mod b/src/productcatalogservice/go.mod index d7b536cf86..72deb81f5f 100644 --- a/src/productcatalogservice/go.mod +++ b/src/productcatalogservice/go.mod @@ -38,6 +38,7 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/joho/godotenv v1.5.1 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.15.9 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect diff --git a/src/productcatalogservice/main.go b/src/productcatalogservice/main.go index 5d45052186..70b6ccf94f 100644 --- a/src/productcatalogservice/main.go +++ b/src/productcatalogservice/main.go @@ -61,13 +61,30 @@ var ( var mongoClient *mongo.Client +func getEnvVariables() string { + // Load environment variables + mongoUsername := os.Getenv("MONGO_USERNAME") + mongoPassword := os.Getenv("MONGO_PASSWORD") + mongoHostname := os.Getenv("MONGO_HOSTNAME") + mongoPort := os.Getenv("MONGO_PORT") + if mongoUsername == "" || mongoPassword == "" || mongoHostname == "" || mongoPort == "" { + log.Fatal("Failed to load environment variables") + } else { + log.Println("Successfully loaded environment variables") + // log.Println("MongoURI: " + "mongodb://" + mongoUsername + ":" + mongoPassword + "@" + mongoHostname + ":" + mongoPort) + } + return "mongodb://" + mongoUsername + ":" + mongoPassword + "@" + mongoHostname + ":" + mongoPort +} + func initMongoDB() { + mongoURI := getEnvVariables() + var err error - mongoClient, err = mongo.Connect(context.Background(), options.Client().ApplyURI("mongodb://mongo:mongo_product_catalog@mongo:27017")) // FIXME: hardcoded username and password for now, same with hostname and port of MongoDB + mongoClient, err = mongo.Connect(context.Background(), options.Client().ApplyURI(mongoURI)) if err != nil { log.Fatalf("Failed to connect to MongoDB: %v", err) } else { - log.Println("Successfully connected to MongoDB!") + log.Println("Successfully connected to MongoDB") } } @@ -91,7 +108,7 @@ func loadProductsIntoMongoDB() { if err != nil { log.Fatalf("Failed to read products.json: %v", err) } else { - log.Println("Successfully read products.json!") + log.Println("Successfully read products.json") } var products struct { @@ -102,7 +119,7 @@ func loadProductsIntoMongoDB() { if err != nil { log.Fatalf("Failed to unmarshal products.json: %v", err) } else { - log.Println("Successfully unmarshaled products.json!") + log.Println("Successfully unmarshaled products.json") } collection := mongoClient.Database("productCatalog").Collection("products") @@ -111,10 +128,10 @@ func loadProductsIntoMongoDB() { if err != nil { log.Fatalf("Failed to insert product into MongoDB: %v", err) } else { - log.Printf("Successfully inserted product with ID: %s into MongoDB!\n", product.ID) + log.Printf("Successfully inserted product with ID: %s into MongoDB", product.ID) } } - log.Println("Successfully loaded products into MongoDB!") + log.Println("Successfully loaded products into MongoDB") } func fetchProductsFromMongoDB() ([]Product, error) { From 159e4d7c122c8600696d4f6de3f24658f5480c48 Mon Sep 17 00:00:00 2001 From: Felix Date: Sun, 23 Jun 2024 15:16:47 +0200 Subject: [PATCH 03/39] [K8s] Added MongoDB *Disclaimer:* this is not working yet! --- kubernetes/opentelemetry-demo.yaml | 83 ++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/kubernetes/opentelemetry-demo.yaml b/kubernetes/opentelemetry-demo.yaml index 3f1516cb7b..1224d5b1e9 100644 --- a/kubernetes/opentelemetry-demo.yaml +++ b/kubernetes/opentelemetry-demo.yaml @@ -8866,6 +8866,29 @@ spec: # Source: opentelemetry-demo/templates/component.yaml apiVersion: v1 kind: Service +metadata: + name: opentelemetry-demo-mongo + labels: + + opentelemetry.io/name: opentelemetry-demo-mongo + app.kubernetes.io/instance: opentelemetry-demo + app.kubernetes.io/component: mongo + app.kubernetes.io/name: opentelemetry-demo-mongo + app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/part-of: opentelemetry-demo +spec: + type: ClusterIP + ports: + - port: 27017 + name: plaintext + targetPort: 27017 + selector: + + opentelemetry.io/name: opentelemetry-demo-mongo +--- +# Source: opentelemetry-demo/templates/component.yaml +apiVersion: v1 +kind: Service metadata: name: opentelemetry-demo-loadgenerator labels: @@ -10307,6 +10330,58 @@ spec: # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 kind: Deployment +metadata: + name: opentelemetry-demo-mongo + labels: + + opentelemetry.io/name: opentelemetry-demo-mongo + app.kubernetes.io/instance: opentelemetry-demo + app.kubernetes.io/component: mongo + app.kubernetes.io/name: opentelemetry-demo-mongo + app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/part-of: opentelemetry-demo +spec: + replicas: 1 + selector: + matchLabels: + + opentelemetry.io/name: opentelemetry-demo-mongo + template: + metadata: + labels: + + opentelemetry.io/name: opentelemetry-demo-mongo + app.kubernetes.io/instance: opentelemetry-demo + app.kubernetes.io/component: mongo + app.kubernetes.io/name: opentelemetry-demo-mongo + spec: + serviceAccountName: opentelemetry-demo + containers: + - name: mongo + image: 'mongo:8.0.0-rc9' + imagePullPolicy: IfNotPresent + ports: + + - containerPort: 27017 + name: plaintext + env: + - name: MONGO_INITDB_ROOT_USERNAME + value: $(MONGO_USERNAME) + - name: MONGO_INITDB_ROOT_PASSWORD + value: $(MONGO_PASSWORD) + resources: + limits: + memory: 256Mi + securityContext: + runAsGroup: 1000 + runAsNonRoot: true + runAsUser: 1000 + volumeMounts: + volumes: +--- +# Source: opentelemetry-demo/templates/component.yaml +apiVersion: apps/v1 +kind: Deployment metadata: name: opentelemetry-demo-loadgenerator labels: @@ -10505,6 +10580,14 @@ spec: value: http://$(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + - name: MONGO_USERNAME + value: $(MONGO_USERNAME) + - name: MONGO_PASSWORD + value: $(MONGO_PASSWORD) + - name: MONGO_HOST + value: 'opentelemetry-demo-mongo' + - name: MONGO_PORT + value: $(MONGO_PORT) resources: limits: memory: 20Mi From 6b4247d6cf216e19c11ac2345378ca918e6d351a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 01:44:50 -0400 Subject: [PATCH 04/39] build(deps): bump docker/build-push-action from 6.0.1 to 6.1.0 (#1620) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.0.1 to 6.1.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v6.0.1...v6.1.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mikko Viitanen <74129181+mviitane@users.noreply.github.com> --- .github/workflows/component_build-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/component_build-images.yml b/.github/workflows/component_build-images.yml index f10d648878..179e8d3d9c 100644 --- a/.github/workflows/component_build-images.yml +++ b/.github/workflows/component_build-images.yml @@ -162,7 +162,7 @@ jobs: max-parallelism = 2 - name: Matrix Build and push demo images if: steps.check_changes.outputs.skip == 'false' - uses: docker/build-push-action@v6.0.1 + uses: docker/build-push-action@v6.1.0 with: context: ${{ matrix.file_tag.context }} file: ${{ matrix.file_tag.file }} From a2e1b1e89c6f1f4b4fe941e0677c5f9591d57c47 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Wed, 26 Jun 2024 11:00:16 +0200 Subject: [PATCH 05/39] fix: emailservice docker compose image (#1630) Co-authored-by: Pierre Tessier --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0d36bfc27c..8662cee7de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -190,7 +190,7 @@ services: # Email service emailservice: - image: demo/emailservice-contrib:latest + image: ${IMAGE_NAME}:${DEMO_VERSION}-emailservice container_name: email-service build: context: ./ From ca23a782c431c2410f340fbac4c65362db5cc876 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Wed, 26 Jun 2024 15:27:41 +0200 Subject: [PATCH 06/39] add collector configs as environment variable (#1632) Co-authored-by: Mikko Viitanen <74129181+mviitane@users.noreply.github.com> --- .env | 2 ++ docker-compose.minimal.yml | 4 ++-- docker-compose.yml | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 34d355868e..95ca5c8be4 100644 --- a/.env +++ b/.env @@ -26,6 +26,8 @@ ENV_PLATFORM=local OTEL_COLLECTOR_HOST=otelcol OTEL_COLLECTOR_PORT_GRPC=4317 OTEL_COLLECTOR_PORT_HTTP=4318 +OTEL_COLLECTOR_CONFIG=./src/otelcollector/otelcol-config.yml +OTEL_COLLECTOR_CONFIG_EXTRAS=./src/otelcollector/otelcol-config-extras.yml OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:${OTEL_COLLECTOR_PORT_GRPC} PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:8080/otlp-http/v1/traces diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index 1ddb48689a..fc591a0912 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -612,8 +612,8 @@ services: restart: unless-stopped command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ] volumes: - - ./src/otelcollector/otelcol-config.yml:/etc/otelcol-config.yml - - ./src/otelcollector/otelcol-config-extras.yml:/etc/otelcol-config-extras.yml + - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml + - ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml ports: - "${OTEL_COLLECTOR_PORT_GRPC}" - "${OTEL_COLLECTOR_PORT_HTTP}" diff --git a/docker-compose.yml b/docker-compose.yml index 8662cee7de..ef0097ba15 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -722,8 +722,8 @@ services: restart: unless-stopped command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ] volumes: - - ./src/otelcollector/otelcol-config.yml:/etc/otelcol-config.yml - - ./src/otelcollector/otelcol-config-extras.yml:/etc/otelcol-config-extras.yml + - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml + - ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml ports: - "${OTEL_COLLECTOR_PORT_GRPC}" - "${OTEL_COLLECTOR_PORT_HTTP}" From 51e485aea3164ec6bc5f6ab37a52fcdc9b452915 Mon Sep 17 00:00:00 2001 From: Sven Kirschbaum Date: Wed, 26 Jun 2024 17:32:53 +0200 Subject: [PATCH 07/39] fix(frontend): Use port 443 as default to connect to flagd if https is in use (#1609) * fix(frontend): Use port 443 as default to connect to flagd if https is in use * chore: Update CHANGELOG.md --------- Co-authored-by: Pierre Tessier --- CHANGELOG.md | 2 ++ src/frontend/pages/_app.tsx | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23c53b3f08..40a7b61d10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ the 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)) ## 1.10.0 diff --git a/src/frontend/pages/_app.tsx b/src/frontend/pages/_app.tsx index 00a7e696b5..e49b51f7c6 100755 --- a/src/frontend/pages/_app.tsx +++ b/src/frontend/pages/_app.tsx @@ -37,12 +37,19 @@ if (typeof window !== 'undefined') { * We connect to flagd through the envoy proxy, straight from the browser, * for this we need to know the current hostname and port. */ + + const useTLS = window.location.protocol === 'https:'; + let port = useTLS ? 443 : 80; + if (window.location.port) { + port = parseInt(window.location.port, 10); + } + OpenFeature.setProvider( new FlagdWebProvider({ host: window.location.hostname, pathPrefix: 'flagservice', - port: window.location.port ? parseInt(window.location.port, 10) : 80, - tls: window.location.protocol === 'https:', + port: port, + tls: useTLS, maxRetries: 3, maxDelay: 10000, }) From 9c1153b5abd4f6ac61120dd201deabf4c20fd568 Mon Sep 17 00:00:00 2001 From: Steve Flanders Date: Thu, 27 Jun 2024 09:13:03 -0400 Subject: [PATCH 08/39] Update recommendation flag to match flagd configuration (#1634) Address #1626 --- CHANGELOG.md | 2 ++ src/recommendationservice/recommendation_server.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40a7b61d10..1af53902e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ the release. ([#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)) ## 1.10.0 diff --git a/src/recommendationservice/recommendation_server.py b/src/recommendationservice/recommendation_server.py index c7302bcac5..1a6826d80d 100644 --- a/src/recommendationservice/recommendation_server.py +++ b/src/recommendationservice/recommendation_server.py @@ -75,7 +75,7 @@ def get_product_list(request_product_ids): request_product_ids = request_product_ids_str.split(',') # Feature flag scenario - Cache Leak - if check_feature_flag("recommendationCache"): + if check_feature_flag("recommendationServiceCacheFailure"): span.set_attribute("app.recommendation.cache_enabled", True) if random.random() < 0.5 or first_run: first_run = False From 31f2e1dfc76affbaa668eac31ad7c44464e8a516 Mon Sep 17 00:00:00 2001 From: Rasmus Kuusmann Date: Thu, 27 Jun 2024 23:31:42 +0300 Subject: [PATCH 09/39] Change AccountService from Go to DotNet (auto) (#1538) * Change AccountService from go to dotnet (auto) * fix path * fix folder name * dockerfile and other fixes * add copyright * fix encoding and cleanup * Cleanup dockerfile * Update OTel Auto * fix kafka processing issues and otel export * remove eof * Update changelog * Use default CancellationDelayMaxMs * update packages * fix merge failure * Fix tracetest 'accountingservice' is not part of the trace anymore --------- Co-authored-by: Juliano Costa Co-authored-by: Juliano Costa --- CHANGELOG.md | 7 +- docker-compose.yml | 4 +- .../AccountingService.csproj | 32 ++++ src/accountingservice/AccountingService.sln | 25 ++++ src/accountingservice/Consumer.cs | 93 ++++++++++++ src/accountingservice/Dockerfile | 57 ++++--- src/accountingservice/Helpers.cs | 34 +++++ src/accountingservice/Log.cs | 16 ++ src/accountingservice/Program.cs | 24 +++ src/accountingservice/README.md | 19 +-- src/accountingservice/go.mod | 47 ------ src/accountingservice/go.sum | 140 ------------------ src/accountingservice/kafka/consumer.go | 77 ---------- .../kafka/trace_interceptor.go | 62 -------- src/accountingservice/main.go | 123 --------------- src/accountingservice/tools.go | 17 --- .../06-checking-out-cart.yaml | 5 - 17 files changed, 263 insertions(+), 519 deletions(-) create mode 100644 src/accountingservice/AccountingService.csproj create mode 100644 src/accountingservice/AccountingService.sln create mode 100644 src/accountingservice/Consumer.cs create mode 100644 src/accountingservice/Helpers.cs create mode 100644 src/accountingservice/Log.cs create mode 100644 src/accountingservice/Program.cs delete mode 100644 src/accountingservice/go.mod delete mode 100644 src/accountingservice/go.sum delete mode 100644 src/accountingservice/kafka/consumer.go delete mode 100644 src/accountingservice/kafka/trace_interceptor.go delete mode 100644 src/accountingservice/main.go delete mode 100644 src/accountingservice/tools.go 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 ef0097ba15..31a7296184 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" From 56571ba459f0ecdcb2238ad9aee06060887fed46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:34:53 -0400 Subject: [PATCH 10/39] build(deps): bump docker/build-push-action from 6.1.0 to 6.2.0 (#1636) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.1.0 to 6.2.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v6.1.0...v6.2.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pierre Tessier --- .github/workflows/component_build-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/component_build-images.yml b/.github/workflows/component_build-images.yml index 179e8d3d9c..c8a33176a9 100644 --- a/.github/workflows/component_build-images.yml +++ b/.github/workflows/component_build-images.yml @@ -162,7 +162,7 @@ jobs: max-parallelism = 2 - name: Matrix Build and push demo images if: steps.check_changes.outputs.skip == 'false' - uses: docker/build-push-action@v6.1.0 + uses: docker/build-push-action@v6.2.0 with: context: ${{ matrix.file_tag.context }} file: ${{ matrix.file_tag.file }} From 8bf3505120449fc3aba51d43770727ac159b36ae Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Fri, 28 Jun 2024 10:23:22 -0400 Subject: [PATCH 11/39] [chore] clarify complete release process (#1638) * clarify complete release process * clarify complete release process * clarify complete release process * clarify complete release process * clarify complete release process --- CONTRIBUTING.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e24c80ed70..c21fe5c3d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -199,14 +199,21 @@ on each other), the owner should try to get people aligned by: ## Making a new release -Maintainers can create a new release when desired by following a few steps. +Maintainers can create a new release when desired by following these steps. -- Create a new Pull Request that updates the `IMAGE_VERSION` environment - variable in `.env` to the _new_ version number. -- [Draft a new +- [Create a new release](https://github.com/open-telemetry/opentelemetry-demo/releases/new), creating a new tag in the format `x.x.x` based on main. Automatically generate release notes. Prepend a summary of the major changes to the release notes. -- Click 'Publish Release'. +- After images for the new release are built and published, create a new Pull + Request that updates the `IMAGE_VERSION` environment variable in `.env` to the + _new_ version number, and update the `CHANGELOG.md` with the new version + leaving the `Unreleased` section for the next release. +- Create a new Pull Request to update the deployment of the demo in the + [OpenTelemetry Helm + Charts](https://github.com/open-telemetry/opentelemetry-helm-charts) repo. +- After the Helm chart is released, create a new Pull Request which updates the + Demo's Kubernetes manifest by running `make generate-kubernetes-manifests` and + committing the changes. [docs]: https://opentelemetry.io/docs/demo/ From 089804d1a4292f47f0aaf79b47f05511031241c2 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Fri, 28 Jun 2024 12:23:07 -0400 Subject: [PATCH 12/39] update to 1.11.0 release (#1639) --- .env | 2 +- CHANGELOG.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 95ca5c8be4..68978b85d1 100644 --- a/.env +++ b/.env @@ -1,7 +1,7 @@ # Demo App version -IMAGE_VERSION=1.10.0 +IMAGE_VERSION=1.11.0 IMAGE_NAME=ghcr.io/open-telemetry/demo DEMO_VERSION=latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 51bf0911e9..8ed0d1876e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ the release. ## Unreleased +## 1.11.0 + * [accountingservice] convert from Go service to .NET service, uses OpenTelemetry .NET Automatic Instrumentation. ([#1538](https://github.com/open-telemetry/opentelemetry-demo/pull/1538)) From 020a14bf014c7e32605e7d0d76d74dbf0e829af3 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Fri, 28 Jun 2024 13:35:20 -0400 Subject: [PATCH 13/39] update to 1.11.0 release (#1640) --- kubernetes/opentelemetry-demo.yaml | 315 +++++++++++++++-------------- 1 file changed, 159 insertions(+), 156 deletions(-) diff --git a/kubernetes/opentelemetry-demo.yaml b/kubernetes/opentelemetry-demo.yaml index 1224d5b1e9..d58a7806e5 100644 --- a/kubernetes/opentelemetry-demo.yaml +++ b/kubernetes/opentelemetry-demo.yaml @@ -46,6 +46,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/version: "1.53.0" app.kubernetes.io/component: all-in-one +automountServiceAccountToken: true --- # Source: opentelemetry-demo/charts/opentelemetry-collector/templates/serviceaccount.yaml apiVersion: v1 @@ -56,7 +57,7 @@ metadata: labels: app.kubernetes.io/name: otelcol app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: "0.102.1" + app.kubernetes.io/version: "0.103.1" --- # Source: opentelemetry-demo/charts/prometheus/templates/serviceaccount.yaml apiVersion: v1 @@ -66,7 +67,7 @@ metadata: app.kubernetes.io/component: server app.kubernetes.io/name: prometheus app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: v2.52.0 + app.kubernetes.io/version: v2.53.0 app.kubernetes.io/part-of: prometheus name: opentelemetry-demo-prometheus-server namespace: otel-demo @@ -83,7 +84,7 @@ metadata: opentelemetry.io/name: opentelemetry-demo app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/name: opentelemetry-demo - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo --- # Source: opentelemetry-demo/charts/grafana/templates/secret.yaml @@ -258,7 +259,7 @@ metadata: labels: app.kubernetes.io/name: otelcol app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: "0.102.1" + app.kubernetes.io/version: "0.103.1" data: relay: | @@ -349,7 +350,7 @@ data: - ${env:MY_POD_IP}:8888 redis: collection_interval: 10s - endpoint: redis-cart:6379 + endpoint: valkey-cart:6379 zipkin: endpoint: ${env:MY_POD_IP}:9411 service: @@ -407,7 +408,7 @@ metadata: app.kubernetes.io/component: server app.kubernetes.io/name: prometheus app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: v2.52.0 + app.kubernetes.io/version: v2.53.0 app.kubernetes.io/part-of: prometheus name: opentelemetry-demo-prometheus-server namespace: otel-demo @@ -455,7 +456,7 @@ metadata: opentelemetry.io/name: opentelemetry-demo app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/name: opentelemetry-demo - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo data: @@ -583,7 +584,7 @@ metadata: opentelemetry.io/name: opentelemetry-demo app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/name: opentelemetry-demo - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo data: @@ -8228,7 +8229,7 @@ metadata: labels: app.kubernetes.io/name: otelcol app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: "0.102.1" + app.kubernetes.io/version: "0.103.1" rules: - apiGroups: [""] @@ -8249,7 +8250,7 @@ metadata: app.kubernetes.io/component: server app.kubernetes.io/name: prometheus app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: v2.52.0 + app.kubernetes.io/version: v2.53.0 app.kubernetes.io/part-of: prometheus name: opentelemetry-demo-prometheus-server rules: @@ -8317,7 +8318,7 @@ metadata: labels: app.kubernetes.io/name: otelcol app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: "0.102.1" + app.kubernetes.io/version: "0.103.1" roleRef: apiGroup: rbac.authorization.k8s.io @@ -8336,7 +8337,7 @@ metadata: app.kubernetes.io/component: server app.kubernetes.io/name: prometheus app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: v2.52.0 + app.kubernetes.io/version: v2.53.0 app.kubernetes.io/part-of: prometheus name: opentelemetry-demo-prometheus-server subjects: @@ -8559,7 +8560,7 @@ metadata: labels: app.kubernetes.io/name: otelcol app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: "0.102.1" + app.kubernetes.io/version: "0.103.1" component: standalone-collector spec: @@ -8613,7 +8614,7 @@ metadata: app.kubernetes.io/component: server app.kubernetes.io/name: prometheus app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: v2.52.0 + app.kubernetes.io/version: v2.53.0 app.kubernetes.io/part-of: prometheus name: opentelemetry-demo-prometheus-server namespace: otel-demo @@ -8641,7 +8642,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: adservice app.kubernetes.io/name: opentelemetry-demo-adservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8664,7 +8665,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: cartservice app.kubernetes.io/name: opentelemetry-demo-cartservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8687,7 +8688,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: checkoutservice app.kubernetes.io/name: opentelemetry-demo-checkoutservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8710,7 +8711,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: currencyservice app.kubernetes.io/name: opentelemetry-demo-currencyservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8733,7 +8734,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: emailservice app.kubernetes.io/name: opentelemetry-demo-emailservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8756,7 +8757,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: flagd app.kubernetes.io/name: opentelemetry-demo-flagd - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8779,7 +8780,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: frontend app.kubernetes.io/name: opentelemetry-demo-frontend - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8802,7 +8803,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: frontendproxy app.kubernetes.io/name: opentelemetry-demo-frontendproxy - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8825,7 +8826,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: imageprovider app.kubernetes.io/name: opentelemetry-demo-imageprovider - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8848,7 +8849,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: kafka app.kubernetes.io/name: opentelemetry-demo-kafka - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8869,7 +8870,7 @@ kind: Service metadata: name: opentelemetry-demo-mongo labels: - + opentelemetry.io/name: opentelemetry-demo-mongo app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: mongo @@ -8883,7 +8884,7 @@ spec: name: plaintext targetPort: 27017 selector: - + opentelemetry.io/name: opentelemetry-demo-mongo --- # Source: opentelemetry-demo/templates/component.yaml @@ -8897,7 +8898,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: loadgenerator app.kubernetes.io/name: opentelemetry-demo-loadgenerator - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8920,7 +8921,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: paymentservice app.kubernetes.io/name: opentelemetry-demo-paymentservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8943,7 +8944,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: productcatalogservice app.kubernetes.io/name: opentelemetry-demo-productcatalogservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8966,7 +8967,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: quoteservice app.kubernetes.io/name: opentelemetry-demo-quoteservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -8989,7 +8990,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: recommendationservice app.kubernetes.io/name: opentelemetry-demo-recommendationservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -9005,47 +9006,47 @@ spec: apiVersion: v1 kind: Service metadata: - name: opentelemetry-demo-redis + name: opentelemetry-demo-shippingservice labels: - opentelemetry.io/name: opentelemetry-demo-redis + opentelemetry.io/name: opentelemetry-demo-shippingservice app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/component: redis - app.kubernetes.io/name: opentelemetry-demo-redis - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/component: shippingservice + app.kubernetes.io/name: opentelemetry-demo-shippingservice + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP ports: - - port: 6379 - name: redis - targetPort: 6379 + - port: 8080 + name: tcp-service + targetPort: 8080 selector: - opentelemetry.io/name: opentelemetry-demo-redis + opentelemetry.io/name: opentelemetry-demo-shippingservice --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: v1 kind: Service metadata: - name: opentelemetry-demo-shippingservice + name: opentelemetry-demo-valkey labels: - opentelemetry.io/name: opentelemetry-demo-shippingservice + opentelemetry.io/name: opentelemetry-demo-valkey app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/component: shippingservice - app.kubernetes.io/name: opentelemetry-demo-shippingservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/component: valkey + app.kubernetes.io/name: opentelemetry-demo-valkey + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP ports: - - port: 8080 - name: tcp-service - targetPort: 8080 + - port: 6379 + name: valkey + targetPort: 6379 selector: - opentelemetry.io/name: opentelemetry-demo-shippingservice + opentelemetry.io/name: opentelemetry-demo-valkey --- # Source: opentelemetry-demo/charts/grafana/templates/deployment.yaml apiVersion: apps/v1 @@ -9218,6 +9219,8 @@ spec: value: "false" - name: COLLECTOR_OTLP_ENABLED value: "true" + securityContext: + {} image: jaegertracing/all-in-one:1.53.0 imagePullPolicy: IfNotPresent name: jaeger @@ -9271,9 +9274,9 @@ spec: memory: 400Mi volumeMounts: securityContext: - runAsUser: 10001 - runAsGroup: 10001 fsGroup: 10001 + runAsGroup: 10001 + runAsUser: 10001 serviceAccountName: opentelemetry-demo-jaeger volumes: --- @@ -9286,7 +9289,7 @@ metadata: labels: app.kubernetes.io/name: otelcol app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: "0.102.1" + app.kubernetes.io/version: "0.103.1" spec: replicas: 1 @@ -9301,7 +9304,7 @@ spec: template: metadata: annotations: - checksum/config: 620cea93751f33591a6682374f7874aff7320c5cdb9685028c00489a14013191 + checksum/config: b9be17aa0a852a337b9b366ce825916eeec9342581384a2a5cff0105dc1cd9db opentelemetry_community_demo: "true" prometheus.io/port: "9464" prometheus.io/scrape: "true" @@ -9321,7 +9324,7 @@ spec: - --config=/conf/relay.yaml securityContext: {} - image: "otel/opentelemetry-collector-contrib:0.102.1" + image: "otel/opentelemetry-collector-contrib:0.103.1" imagePullPolicy: IfNotPresent ports: @@ -9388,7 +9391,7 @@ metadata: app.kubernetes.io/component: server app.kubernetes.io/name: prometheus app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: v2.52.0 + app.kubernetes.io/version: v2.53.0 app.kubernetes.io/part-of: prometheus name: opentelemetry-demo-prometheus-server namespace: otel-demo @@ -9409,7 +9412,7 @@ spec: app.kubernetes.io/component: server app.kubernetes.io/name: prometheus app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/version: v2.52.0 + app.kubernetes.io/version: v2.53.0 app.kubernetes.io/part-of: prometheus spec: enableServiceLinks: true @@ -9417,7 +9420,7 @@ spec: containers: - name: prometheus-server - image: "quay.io/prometheus/prometheus:v2.52.0" + image: "quay.io/prometheus/prometheus:v2.53.0" imagePullPolicy: "IfNotPresent" args: - --storage.tsdb.retention.time=15d @@ -9484,7 +9487,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: accountingservice app.kubernetes.io/name: opentelemetry-demo-accountingservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -9504,7 +9507,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: accountingservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-accountingservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-accountingservice' imagePullPolicy: IfNotPresent env: - name: OTEL_SERVICE_NAME @@ -9521,10 +9524,10 @@ spec: - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: - memory: 20Mi + memory: 50Mi volumeMounts: volumes: initContainers: @@ -9547,7 +9550,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: adservice app.kubernetes.io/name: opentelemetry-demo-adservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -9567,7 +9570,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: adservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-adservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-adservice' imagePullPolicy: IfNotPresent ports: @@ -9594,7 +9597,7 @@ spec: - name: OTEL_LOGS_EXPORTER value: otlp - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 300Mi @@ -9612,7 +9615,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: cartservice app.kubernetes.io/name: opentelemetry-demo-cartservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -9632,7 +9635,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: cartservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-cartservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-cartservice' imagePullPolicy: IfNotPresent ports: @@ -9652,8 +9655,8 @@ spec: value: "8080" - name: ASPNETCORE_URLS value: http://*:$(CART_SERVICE_PORT) - - name: REDIS_ADDR - value: 'opentelemetry-demo-redis:6379' + - name: VALKEY_ADDR + value: 'opentelemetry-demo-valkey:6379' - name: FLAGD_HOST value: 'opentelemetry-demo-flagd' - name: FLAGD_PORT @@ -9661,7 +9664,7 @@ spec: - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 160Mi @@ -9671,10 +9674,10 @@ spec: - command: - sh - -c - - until nc -z -v -w30 opentelemetry-demo-redis 6379; do echo waiting - for redis; sleep 2; done; + - until nc -z -v -w30 opentelemetry-demo-valkey 6379; do echo waiting + for valkey; sleep 2; done; image: busybox:latest - name: wait-for-redis + name: wait-for-valkey --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -9687,7 +9690,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: checkoutservice app.kubernetes.io/name: opentelemetry-demo-checkoutservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -9707,7 +9710,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: checkoutservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-checkoutservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-checkoutservice' imagePullPolicy: IfNotPresent ports: @@ -9746,7 +9749,7 @@ spec: - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 20Mi @@ -9772,7 +9775,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: currencyservice app.kubernetes.io/name: opentelemetry-demo-currencyservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -9792,7 +9795,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: currencyservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-currencyservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-currencyservice' imagePullPolicy: IfNotPresent ports: @@ -9813,9 +9816,9 @@ spec: - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4317 - name: VERSION - value: '1.10.0' + value: '1.11.0' - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 20Mi @@ -9833,7 +9836,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: emailservice app.kubernetes.io/name: opentelemetry-demo-emailservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -9853,7 +9856,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: emailservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-emailservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-emailservice' imagePullPolicy: IfNotPresent ports: @@ -9876,7 +9879,7 @@ spec: - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4318/v1/traces - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 100Mi @@ -9894,7 +9897,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: flagd app.kubernetes.io/name: opentelemetry-demo-flagd - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -9940,7 +9943,7 @@ spec: - name: FLAGD_OTEL_COLLECTOR_URI value: $(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 50Mi @@ -9963,7 +9966,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: frauddetectionservice app.kubernetes.io/name: opentelemetry-demo-frauddetectionservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -9983,7 +9986,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: frauddetectionservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-frauddetectionservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-frauddetectionservice' imagePullPolicy: IfNotPresent env: - name: OTEL_SERVICE_NAME @@ -10004,7 +10007,7 @@ spec: - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4318 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 300Mi @@ -10030,7 +10033,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: frontend app.kubernetes.io/name: opentelemetry-demo-frontend - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -10050,7 +10053,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: frontend - image: 'ghcr.io/open-telemetry/demo:1.10.0-frontend' + image: 'ghcr.io/open-telemetry/demo:1.11.0-frontend' imagePullPolicy: IfNotPresent ports: @@ -10097,7 +10100,7 @@ spec: - name: PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT value: http://localhost:8080/otlp-http/v1/traces - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 250Mi @@ -10119,7 +10122,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: frontendproxy app.kubernetes.io/name: opentelemetry-demo-frontendproxy - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -10139,7 +10142,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: frontendproxy - image: 'ghcr.io/open-telemetry/demo:1.10.0-frontendproxy' + image: 'ghcr.io/open-telemetry/demo:1.11.0-frontendproxy' imagePullPolicy: IfNotPresent ports: @@ -10188,7 +10191,7 @@ spec: - name: OTEL_COLLECTOR_PORT_HTTP value: "4318" - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 50Mi @@ -10210,7 +10213,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: imageprovider app.kubernetes.io/name: opentelemetry-demo-imageprovider - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -10230,7 +10233,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: imageprovider - image: 'ghcr.io/open-telemetry/demo:1.10.0-imageprovider' + image: 'ghcr.io/open-telemetry/demo:1.11.0-imageprovider' imagePullPolicy: IfNotPresent ports: @@ -10253,7 +10256,7 @@ spec: - name: OTEL_COLLECTOR_HOST value: $(OTEL_COLLECTOR_NAME) - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 50Mi @@ -10271,7 +10274,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: kafka app.kubernetes.io/name: opentelemetry-demo-kafka - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -10291,7 +10294,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: kafka - image: 'ghcr.io/open-telemetry/demo:1.10.0-kafka' + image: 'ghcr.io/open-telemetry/demo:1.11.0-kafka' imagePullPolicy: IfNotPresent ports: @@ -10316,7 +10319,7 @@ spec: - name: KAFKA_HEAP_OPTS value: -Xmx400M -Xms400M - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 600Mi @@ -10333,7 +10336,7 @@ kind: Deployment metadata: name: opentelemetry-demo-mongo labels: - + opentelemetry.io/name: opentelemetry-demo-mongo app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: mongo @@ -10344,12 +10347,12 @@ spec: replicas: 1 selector: matchLabels: - + opentelemetry.io/name: opentelemetry-demo-mongo template: metadata: labels: - + opentelemetry.io/name: opentelemetry-demo-mongo app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: mongo @@ -10361,7 +10364,7 @@ spec: image: 'mongo:8.0.0-rc9' imagePullPolicy: IfNotPresent ports: - + - containerPort: 27017 name: plaintext env: @@ -10390,7 +10393,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: loadgenerator app.kubernetes.io/name: opentelemetry-demo-loadgenerator - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -10410,7 +10413,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: loadgenerator - image: 'ghcr.io/open-telemetry/demo:1.10.0-loadgenerator' + image: 'ghcr.io/open-telemetry/demo:1.11.0-loadgenerator' imagePullPolicy: IfNotPresent ports: @@ -10449,7 +10452,7 @@ spec: - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 1Gi @@ -10467,7 +10470,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: paymentservice app.kubernetes.io/name: opentelemetry-demo-paymentservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -10487,7 +10490,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: paymentservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-paymentservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-paymentservice' imagePullPolicy: IfNotPresent ports: @@ -10512,7 +10515,7 @@ spec: - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 120Mi @@ -10534,7 +10537,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: productcatalogservice app.kubernetes.io/name: opentelemetry-demo-productcatalogservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -10554,7 +10557,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: productcatalogservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-productcatalogservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-productcatalogservice' imagePullPolicy: IfNotPresent ports: @@ -10579,7 +10582,7 @@ spec: - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 - name: MONGO_USERNAME value: $(MONGO_USERNAME) - name: MONGO_PASSWORD @@ -10605,7 +10608,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: quoteservice app.kubernetes.io/name: opentelemetry-demo-quoteservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -10625,7 +10628,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: quoteservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-quoteservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-quoteservice' imagePullPolicy: IfNotPresent ports: @@ -10648,7 +10651,7 @@ spec: - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4318 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 40Mi @@ -10670,7 +10673,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: recommendationservice app.kubernetes.io/name: opentelemetry-demo-recommendationservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 @@ -10690,7 +10693,7 @@ spec: serviceAccountName: opentelemetry-demo containers: - name: recommendationservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-recommendationservice' + image: 'ghcr.io/open-telemetry/demo:1.11.0-recommendationservice' imagePullPolicy: IfNotPresent ports: @@ -10721,7 +10724,7 @@ spec: - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://$(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 500Mi @@ -10732,39 +10735,39 @@ spec: apiVersion: apps/v1 kind: Deployment metadata: - name: opentelemetry-demo-redis + name: opentelemetry-demo-shippingservice labels: - opentelemetry.io/name: opentelemetry-demo-redis + opentelemetry.io/name: opentelemetry-demo-shippingservice app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/component: redis - app.kubernetes.io/name: opentelemetry-demo-redis - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/component: shippingservice + app.kubernetes.io/name: opentelemetry-demo-shippingservice + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 selector: matchLabels: - opentelemetry.io/name: opentelemetry-demo-redis + opentelemetry.io/name: opentelemetry-demo-shippingservice template: metadata: labels: - opentelemetry.io/name: opentelemetry-demo-redis + opentelemetry.io/name: opentelemetry-demo-shippingservice app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/component: redis - app.kubernetes.io/name: opentelemetry-demo-redis + app.kubernetes.io/component: shippingservice + app.kubernetes.io/name: opentelemetry-demo-shippingservice spec: serviceAccountName: opentelemetry-demo containers: - - name: redis - image: 'redis:7.2-alpine' + - name: shippingservice + image: 'ghcr.io/open-telemetry/demo:1.11.0-shippingservice' imagePullPolicy: IfNotPresent ports: - - containerPort: 6379 - name: redis + - containerPort: 8080 + name: service env: - name: OTEL_SERVICE_NAME valueFrom: @@ -10775,15 +10778,17 @@ spec: value: 'opentelemetry-demo-otelcol' - name: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE value: cumulative + - name: SHIPPING_SERVICE_PORT + value: "8080" + - name: QUOTE_SERVICE_ADDR + value: http://opentelemetry-demo-quoteservice:8080 + - name: OTEL_EXPORTER_OTLP_ENDPOINT + value: http://$(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 20Mi - securityContext: - runAsGroup: 1000 - runAsNonRoot: true - runAsUser: 999 volumeMounts: volumes: --- @@ -10791,39 +10796,39 @@ spec: apiVersion: apps/v1 kind: Deployment metadata: - name: opentelemetry-demo-shippingservice + name: opentelemetry-demo-valkey labels: - opentelemetry.io/name: opentelemetry-demo-shippingservice + opentelemetry.io/name: opentelemetry-demo-valkey app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/component: shippingservice - app.kubernetes.io/name: opentelemetry-demo-shippingservice - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/component: valkey + app.kubernetes.io/name: opentelemetry-demo-valkey + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: replicas: 1 selector: matchLabels: - opentelemetry.io/name: opentelemetry-demo-shippingservice + opentelemetry.io/name: opentelemetry-demo-valkey template: metadata: labels: - opentelemetry.io/name: opentelemetry-demo-shippingservice + opentelemetry.io/name: opentelemetry-demo-valkey app.kubernetes.io/instance: opentelemetry-demo - app.kubernetes.io/component: shippingservice - app.kubernetes.io/name: opentelemetry-demo-shippingservice + app.kubernetes.io/component: valkey + app.kubernetes.io/name: opentelemetry-demo-valkey spec: serviceAccountName: opentelemetry-demo containers: - - name: shippingservice - image: 'ghcr.io/open-telemetry/demo:1.10.0-shippingservice' + - name: valkey + image: 'valkey/valkey:7.2-alpine' imagePullPolicy: IfNotPresent ports: - - containerPort: 8080 - name: service + - containerPort: 6379 + name: valkey env: - name: OTEL_SERVICE_NAME valueFrom: @@ -10834,17 +10839,15 @@ spec: value: 'opentelemetry-demo-otelcol' - name: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE value: cumulative - - name: SHIPPING_SERVICE_PORT - value: "8080" - - name: QUOTE_SERVICE_ADDR - value: http://opentelemetry-demo-quoteservice:8080 - - name: OTEL_EXPORTER_OTLP_ENDPOINT - value: http://$(OTEL_COLLECTOR_NAME):4317 - name: OTEL_RESOURCE_ATTRIBUTES - value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0 + value: service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.11.0 resources: limits: memory: 20Mi + securityContext: + runAsGroup: 1000 + runAsNonRoot: true + runAsUser: 999 volumeMounts: volumes: --- From 5e3c66b02011b9fbe01f93d70d5882e9e16253d1 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Mon, 1 Jul 2024 15:12:57 -0400 Subject: [PATCH 14/39] [chore] update demo role memberships (#1649) * update demo role membership * update demo role membership --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 349ee211f4..414ffd9215 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,6 @@ Monday at 8:30 AM PST and anyone is welcome. [Maintainers](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer) ([@open-telemetry/demo-maintainers](https://github.com/orgs/open-telemetry/teams/demo-maintainers)): -- [Austin Parker](https://github.com/austinlparker), Honeycomb - [Juliano Costa](https://github.com/julianocosta89), Datadog - [Mikko Viitanen](https://github.com/mviitane), Dynatrace - [Pierre Tessier](https://github.com/puckpuck), Honeycomb @@ -89,10 +88,12 @@ Monday at 8:30 AM PST and anyone is welcome. - [Cedric Ziel](https://github.com/cedricziel) Grafana Labs - [Penghan Wang](https://github.com/wph95), AppDynamics - [Reiley Yang](https://github.com/reyang), Microsoft +- [Roger Coll](https://github.com/rogercoll), Elastic - [Ziqi Zhao](https://github.com/fatsheep9146), Alibaba Emeritus: +- [Austin Parker](https://github.com/austinlparker) - [Carter Socha](https://github.com/cartersocha) - [Michael Maxwell](https://github.com/mic-max) - [Morgan McLean](https://github.com/mtwo) From 96da6ca263f7d07ea80fcf52662ee2f76ff2cd1c Mon Sep 17 00:00:00 2001 From: Juliano Costa Date: Tue, 2 Jul 2024 11:05:10 -0400 Subject: [PATCH 15/39] [otel-col] Add docker stats receiver (#1650) * Add docker stats receiver * changelog * Nit: prevent write access to the Docker socket Co-authored-by: Roger Coll * Add compose minimal --------- Co-authored-by: Roger Coll --- .env | 1 + CHANGELOG.md | 4 +++- docker-compose.minimal.yml | 2 ++ docker-compose.yml | 2 ++ src/otelcollector/otelcol-config.yml | 12 +++++++++++- 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 68978b85d1..9053335d12 100644 --- a/.env +++ b/.env @@ -23,6 +23,7 @@ TRACETEST_IMAGE=kubeshop/tracetest:v1.3.0 ENV_PLATFORM=local # OpenTelemetry Collector +DOCKER_SOCK=/var/run/docker.sock OTEL_COLLECTOR_HOST=otelcol OTEL_COLLECTOR_PORT_GRPC=4317 OTEL_COLLECTOR_PORT_HTTP=4318 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed0d1876e..2cfc180f36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,10 @@ the 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)) -* ([recommendation] updated flag name to match flagd configuration +* [recommendation] updated flag name to match flagd configuration ([#1634](https://github.com/open-telemetry/opentelemetry-demo/pull/1634)) +* [otel-col] Add docker stats receiver + ([#1650](https://github.com/open-telemetry/opentelemetry-demo/pull/1650)) ## 1.10.0 diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index fc591a0912..3952c2148a 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -611,7 +611,9 @@ services: memory: 200M restart: unless-stopped command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ] + user: 0:0 volumes: + - ${DOCKER_SOCK}:/var/run/docker.sock:ro - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml - ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml ports: diff --git a/docker-compose.yml b/docker-compose.yml index 31a7296184..25b1940935 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -721,7 +721,9 @@ services: memory: 200M restart: unless-stopped command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ] + user: 0:0 volumes: + - ${DOCKER_SOCK}:/var/run/docker.sock:ro - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml - ${OTEL_COLLECTOR_CONFIG_EXTRAS}:/etc/otelcol-config-extras.yml ports: diff --git a/src/otelcollector/otelcol-config.yml b/src/otelcollector/otelcol-config.yml index f8a34399cd..8901737b5c 100644 --- a/src/otelcollector/otelcol-config.yml +++ b/src/otelcollector/otelcol-config.yml @@ -13,10 +13,20 @@ receivers: httpcheck/frontendproxy: targets: - endpoint: http://frontendproxy:${env:ENVOY_PORT} + docker_stats: + endpoint: unix:///var/run/docker.sock redis: endpoint: "valkey-cart:6379" username: "valkey" collection_interval: 10s + # Collector metrics + prometheus: + config: + scrape_configs: + - job_name: 'otelcol' + scrape_interval: 10s + static_configs: + - targets: ['0.0.0.0:8888'] exporters: debug: @@ -48,7 +58,7 @@ service: processors: [batch] exporters: [otlp, debug, spanmetrics] metrics: - receivers: [httpcheck/frontendproxy, redis, otlp, spanmetrics] + receivers: [docker_stats, httpcheck/frontendproxy, otlp, prometheus, redis, spanmetrics] processors: [batch] exporters: [otlphttp/prometheus, debug] logs: From 1ea7b68b25e02bb333f5562186605dc122558ec1 Mon Sep 17 00:00:00 2001 From: Roger Coll Date: Tue, 2 Jul 2024 17:32:31 +0200 Subject: [PATCH 16/39] add Kafka Dockerfile env variable (#1652) Co-authored-by: Pierre Tessier --- .env | 1 + docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 9053335d12..d28e51347d 100644 --- a/.env +++ b/.env @@ -132,6 +132,7 @@ FLAGD_PORT=8013 # Kafka KAFKA_SERVICE_PORT=9092 KAFKA_SERVICE_ADDR=kafka:${KAFKA_SERVICE_PORT} +KAFKA_SERVICE_DOCKERFILE=./src/kafka/Dockerfile # Valkey VALKEY_PORT=6379 diff --git a/docker-compose.yml b/docker-compose.yml index 25b1940935..29fa9ad1fb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -608,7 +608,7 @@ services: container_name: kafka build: context: ./ - dockerfile: ./src/kafka/Dockerfile + dockerfile: ${KAFKA_SERVICE_DOCKERFILE} cache_from: - ${IMAGE_NAME}:${IMAGE_VERSION}-kafka deploy: From c4fb5efdb7b29b982fd471bbdb9fd4f8cb1251c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 10:22:48 -0400 Subject: [PATCH 17/39] build(deps): bump docker/build-push-action from 6.2.0 to 6.3.0 (#1656) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.2.0 to 6.3.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v6.2.0...v6.3.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/component_build-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/component_build-images.yml b/.github/workflows/component_build-images.yml index c8a33176a9..dd2df9fa39 100644 --- a/.github/workflows/component_build-images.yml +++ b/.github/workflows/component_build-images.yml @@ -162,7 +162,7 @@ jobs: max-parallelism = 2 - name: Matrix Build and push demo images if: steps.check_changes.outputs.skip == 'false' - uses: docker/build-push-action@v6.2.0 + uses: docker/build-push-action@v6.3.0 with: context: ${{ matrix.file_tag.context }} file: ${{ matrix.file_tag.file }} From c921c1e3095f89d4b1402c254d5c98d69ffe2cf4 Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Mon, 8 Jul 2024 10:04:36 +0200 Subject: [PATCH 18/39] Simplify error scenario logic (#1657) * remove fractional config from rule definition Signed-off-by: Michael Beemer * add random failure logic to ad service Signed-off-by: Michael Beemer * add random failure logic to cart service Signed-off-by: Michael Beemer --------- Signed-off-by: Michael Beemer --- .../src/main/java/oteldemo/AdService.java | 3 +- src/cartservice/src/services/CartService.cs | 5 ++- src/flagd/demo.flagd.json | 32 ++++++++----------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/adservice/src/main/java/oteldemo/AdService.java b/src/adservice/src/main/java/oteldemo/AdService.java index 5f03996896..c55b663bf1 100644 --- a/src/adservice/src/main/java/oteldemo/AdService.java +++ b/src/adservice/src/main/java/oteldemo/AdService.java @@ -201,7 +201,8 @@ public void getAds(AdRequest req, StreamObserver responseObserver) { Attributes.of( adRequestTypeKey, adRequestType.name(), adResponseTypeKey, adResponseType.name())); - if (ffClient.getBooleanValue(ADSERVICE_FAILURE, false, evaluationContext)) { + // Throw 1/10 of the time to simulate a failure when the feature flag is enabled + if (ffClient.getBooleanValue(ADSERVICE_FAILURE, false, evaluationContext) && random.nextInt(10) == 0) { throw new StatusRuntimeException(Status.UNAVAILABLE); } diff --git a/src/cartservice/src/services/CartService.cs b/src/cartservice/src/services/CartService.cs index e20bb86d6b..ff0b32153a 100644 --- a/src/cartservice/src/services/CartService.cs +++ b/src/cartservice/src/services/CartService.cs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 using System.Diagnostics; using System.Threading.Tasks; +using System; using Grpc.Core; using OpenTelemetry.Trace; using cartservice.cartstore; @@ -13,6 +14,7 @@ namespace cartservice.services; public class CartService : Oteldemo.CartService.CartServiceBase { private static readonly Empty Empty = new(); + private readonly Random random = new Random(); private readonly ICartStore _badCartStore; private readonly ICartStore _cartStore; private readonly IFeatureClient _featureFlagHelper; @@ -60,7 +62,8 @@ public override async Task EmptyCart(EmptyCartRequest request, ServerCall try { - if (await _featureFlagHelper.GetBooleanValue("cartServiceFailure", false)) + // Throw 1/10 of the time to simulate a failure when the feature flag is enabled + if (await _featureFlagHelper.GetBooleanValue("cartServiceFailure", false) && random.Next(10) == 0) { await _badCartStore.EmptyCartAsync(request.UserId); } diff --git a/src/flagd/demo.flagd.json b/src/flagd/demo.flagd.json index 626d02cfcf..2d46891ef2 100644 --- a/src/flagd/demo.flagd.json +++ b/src/flagd/demo.flagd.json @@ -23,19 +23,19 @@ "description": "Triggers full manual garbage collections in the ad service", "state": "ENABLED", "variants": { - "on": true, - "off": false - }, - "defaultVariant": "off" + "on": true, + "off": false + }, + "defaultVariant": "off" }, "adServiceHighCpu": { "description": "Triggers high cpu load in the ad service", "state": "ENABLED", "variants": { - "on": true, - "off": false - }, - "defaultVariant": "off" + "on": true, + "off": false + }, + "defaultVariant": "off" }, "adServiceFailure": { "description": "Fail ad service", @@ -44,22 +44,16 @@ "on": true, "off": false }, - "defaultVariant": "off", - "targeting": { - "fractional": [ - ["on", 10], - ["off", 90] - ] - } + "defaultVariant": "off" }, "kafkaQueueProblems": { "description": "Overloads Kafka queue while simultaneously introducing a consumer side delay leading to a lag spike", "state": "ENABLED", "variants": { - "on": 100, - "off": 0 - }, - "defaultVariant": "off" + "on": 100, + "off": 0 + }, + "defaultVariant": "off" }, "cartServiceFailure": { "description": "Fail cart service", From c85f722ae471dd520d1e703f53bf70734992f488 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Mon, 8 Jul 2024 13:05:57 -0400 Subject: [PATCH 19/39] [tests] - optimize trace testing (#1659) * optimize trace testing * run trace based tests concurrently * fix lint failures --------- Co-authored-by: Juliano Costa --- CHANGELOG.md | 3 + Makefile | 22 +-- docker-compose-tests.yml | 128 ++++++++++++++++++ docker-compose-tests_include-override.yml | 12 ++ docker-compose.yml | 128 ------------------ .../{ad-service => adservice}/all.yaml | 0 .../{ad-service => adservice}/get.yaml | 0 .../add-item-to-cart.yaml | 0 .../{cart-service => cartservice}/all.yaml | 0 .../check-if-cart-is-empty.yaml | 0 .../check-if-cart-is-populated.yaml | 0 .../empty-cart.yaml | 0 .../all.yaml | 0 .../place-order.yaml | 0 .../all.yaml | 0 .../convert.yaml | 0 .../supported.yaml | 0 .../{email-service => emailservice}/all.yaml | 0 .../confirmation.yaml | 0 .../01-see-ads.yaml | 0 .../02-get-product-recommendation.yaml | 0 .../03-browse-product.yaml | 0 .../04-add-product-to-cart.yaml | 0 .../05-view-cart.yaml | 0 .../06-checking-out-cart.yaml | 0 .../{frontend-service => frontend}/all.yaml | 0 .../tracetesting/otelcol-config-tracetest.yml | 14 ++ .../all.yaml | 0 .../amex-credit-card-not-allowed.yaml | 0 .../expired-credit-card.yaml | 0 .../invalid-credit-card.yaml | 0 .../valid-credit-card.yaml | 0 .../all.yaml | 0 .../get.yaml | 0 .../list.yaml | 0 .../search.yaml | 0 .../all.yaml | 0 .../list.yaml | 0 test/tracetesting/run.bash | 52 ++++--- .../all.yaml | 0 .../empty-quote.yaml | 0 .../order.yaml | 0 .../quote.yaml | 0 test/tracetesting/tracetest-provision.yaml | 12 +- 44 files changed, 203 insertions(+), 168 deletions(-) create mode 100644 docker-compose-tests.yml create mode 100644 docker-compose-tests_include-override.yml rename test/tracetesting/{ad-service => adservice}/all.yaml (100%) rename test/tracetesting/{ad-service => adservice}/get.yaml (100%) rename test/tracetesting/{cart-service => cartservice}/add-item-to-cart.yaml (100%) rename test/tracetesting/{cart-service => cartservice}/all.yaml (100%) rename test/tracetesting/{cart-service => cartservice}/check-if-cart-is-empty.yaml (100%) rename test/tracetesting/{cart-service => cartservice}/check-if-cart-is-populated.yaml (100%) rename test/tracetesting/{cart-service => cartservice}/empty-cart.yaml (100%) rename test/tracetesting/{checkout-service => checkoutservice}/all.yaml (100%) rename test/tracetesting/{checkout-service => checkoutservice}/place-order.yaml (100%) rename test/tracetesting/{currency-service => currencyservice}/all.yaml (100%) rename test/tracetesting/{currency-service => currencyservice}/convert.yaml (100%) rename test/tracetesting/{currency-service => currencyservice}/supported.yaml (100%) rename test/tracetesting/{email-service => emailservice}/all.yaml (100%) rename test/tracetesting/{email-service => emailservice}/confirmation.yaml (100%) rename test/tracetesting/{frontend-service => frontend}/01-see-ads.yaml (100%) rename test/tracetesting/{frontend-service => frontend}/02-get-product-recommendation.yaml (100%) rename test/tracetesting/{frontend-service => frontend}/03-browse-product.yaml (100%) rename test/tracetesting/{frontend-service => frontend}/04-add-product-to-cart.yaml (100%) rename test/tracetesting/{frontend-service => frontend}/05-view-cart.yaml (100%) rename test/tracetesting/{frontend-service => frontend}/06-checking-out-cart.yaml (100%) rename test/tracetesting/{frontend-service => frontend}/all.yaml (100%) create mode 100644 test/tracetesting/otelcol-config-tracetest.yml rename test/tracetesting/{payment-service => paymentservice}/all.yaml (100%) rename test/tracetesting/{payment-service => paymentservice}/amex-credit-card-not-allowed.yaml (100%) rename test/tracetesting/{payment-service => paymentservice}/expired-credit-card.yaml (100%) rename test/tracetesting/{payment-service => paymentservice}/invalid-credit-card.yaml (100%) rename test/tracetesting/{payment-service => paymentservice}/valid-credit-card.yaml (100%) rename test/tracetesting/{product-catalog-service => productcatalogservice}/all.yaml (100%) rename test/tracetesting/{product-catalog-service => productcatalogservice}/get.yaml (100%) rename test/tracetesting/{product-catalog-service => productcatalogservice}/list.yaml (100%) rename test/tracetesting/{product-catalog-service => productcatalogservice}/search.yaml (100%) rename test/tracetesting/{recommendation-service => recommendationservice}/all.yaml (100%) rename test/tracetesting/{recommendation-service => recommendationservice}/list.yaml (100%) rename test/tracetesting/{shipping-service => shippingservice}/all.yaml (100%) rename test/tracetesting/{shipping-service => shippingservice}/empty-quote.yaml (100%) rename test/tracetesting/{shipping-service => shippingservice}/order.yaml (100%) rename test/tracetesting/{shipping-service => shippingservice}/quote.yaml (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cfc180f36..591d16d361 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ the release. ## Unreleased +* [tests] run trace based tests concurrently + ([#1659](https://github.com/open-telemetry/opentelemetry-demo/pull/1659)) + ## 1.11.0 * [accountingservice] convert from Go service to .NET service, uses diff --git a/Makefile b/Makefile index 4316d60e43..654aad68ed 100644 --- a/Makefile +++ b/Makefile @@ -100,12 +100,12 @@ build-env-file: .PHONY: run-tests run-tests: - $(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) run frontendTests - $(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) run traceBasedTests + $(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) -f docker-compose-tests.yml run frontendTests + $(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) -f docker-compose-tests.yml run traceBasedTests .PHONY: run-tracetesting run-tracetesting: - $(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) run traceBasedTests ${SERVICES_TO_TEST} + $(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) -f docker-compose-tests.yml run traceBasedTests ${SERVICES_TO_TEST} .PHONY: generate-protobuf generate-protobuf: @@ -147,22 +147,10 @@ start-minimal: @echo "Go to http://localhost:8080/loadgen/ for the Load Generator UI." @echo "Go to https://opentelemetry.io/docs/demo/feature-flags/ to learn how to change feature flags." -# Observabilty-Driven Development (ODD) -.PHONY: start-odd -start-odd: - $(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) --profile odd up --force-recreate --remove-orphans --detach - @echo "" - @echo "OpenTelemetry Demo is running." - @echo "Go to http://localhost:8080 for the demo UI." - @echo "Go to http://localhost:8080/jaeger/ui for the Jaeger UI." - @echo "Go to http://localhost:8080/grafana/ for the Grafana UI." - @echo "Go to http://localhost:8080/loadgen/ for the Load Generator UI." - @echo "Go to http://localhost:11633/ for the Tracetest Web UI." - @echo "Go to https://opentelemetry.io/docs/demo/feature-flags/ to learn how to change feature flags." - .PHONY: stop stop: - $(DOCKER_COMPOSE_CMD) --profile tests --profile odd down --remove-orphans --volumes + $(DOCKER_COMPOSE_CMD) down --remove-orphans --volumes + $(DOCKER_COMPOSE_CMD) -f docker-compose-tests.yml down --remove-orphans --volumes @echo "" @echo "OpenTelemetry Demo is stopped." diff --git a/docker-compose-tests.yml b/docker-compose-tests.yml new file mode 100644 index 0000000000..1c97ceb6ac --- /dev/null +++ b/docker-compose-tests.yml @@ -0,0 +1,128 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +include: + - path: + - docker-compose.yml # depend on the main docker-compose file + - docker-compose-tests_include-override.yml # include override for tests + +services: + # ***** + # Tests + # ***** + # Frontend Tests + frontendTests: + image: ${IMAGE_NAME}:${DEMO_VERSION}-frontend-tests + container_name: frontend-tests + build: + context: ./ + dockerfile: ./src/frontend/Dockerfile.cypress + volumes: + - ./src/frontend/cypress/videos:/app/cypress/videos + - ./src/frontend/cypress/screenshots:/app/cypress/screenshots + environment: + - CYPRESS_baseUrl=http://${FRONTEND_ADDR} + - FRONTEND_ADDR + - NODE_ENV=production + depends_on: + - frontend + + # Tracebased Tests + traceBasedTests: + image: ${IMAGE_NAME}:${DEMO_VERSION}-traceBasedTests + container_name: traceBasedTests + build: + context: ./ + dockerfile: ./test/tracetesting/Dockerfile + environment: + - AD_SERVICE_ADDR + - CART_SERVICE_ADDR + - CHECKOUT_SERVICE_ADDR + - CURRENCY_SERVICE_ADDR + - EMAIL_SERVICE_ADDR + - FRONTEND_ADDR + - PAYMENT_SERVICE_ADDR + - PRODUCT_CATALOG_SERVICE_ADDR + - RECOMMENDATION_SERVICE_ADDR + - SHIPPING_SERVICE_ADDR + - KAFKA_SERVICE_ADDR + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - ./test/tracetesting:/app/test/tracetesting + - ./pb:/app/pb + depends_on: + tracetest-server: + condition: service_healthy + # adding demo services as dependencies + accountingservice: + condition: service_started + adservice: + condition: service_started + cartservice: + condition: service_started + checkoutservice: + condition: service_started + currencyservice: + condition: service_started + emailservice: + condition: service_started + frauddetectionservice: + condition: service_started + frontend: + condition: service_started + paymentservice: + condition: service_started + productcatalogservice: + condition: service_started + quoteservice: + condition: service_started + recommendationservice: + condition: service_started + shippingservice: + condition: service_started + flagd: + condition: service_started + kafka: + condition: service_started + + tracetest-server: + image: ${TRACETEST_IMAGE} + platform: linux/amd64 + container_name: tracetest-server + volumes: + - type: bind + source: ./test/tracetesting/tracetest-config.yaml + target: /app/tracetest.yaml + - type: bind + source: ./test/tracetesting/tracetest-provision.yaml + target: /app/provision.yaml + command: --provisioning-file /app/provision.yaml + ports: + - 11633:11633 + extra_hosts: + - "host.docker.internal:host-gateway" + depends_on: + tracetest-postgres: + condition: service_healthy + otelcol: + condition: service_started + healthcheck: + test: [ "CMD", "wget", "--spider", "localhost:11633" ] + interval: 1s + timeout: 3s + retries: 60 + + tracetest-postgres: + image: ${POSTGRES_IMAGE} + container_name: tracetest-postgres + environment: + POSTGRES_PASSWORD: postgres + POSTGRES_USER: postgres + healthcheck: + test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB" + interval: 1s + timeout: 5s + retries: 60 + ports: + - 5432 diff --git a/docker-compose-tests_include-override.yml b/docker-compose-tests_include-override.yml new file mode 100644 index 0000000000..3fea4d60cc --- /dev/null +++ b/docker-compose-tests_include-override.yml @@ -0,0 +1,12 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +services: + + otelcol: + command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-tracetest.yml" ] + volumes: + - ${DOCKER_SOCK}:/var/run/docker.sock:ro + - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml + - ./test/tracetesting/otelcol-config-tracetest.yml:/etc/otelcol-config-tracetest.yml + depends_on: [] diff --git a/docker-compose.yml b/docker-compose.yml index 29fa9ad1fb..9de657c78d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -787,131 +787,3 @@ services: ports: - "9200" logging: *logging - - # ***** - # Tests - # ***** - # Frontend Tests - frontendTests: - image: ${IMAGE_NAME}:${DEMO_VERSION}-frontend-tests - container_name: frontend-tests - build: - context: ./ - dockerfile: ./src/frontend/Dockerfile.cypress - profiles: - - tests - volumes: - - ./src/frontend/cypress/videos:/app/cypress/videos - - ./src/frontend/cypress/screenshots:/app/cypress/screenshots - environment: - - CYPRESS_baseUrl=http://${FRONTEND_ADDR} - - FRONTEND_ADDR - - NODE_ENV=production - depends_on: - - frontend - - # Tracebased Tests - traceBasedTests: - image: ${IMAGE_NAME}:${DEMO_VERSION}-traceBasedTests - container_name: traceBasedTests - profiles: - - tests - build: - context: ./ - dockerfile: ./test/tracetesting/Dockerfile - environment: - - AD_SERVICE_ADDR - - CART_SERVICE_ADDR - - CHECKOUT_SERVICE_ADDR - - CURRENCY_SERVICE_ADDR - - EMAIL_SERVICE_ADDR - - FRONTEND_ADDR - - PAYMENT_SERVICE_ADDR - - PRODUCT_CATALOG_SERVICE_ADDR - - RECOMMENDATION_SERVICE_ADDR - - SHIPPING_SERVICE_ADDR - - KAFKA_SERVICE_ADDR - extra_hosts: - - "host.docker.internal:host-gateway" - volumes: - - ./test/tracetesting:/app/test/tracetesting - - ./pb:/app/pb - depends_on: - tracetest-server: - condition: service_healthy - # adding demo services as dependencies - frontend: - condition: service_started - adservice: - condition: service_started - cartservice: - condition: service_started - checkoutservice: - condition: service_started - currencyservice: - condition: service_started - emailservice: - condition: service_started - paymentservice: - condition: service_started - productcatalogservice: - condition: service_started - recommendationservice: - condition: service_started - shippingservice: - condition: service_started - quoteservice: - condition: service_started - accountingservice: - condition: service_started - frauddetectionservice: - condition: service_started - flagd: - condition: service_started - - tracetest-server: - image: ${TRACETEST_IMAGE} - platform: linux/amd64 - container_name: tracetest-server - profiles: - - tests - - odd # Observabilty-Driven Development (ODD) - volumes: - - type: bind - source: ./test/tracetesting/tracetest-config.yaml - target: /app/tracetest.yaml - - type: bind - source: ./test/tracetesting/tracetest-provision.yaml - target: /app/provision.yaml - command: --provisioning-file /app/provision.yaml - ports: - - 11633:11633 - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: - tracetest-postgres: - condition: service_healthy - otelcol: - condition: service_started - healthcheck: - test: [ "CMD", "wget", "--spider", "localhost:11633" ] - interval: 1s - timeout: 3s - retries: 60 - - tracetest-postgres: - image: ${POSTGRES_IMAGE} - container_name: tracetest-postgres - profiles: - - tests - - odd # Observabilty-Driven Development (ODD) - environment: - POSTGRES_PASSWORD: postgres - POSTGRES_USER: postgres - healthcheck: - test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB" - interval: 1s - timeout: 5s - retries: 60 - ports: - - 5432 diff --git a/test/tracetesting/ad-service/all.yaml b/test/tracetesting/adservice/all.yaml similarity index 100% rename from test/tracetesting/ad-service/all.yaml rename to test/tracetesting/adservice/all.yaml diff --git a/test/tracetesting/ad-service/get.yaml b/test/tracetesting/adservice/get.yaml similarity index 100% rename from test/tracetesting/ad-service/get.yaml rename to test/tracetesting/adservice/get.yaml diff --git a/test/tracetesting/cart-service/add-item-to-cart.yaml b/test/tracetesting/cartservice/add-item-to-cart.yaml similarity index 100% rename from test/tracetesting/cart-service/add-item-to-cart.yaml rename to test/tracetesting/cartservice/add-item-to-cart.yaml diff --git a/test/tracetesting/cart-service/all.yaml b/test/tracetesting/cartservice/all.yaml similarity index 100% rename from test/tracetesting/cart-service/all.yaml rename to test/tracetesting/cartservice/all.yaml diff --git a/test/tracetesting/cart-service/check-if-cart-is-empty.yaml b/test/tracetesting/cartservice/check-if-cart-is-empty.yaml similarity index 100% rename from test/tracetesting/cart-service/check-if-cart-is-empty.yaml rename to test/tracetesting/cartservice/check-if-cart-is-empty.yaml diff --git a/test/tracetesting/cart-service/check-if-cart-is-populated.yaml b/test/tracetesting/cartservice/check-if-cart-is-populated.yaml similarity index 100% rename from test/tracetesting/cart-service/check-if-cart-is-populated.yaml rename to test/tracetesting/cartservice/check-if-cart-is-populated.yaml diff --git a/test/tracetesting/cart-service/empty-cart.yaml b/test/tracetesting/cartservice/empty-cart.yaml similarity index 100% rename from test/tracetesting/cart-service/empty-cart.yaml rename to test/tracetesting/cartservice/empty-cart.yaml diff --git a/test/tracetesting/checkout-service/all.yaml b/test/tracetesting/checkoutservice/all.yaml similarity index 100% rename from test/tracetesting/checkout-service/all.yaml rename to test/tracetesting/checkoutservice/all.yaml diff --git a/test/tracetesting/checkout-service/place-order.yaml b/test/tracetesting/checkoutservice/place-order.yaml similarity index 100% rename from test/tracetesting/checkout-service/place-order.yaml rename to test/tracetesting/checkoutservice/place-order.yaml diff --git a/test/tracetesting/currency-service/all.yaml b/test/tracetesting/currencyservice/all.yaml similarity index 100% rename from test/tracetesting/currency-service/all.yaml rename to test/tracetesting/currencyservice/all.yaml diff --git a/test/tracetesting/currency-service/convert.yaml b/test/tracetesting/currencyservice/convert.yaml similarity index 100% rename from test/tracetesting/currency-service/convert.yaml rename to test/tracetesting/currencyservice/convert.yaml diff --git a/test/tracetesting/currency-service/supported.yaml b/test/tracetesting/currencyservice/supported.yaml similarity index 100% rename from test/tracetesting/currency-service/supported.yaml rename to test/tracetesting/currencyservice/supported.yaml diff --git a/test/tracetesting/email-service/all.yaml b/test/tracetesting/emailservice/all.yaml similarity index 100% rename from test/tracetesting/email-service/all.yaml rename to test/tracetesting/emailservice/all.yaml diff --git a/test/tracetesting/email-service/confirmation.yaml b/test/tracetesting/emailservice/confirmation.yaml similarity index 100% rename from test/tracetesting/email-service/confirmation.yaml rename to test/tracetesting/emailservice/confirmation.yaml diff --git a/test/tracetesting/frontend-service/01-see-ads.yaml b/test/tracetesting/frontend/01-see-ads.yaml similarity index 100% rename from test/tracetesting/frontend-service/01-see-ads.yaml rename to test/tracetesting/frontend/01-see-ads.yaml diff --git a/test/tracetesting/frontend-service/02-get-product-recommendation.yaml b/test/tracetesting/frontend/02-get-product-recommendation.yaml similarity index 100% rename from test/tracetesting/frontend-service/02-get-product-recommendation.yaml rename to test/tracetesting/frontend/02-get-product-recommendation.yaml diff --git a/test/tracetesting/frontend-service/03-browse-product.yaml b/test/tracetesting/frontend/03-browse-product.yaml similarity index 100% rename from test/tracetesting/frontend-service/03-browse-product.yaml rename to test/tracetesting/frontend/03-browse-product.yaml diff --git a/test/tracetesting/frontend-service/04-add-product-to-cart.yaml b/test/tracetesting/frontend/04-add-product-to-cart.yaml similarity index 100% rename from test/tracetesting/frontend-service/04-add-product-to-cart.yaml rename to test/tracetesting/frontend/04-add-product-to-cart.yaml diff --git a/test/tracetesting/frontend-service/05-view-cart.yaml b/test/tracetesting/frontend/05-view-cart.yaml similarity index 100% rename from test/tracetesting/frontend-service/05-view-cart.yaml rename to test/tracetesting/frontend/05-view-cart.yaml diff --git a/test/tracetesting/frontend-service/06-checking-out-cart.yaml b/test/tracetesting/frontend/06-checking-out-cart.yaml similarity index 100% rename from test/tracetesting/frontend-service/06-checking-out-cart.yaml rename to test/tracetesting/frontend/06-checking-out-cart.yaml diff --git a/test/tracetesting/frontend-service/all.yaml b/test/tracetesting/frontend/all.yaml similarity index 100% rename from test/tracetesting/frontend-service/all.yaml rename to test/tracetesting/frontend/all.yaml diff --git a/test/tracetesting/otelcol-config-tracetest.yml b/test/tracetesting/otelcol-config-tracetest.yml new file mode 100644 index 0000000000..5ce06ce150 --- /dev/null +++ b/test/tracetesting/otelcol-config-tracetest.yml @@ -0,0 +1,14 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +exporters: + otlp/tracetest: + endpoint: http://tracetest-server:4317 + tls: + insecure: true + +service: + pipelines: + traces: + processors: [] + exporters: [debug, spanmetrics, otlp/tracetest] diff --git a/test/tracetesting/payment-service/all.yaml b/test/tracetesting/paymentservice/all.yaml similarity index 100% rename from test/tracetesting/payment-service/all.yaml rename to test/tracetesting/paymentservice/all.yaml diff --git a/test/tracetesting/payment-service/amex-credit-card-not-allowed.yaml b/test/tracetesting/paymentservice/amex-credit-card-not-allowed.yaml similarity index 100% rename from test/tracetesting/payment-service/amex-credit-card-not-allowed.yaml rename to test/tracetesting/paymentservice/amex-credit-card-not-allowed.yaml diff --git a/test/tracetesting/payment-service/expired-credit-card.yaml b/test/tracetesting/paymentservice/expired-credit-card.yaml similarity index 100% rename from test/tracetesting/payment-service/expired-credit-card.yaml rename to test/tracetesting/paymentservice/expired-credit-card.yaml diff --git a/test/tracetesting/payment-service/invalid-credit-card.yaml b/test/tracetesting/paymentservice/invalid-credit-card.yaml similarity index 100% rename from test/tracetesting/payment-service/invalid-credit-card.yaml rename to test/tracetesting/paymentservice/invalid-credit-card.yaml diff --git a/test/tracetesting/payment-service/valid-credit-card.yaml b/test/tracetesting/paymentservice/valid-credit-card.yaml similarity index 100% rename from test/tracetesting/payment-service/valid-credit-card.yaml rename to test/tracetesting/paymentservice/valid-credit-card.yaml diff --git a/test/tracetesting/product-catalog-service/all.yaml b/test/tracetesting/productcatalogservice/all.yaml similarity index 100% rename from test/tracetesting/product-catalog-service/all.yaml rename to test/tracetesting/productcatalogservice/all.yaml diff --git a/test/tracetesting/product-catalog-service/get.yaml b/test/tracetesting/productcatalogservice/get.yaml similarity index 100% rename from test/tracetesting/product-catalog-service/get.yaml rename to test/tracetesting/productcatalogservice/get.yaml diff --git a/test/tracetesting/product-catalog-service/list.yaml b/test/tracetesting/productcatalogservice/list.yaml similarity index 100% rename from test/tracetesting/product-catalog-service/list.yaml rename to test/tracetesting/productcatalogservice/list.yaml diff --git a/test/tracetesting/product-catalog-service/search.yaml b/test/tracetesting/productcatalogservice/search.yaml similarity index 100% rename from test/tracetesting/product-catalog-service/search.yaml rename to test/tracetesting/productcatalogservice/search.yaml diff --git a/test/tracetesting/recommendation-service/all.yaml b/test/tracetesting/recommendationservice/all.yaml similarity index 100% rename from test/tracetesting/recommendation-service/all.yaml rename to test/tracetesting/recommendationservice/all.yaml diff --git a/test/tracetesting/recommendation-service/list.yaml b/test/tracetesting/recommendationservice/list.yaml similarity index 100% rename from test/tracetesting/recommendation-service/list.yaml rename to test/tracetesting/recommendationservice/list.yaml diff --git a/test/tracetesting/run.bash b/test/tracetesting/run.bash index 7c2b4a0314..966a04572b 100755 --- a/test/tracetesting/run.bash +++ b/test/tracetesting/run.bash @@ -7,6 +7,18 @@ set -e +# Availalble services to test +ALL_SERVICES=("adservice" "cartservice" "currencyservice" "checkoutservice" "frontend" "emailservice" "paymentservice" "productcatalogservice" "recommendationservice" "shippingservice") + +## Script variables +# Will contain the list of services to test +chosen_services=() +# Array to hold process IDs +pids=() +# Array to hold exit codes +exit_codes=() + +## Script functions check_if_tracetest_is_installed() { if ! command -v tracetest &> /dev/null then @@ -51,21 +63,19 @@ run_tracetest() { service_name=$1 testsuite_file=./$service_name/all.yaml - tracetest --config ./cli-config.yml run testsuite --file $testsuite_file --vars ./tracetesting-vars.yaml - return $? + tracetest --config ./cli-config.yml run testsuite --file $testsuite_file --vars ./tracetesting-vars.yaml & + pids+=($!) } -ALL_SERVICES=("ad-service" "cart-service" "currency-service" "checkout-service" "frontend-service" "email-service" "payment-service" "product-catalog-service" "recommendation-service" "shipping-service") -CHOSEN_SERVICES=() - +## Script execution while [[ $# -gt 0 ]]; do - CHOSEN_SERVICES+=("$1") + chosen_services+=("$1") shift done -if [ ${#CHOSEN_SERVICES[@]} -eq 0 ]; then +if [ ${#chosen_services[@]} -eq 0 ]; then for service in "${ALL_SERVICES[@]}"; do - CHOSEN_SERVICES+=("$service") + chosen_services+=("$service") done fi @@ -73,18 +83,28 @@ check_if_tracetest_is_installed create_env_file echo "Starting tests..." +echo "Running trace-based tests for: ${chosen_services[*]} ..." +echo "" -EXIT_STATUS=0 +for service in "${chosen_services[@]}"; do + run_tracetest $service +done -echo "" -echo "Running trace-based tests..." -echo "" +# Wait for processes to finish and capture their exit codes +for pid in "${pids[@]}"; do + wait $pid + exit_codes+=($?) +done -for service in "${CHOSEN_SERVICES[@]}"; do - run_tracetest $service || EXIT_STATUS=$? +# Find the maximum exit code +max_exit_code=0 +for code in "${exit_codes[@]}"; do + if [[ $code -gt $max_exit_code ]]; then + max_exit_code=$code + fi done echo "" -echo "Tests done! Exit code: $EXIT_STATUS" +echo "Tests done! Exit code: $max_exit_code" -exit $EXIT_STATUS \ No newline at end of file +exit $max_exit_code diff --git a/test/tracetesting/shipping-service/all.yaml b/test/tracetesting/shippingservice/all.yaml similarity index 100% rename from test/tracetesting/shipping-service/all.yaml rename to test/tracetesting/shippingservice/all.yaml diff --git a/test/tracetesting/shipping-service/empty-quote.yaml b/test/tracetesting/shippingservice/empty-quote.yaml similarity index 100% rename from test/tracetesting/shipping-service/empty-quote.yaml rename to test/tracetesting/shippingservice/empty-quote.yaml diff --git a/test/tracetesting/shipping-service/order.yaml b/test/tracetesting/shippingservice/order.yaml similarity index 100% rename from test/tracetesting/shipping-service/order.yaml rename to test/tracetesting/shippingservice/order.yaml diff --git a/test/tracetesting/shipping-service/quote.yaml b/test/tracetesting/shippingservice/quote.yaml similarity index 100% rename from test/tracetesting/shipping-service/quote.yaml rename to test/tracetesting/shippingservice/quote.yaml diff --git a/test/tracetesting/tracetest-provision.yaml b/test/tracetesting/tracetest-provision.yaml index 27f4ff8b95..a37cc40602 100644 --- a/test/tracetesting/tracetest-provision.yaml +++ b/test/tracetesting/tracetest-provision.yaml @@ -8,7 +8,7 @@ spec: strategy: periodic default: true periodic: - retryDelay: 10s + retryDelay: 5s timeout: 3m --- @@ -23,12 +23,10 @@ spec: --- type: DataStore spec: - name: Jaeger - type: jaeger - jaeger: - endpoint: jaeger:16685 - tls: - insecure: true + name: Opentelemetry Collector pipeline + type: otlp + default: true + --- type: TestRunner spec: From 4a923bc2a3a1cb31e35f4c624e8eba4089328e51 Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Tue, 9 Jul 2024 04:59:29 -0400 Subject: [PATCH 20/39] [chore] fix build-images workflow (#1661) * fix build-images workflow * use consistent naming for workflows --- .github/workflows/build-images.yml | 2 +- .github/workflows/checks.yml | 2 +- .../{component_build-images.yml => component-build-images.yml} | 0 .github/workflows/nightly-release.yml | 2 +- .github/workflows/release.yml | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{component_build-images.yml => component-build-images.yml} (100%) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 687dc42232..f91f31103d 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -11,4 +11,4 @@ on: jobs: build_images: if: github.repository == 'open-telemetry/opentelemetry-demo' - uses: ./.github/workflows/component_build_images.yml + uses: ./.github/workflows/component-build-images.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 69512a8dc8..8628f944d6 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -11,7 +11,7 @@ on: jobs: build_images: - uses: ./.github/workflows/component_build-images.yml + uses: ./.github/workflows/component-build-images.yml with: push: false version: 'dev' diff --git a/.github/workflows/component_build-images.yml b/.github/workflows/component-build-images.yml similarity index 100% rename from .github/workflows/component_build-images.yml rename to .github/workflows/component-build-images.yml diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index adbff97e29..7ecd338179 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -9,7 +9,7 @@ on: jobs: build_and_push_images: - uses: ./.github/workflows/component_build-images.yml + uses: ./.github/workflows/component-build-images.yml if: github.repository == 'open-telemetry/opentelemetry-demo' with: push: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e308af817b..4576ba661e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: jobs: build_and_push_images: - uses: ./.github/workflows/component_build-images.yml + uses: ./.github/workflows/component-build-images.yml if: github.repository == 'open-telemetry/opentelemetry-demo' with: push: true From 84a4826683046dda67235149ccd048df34664be1 Mon Sep 17 00:00:00 2001 From: Juliano Costa Date: Fri, 12 Jul 2024 20:11:17 +0200 Subject: [PATCH 21/39] Set OTLP receiver endpoint (#1662) * Set OTelCol receiver endpoint * changelog * Apply suggestions from code review Co-authored-by: Roger Coll * Add env vars to collector container --------- Co-authored-by: Roger Coll --- .env | 2 +- CHANGELOG.md | 2 ++ docker-compose-tests_include-override.yml | 5 +++++ docker-compose.minimal.yml | 3 +++ docker-compose.yml | 3 +++ src/otelcollector/otelcol-config.yml | 2 ++ 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.env b/.env index d28e51347d..7f7054fa9e 100644 --- a/.env +++ b/.env @@ -6,7 +6,7 @@ IMAGE_NAME=ghcr.io/open-telemetry/demo DEMO_VERSION=latest # Dependent images -COLLECTOR_CONTRIB_IMAGE=otel/opentelemetry-collector-contrib:0.102.1 +COLLECTOR_CONTRIB_IMAGE=otel/opentelemetry-collector-contrib:0.104.0 FLAGD_IMAGE=ghcr.io/open-feature/flagd:v0.10.2 GRAFANA_IMAGE=grafana/grafana:10.4.3 JAEGERTRACING_IMAGE=jaegertracing/all-in-one:1.57 diff --git a/CHANGELOG.md b/CHANGELOG.md index 591d16d361..6b4e29edf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ the release. ([#1634](https://github.com/open-telemetry/opentelemetry-demo/pull/1634)) * [otel-col] Add docker stats receiver ([#1650](https://github.com/open-telemetry/opentelemetry-demo/pull/1650)) +* [otel-col] Set OTLP receiver endpoint to avoid breaking changes + ([#1662](https://github.com/open-telemetry/opentelemetry-demo/pull/1662)) ## 1.10.0 diff --git a/docker-compose-tests_include-override.yml b/docker-compose-tests_include-override.yml index 3fea4d60cc..1a115b663f 100644 --- a/docker-compose-tests_include-override.yml +++ b/docker-compose-tests_include-override.yml @@ -5,6 +5,11 @@ services: otelcol: command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-tracetest.yml" ] + environment: + - ENVOY_PORT + - OTEL_COLLECTOR_HOST + - OTEL_COLLECTOR_PORT_GRPC + - OTEL_COLLECTOR_PORT_HTTP volumes: - ${DOCKER_SOCK}:/var/run/docker.sock:ro - ${OTEL_COLLECTOR_CONFIG}:/etc/otelcol-config.yml diff --git a/docker-compose.minimal.yml b/docker-compose.minimal.yml index 3952c2148a..cb2d569364 100644 --- a/docker-compose.minimal.yml +++ b/docker-compose.minimal.yml @@ -624,6 +624,9 @@ services: logging: *logging environment: - ENVOY_PORT + - OTEL_COLLECTOR_HOST + - OTEL_COLLECTOR_PORT_GRPC + - OTEL_COLLECTOR_PORT_HTTP # Prometheus prometheus: diff --git a/docker-compose.yml b/docker-compose.yml index 9de657c78d..41fc48f682 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -734,6 +734,9 @@ services: logging: *logging environment: - ENVOY_PORT + - OTEL_COLLECTOR_HOST + - OTEL_COLLECTOR_PORT_GRPC + - OTEL_COLLECTOR_PORT_HTTP # Prometheus prometheus: diff --git a/src/otelcollector/otelcol-config.yml b/src/otelcollector/otelcol-config.yml index 8901737b5c..62b6b481ce 100644 --- a/src/otelcollector/otelcol-config.yml +++ b/src/otelcollector/otelcol-config.yml @@ -5,7 +5,9 @@ receivers: otlp: protocols: grpc: + endpoint: ${env:OTEL_COLLECTOR_HOST}:${env:OTEL_COLLECTOR_PORT_GRPC} http: + endpoint: ${env:OTEL_COLLECTOR_HOST}:${env:OTEL_COLLECTOR_PORT_HTTP} cors: allowed_origins: - "http://*" From 169d02d9a39a149b12e0345a1f730b0be3bef46d Mon Sep 17 00:00:00 2001 From: Felix Date: Sun, 23 Jun 2024 15:16:47 +0200 Subject: [PATCH 22/39] feat: [K8s] Added MongoDB *Disclaimer:* this is not working yet! --- kubernetes/opentelemetry-demo.yaml | 54 +++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/kubernetes/opentelemetry-demo.yaml b/kubernetes/opentelemetry-demo.yaml index d58a7806e5..904e9e813e 100644 --- a/kubernetes/opentelemetry-demo.yaml +++ b/kubernetes/opentelemetry-demo.yaml @@ -8875,7 +8875,7 @@ metadata: app.kubernetes.io/instance: opentelemetry-demo app.kubernetes.io/component: mongo app.kubernetes.io/name: opentelemetry-demo-mongo - app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/version: "1.11.0" app.kubernetes.io/part-of: opentelemetry-demo spec: type: ClusterIP @@ -10385,6 +10385,58 @@ spec: # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 kind: Deployment +metadata: + name: opentelemetry-demo-mongo + labels: + + opentelemetry.io/name: opentelemetry-demo-mongo + app.kubernetes.io/instance: opentelemetry-demo + app.kubernetes.io/component: mongo + app.kubernetes.io/name: opentelemetry-demo-mongo + app.kubernetes.io/version: "1.10.0" + app.kubernetes.io/part-of: opentelemetry-demo +spec: + replicas: 1 + selector: + matchLabels: + + opentelemetry.io/name: opentelemetry-demo-mongo + template: + metadata: + labels: + + opentelemetry.io/name: opentelemetry-demo-mongo + app.kubernetes.io/instance: opentelemetry-demo + app.kubernetes.io/component: mongo + app.kubernetes.io/name: opentelemetry-demo-mongo + spec: + serviceAccountName: opentelemetry-demo + containers: + - name: mongo + image: 'mongo:8.0.0-rc9' + imagePullPolicy: IfNotPresent + ports: + + - containerPort: 27017 + name: plaintext + env: + - name: MONGO_INITDB_ROOT_USERNAME + value: $(MONGO_USERNAME) + - name: MONGO_INITDB_ROOT_PASSWORD + value: $(MONGO_PASSWORD) + resources: + limits: + memory: 256Mi + securityContext: + runAsGroup: 1000 + runAsNonRoot: true + runAsUser: 1000 + volumeMounts: + volumes: +--- +# Source: opentelemetry-demo/templates/component.yaml +apiVersion: apps/v1 +kind: Deployment metadata: name: opentelemetry-demo-loadgenerator labels: From 998c55a10bea6c3a08683dea0aa2a75cd6469086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20M=C3=BCller?= Date: Thu, 18 Jul 2024 17:34:34 +0200 Subject: [PATCH 23/39] feat: ES-9 add EDMM Model (K8s) of otel-shop --- edmm/otel_store_k8s_translated.yaml | 2678 +++++++++++++++++++++++++++ 1 file changed, 2678 insertions(+) create mode 100644 edmm/otel_store_k8s_translated.yaml diff --git a/edmm/otel_store_k8s_translated.yaml b/edmm/otel_store_k8s_translated.yaml new file mode 100644 index 0000000000..629ef93643 --- /dev/null +++ b/edmm/otel_store_k8s_translated.yaml @@ -0,0 +1,2678 @@ +properties: [] +components: + - default: + type: "physical_node" + description: null + properties: + - cpu_count: 4 + - ram_GiB: 16 + - storage_GiB: 32 + operations: [ ] + artifacts: [ ] + - default-operating-system: + type: "operating_system" + description: null + properties: + - name: "Ubuntu" + - version: "18.04" + - os_family: "Linux" + operations: [ ] + artifacts: [ ] + - default-container-runtime: + type: "container_runtime" + description: null + properties: + - name: "Kubernetes" + operations: [ ] + artifacts: [ ] + - name: opentelemetry-demo-currencyservice + type: opentelemetry-demo-currencyservice-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: VERSION + type: STRING + value: "'1.10.0'" + required: true + - key: CURRENCY_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-currencyservice' + fileURI: "-" + - name: opentelemetry-demo-frauddetectionservice + type: opentelemetry-demo-frauddetectionservice-type + properties: + - key: KAFKA_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-kafka:9092'" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4318" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-frauddetectionservice' + fileURI: "-" + - name: opentelemetry-demo-paymentservice + type: opentelemetry-demo-paymentservice-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: PAYMENT_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-paymentservice' + fileURI: "-" + - name: opentelemetry-demo-quoteservice + type: opentelemetry-demo-quoteservice-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: QUOTE_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_PHP_AUTOLOAD_ENABLED + type: STRING + value: "true" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4318" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-quoteservice' + fileURI: "-" + - name: opentelemetry-demo-frontend + type: opentelemetry-demo-frontend-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: WEB_OTEL_SERVICE_NAME + type: STRING + value: "frontend-web" + required: true + - key: FRONTEND_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: RECOMMENDATION_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-recommendationservice:8080'" + required: true + - key: CHECKOUT_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-checkoutservice:8080'" + required: true + - key: PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + type: STRING + value: "http://localhost:8080/otlp-http/v1/traces" + required: true + - key: FRONTEND_ADDR + type: STRING + value: ":8080" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: PRODUCT_CATALOG_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-productcatalogservice:8080'" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: AD_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-adservice:8080'" + required: true + - key: OTEL_COLLECTOR_HOST + type: STRING + value: "$(OTEL_COLLECTOR_NAME)" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: CURRENCY_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-currencyservice:8080'" + required: true + - key: SHIPPING_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-shippingservice:8080'" + required: true + - key: CART_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-cartservice:8080'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-frontend' + fileURI: "-" + - name: opentelemetry-demo-grafana + type: opentelemetry-demo-grafana-type + properties: + - key: grafana + type: INTEGER + value: 3000 + required: true + - key: gossip-tcp + type: INTEGER + value: 9094 + required: true + - key: gossip-udp + type: INTEGER + value: 9094 + required: true + - key: GF_PATHS_PROVISIONING + type: STRING + value: "/etc/grafana/provisioning" + required: true + - key: GF_PATHS_PLUGINS + type: STRING + value: "/var/lib/grafana/plugins" + required: true + - key: GF_PATHS_DATA + type: STRING + value: "/var/lib/grafana/" + required: true + - key: GF_PATHS_LOGS + type: STRING + value: "/var/log/grafana" + required: true + - key: service + type: STRING + value: "80:3000" + required: true + operations: + [] + artifacts: + - type: docker_image + name: "docker.io/grafana/grafana:10.4.1" + fileURI: "-" + - name: opentelemetry-demo-redis + type: opentelemetry-demo-redis-type + properties: + - key: redis + type: INTEGER + value: 6379 + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: redis + type: STRING + value: "6379:6379" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'redis:7.2-alpine' + fileURI: "-" + - name: otel-demo-opensearch + type: otel-demo-opensearch-type + properties: + - key: transport + type: INTEGER + value: 9300 + required: true + - key: metrics + type: INTEGER + value: 9600 + required: true + - key: http + type: INTEGER + value: 9200 + required: true + - key: discovery.seed_hosts + type: STRING + value: "opensearch-cluster-master-headless" + required: true + - key: network.host + type: STRING + value: "0.0.0.0" + required: true + - key: node.roles + type: STRING + value: "master,ingest,data,remote_cluster_client," + required: true + - key: cluster.name + type: STRING + value: "demo-cluster" + required: true + - key: DISABLE_INSTALL_DEMO_CONFIG + type: STRING + value: "true" + required: true + - key: discovery.type + type: STRING + value: "single-node" + required: true + - key: bootstrap.memory_lock + type: STRING + value: "true" + required: true + - key: DISABLE_SECURITY_PLUGIN + type: STRING + value: "true" + required: true + - key: OPENSEARCH_JAVA_OPTS + type: STRING + value: "-Xms300m -Xmx300m" + required: true + operations: + [] + artifacts: + - type: docker_image + name: "opensearchproject/opensearch:2.13.0" + fileURI: "-" + - name: opentelemetry-demo-flagd + type: opentelemetry-demo-flagd-type + properties: + - key: service + type: INTEGER + value: 8013 + required: true + - key: FLAGD_METRICS_EXPORTER + type: STRING + value: "otel" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: FLAGD_OTEL_COLLECTOR_URI + type: STRING + value: "$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: tcp-service + type: STRING + value: "8013:8013" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-feature/flagd:v0.10.1' + fileURI: "-" + - name: opentelemetry-demo-mongo + type: opentelemetry-demo-mongo-type + properties: + - key: plaintext + type: INTEGER + value: 27017 + required: true + - key: MONGO_INITDB_ROOT_PASSWORD + type: STRING + value: "'mongo_product_catalog'" + required: true + - key: MONGO_INITDB_ROOT_USERNAME + type: STRING + value: "'mongo'" + required: true + - key: plaintext + type: STRING + value: "27017:27017" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'mongo:8.0.0-rc9' + fileURI: "-" + - name: opentelemetry-demo-frontendproxy + type: opentelemetry-demo-frontendproxy-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: GRAFANA_SERVICE_PORT + type: STRING + value: "80" + required: true + - key: OTEL_COLLECTOR_PORT_GRPC + type: STRING + value: "4317" + required: true + - key: JAEGER_SERVICE_PORT + type: STRING + value: "16686" + required: true + - key: FRONTEND_PORT + type: STRING + value: "8080" + required: true + - key: GRAFANA_SERVICE_HOST + type: STRING + value: "'opentelemetry-demo-grafana'" + required: true + - key: ENVOY_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: LOCUST_WEB_PORT + type: STRING + value: "8089" + required: true + - key: OTEL_COLLECTOR_PORT_HTTP + type: STRING + value: "4318" + required: true + - key: IMAGE_PROVIDER_HOST + type: STRING + value: "'opentelemetry-demo-imageprovider'" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: LOCUST_WEB_HOST + type: STRING + value: "'opentelemetry-demo-loadgenerator'" + required: true + - key: OTEL_COLLECTOR_HOST + type: STRING + value: "$(OTEL_COLLECTOR_NAME)" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: JAEGER_SERVICE_HOST + type: STRING + value: "'opentelemetry-demo-jaeger-query'" + required: true + - key: FRONTEND_HOST + type: STRING + value: "'opentelemetry-demo-frontend'" + required: true + - key: IMAGE_PROVIDER_PORT + type: STRING + value: "8081" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-frontendproxy' + fileURI: "-" + - name: opentelemetry-demo-loadgenerator + type: opentelemetry-demo-loadgenerator-type + properties: + - key: service + type: INTEGER + value: 8089 + required: true + - key: LOCUST_USERS + type: STRING + value: "10" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION + type: STRING + value: "python" + required: true + - key: LOCUST_WEB_PORT + type: STRING + value: "8089" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: LOCUST_BROWSER_TRAFFIC_ENABLED + type: STRING + value: "true" + required: true + - key: LOCUST_HOST + type: STRING + value: "http://opentelemetry-demo-frontendproxy:8080" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: LOCUST_AUTOSTART + type: STRING + value: "true" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: LOCUST_SPAWN_RATE + type: STRING + value: "1" + required: true + - key: LOCUST_HEADLESS + type: STRING + value: "false" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8089:8089" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-loadgenerator' + fileURI: "-" + - name: opentelemetry-demo-adservice + type: opentelemetry-demo-adservice-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4318" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: AD_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_LOGS_EXPORTER + type: STRING + value: "otlp" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-adservice' + fileURI: "-" + - name: opentelemetry-demo-jaeger + type: opentelemetry-demo-jaeger-type + properties: + - key: container_port + type: INTEGER + value: 5775 + required: true + - key: container_port + type: INTEGER + value: 6831 + required: true + - key: container_port + type: INTEGER + value: 6832 + required: true + - key: container_port + type: INTEGER + value: 5778 + required: true + - key: container_port + type: INTEGER + value: 9411 + required: true + - key: container_port + type: INTEGER + value: 16685 + required: true + - key: container_port + type: INTEGER + value: 4317 + required: true + - key: container_port + type: INTEGER + value: 16686 + required: true + - key: container_port + type: INTEGER + value: 4318 + required: true + - key: SPAN_STORAGE_TYPE + type: STRING + value: "memory" + required: true + - key: COLLECTOR_ZIPKIN_HOST_PORT + type: STRING + value: ":9411" + required: true + - key: COLLECTOR_OTLP_ENABLED + type: STRING + value: "true" + required: true + - key: METRICS_STORAGE_TYPE + type: STRING + value: "prometheus" + required: true + - key: JAEGER_DISABLED + type: STRING + value: "false" + required: true + - key: grpc-query + type: STRING + value: "16685:16685" + required: true + - key: http-query + type: STRING + value: "16686:16686" + required: true + - key: otlp-http + type: STRING + value: "4318:4318" + required: true + - key: jaeger-compact + type: STRING + value: "6831:6831" + required: true + - key: zipkin + type: STRING + value: "9411:9411" + required: true + - key: otlp + type: STRING + value: "4317:4317" + required: true + operations: + [] + artifacts: + - type: docker_image + name: jaegertracing/all-in-one:1.53.0 + fileURI: "-" + - name: opentelemetry-demo-cartservice + type: opentelemetry-demo-cartservice-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: ASPNETCORE_URLS + type: STRING + value: "http://*:$(CART_SERVICE_PORT)" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: CART_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: REDIS_ADDR + type: STRING + value: "'opentelemetry-demo-redis:6379'" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-cartservice' + fileURI: "-" + - name: opentelemetry-demo-emailservice + type: opentelemetry-demo-emailservice-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: APP_ENV + type: STRING + value: "production" + required: true + - key: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4318/v1/traces" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: EMAIL_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-emailservice' + fileURI: "-" + - name: opentelemetry-demo-imageprovider + type: opentelemetry-demo-imageprovider-type + properties: + - key: service + type: INTEGER + value: 8081 + required: true + - key: OTEL_COLLECTOR_PORT_GRPC + type: STRING + value: "4317" + required: true + - key: OTEL_COLLECTOR_HOST + type: STRING + value: "$(OTEL_COLLECTOR_NAME)" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: IMAGE_PROVIDER_PORT + type: STRING + value: "8081" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: tcp-service + type: STRING + value: "8081:8081" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-imageprovider' + fileURI: "-" + - name: opentelemetry-demo-productcatalogservice + type: opentelemetry-demo-productcatalogservice-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: MONGO_HOST + type: STRING + value: "'opentelemetry-demo-mongo'" + required: true + - key: PRODUCT_CATALOG_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: MONGO_PASSWORD + type: STRING + value: "'mongo_product_catalog'" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: MONGO_PORT + type: STRING + value: "'27017'" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: MONGO_USERNAME + type: STRING + value: "'mongo'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-productcatalogservice' + fileURI: "-" + - name: opentelemetry-demo-accountingservice + type: opentelemetry-demo-accountingservice-type + properties: + - key: KAFKA_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-kafka:9092'" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-accountingservice' + fileURI: "-" + - name: opentelemetry-demo-checkoutservice + type: opentelemetry-demo-checkoutservice-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: KAFKA_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-kafka:9092'" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: PRODUCT_CATALOG_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-productcatalogservice:8080'" + required: true + - key: CHECKOUT_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: PAYMENT_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-paymentservice:8080'" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: EMAIL_SERVICE_ADDR + type: STRING + value: "http://opentelemetry-demo-emailservice:8080" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: CURRENCY_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-currencyservice:8080'" + required: true + - key: SHIPPING_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-shippingservice:8080'" + required: true + - key: CART_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-cartservice:8080'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-checkoutservice' + fileURI: "-" + - name: opentelemetry-demo-shippingservice + type: opentelemetry-demo-shippingservice-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: QUOTE_SERVICE_ADDR + type: STRING + value: "http://opentelemetry-demo-quoteservice:8080" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: SHIPPING_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-shippingservice' + fileURI: "-" + - name: opentelemetry-demo-recommendationservice + type: opentelemetry-demo-recommendationservice-type + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_PYTHON_LOG_CORRELATION + type: STRING + value: "true" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: PRODUCT_CATALOG_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-productcatalogservice:8080'" + required: true + - key: RECOMMENDATION_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION + type: STRING + value: "python" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-recommendationservice' + fileURI: "-" + - name: opentelemetry-demo-kafka + type: opentelemetry-demo-kafka-type + properties: + - key: controller + type: INTEGER + value: 9093 + required: true + - key: plaintext + type: INTEGER + value: 9092 + required: true + - key: KAFKA_HEAP_OPTS + type: STRING + value: "-Xmx400M -Xms400M" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4318" + required: true + - key: KAFKA_ADVERTISED_LISTENERS + type: STRING + value: "PLAINTEXT://opentelemetry-demo-kafka:9092" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: controller + type: STRING + value: "9093:9093" + required: true + - key: plaintext + type: STRING + value: "9092:9092" + required: true + operations: + [] + artifacts: + - type: docker_image + name: 'ghcr.io/open-telemetry/demo:1.10.0-kafka' + fileURI: "-" + - name: opentelemetry-demo-otelcol + type: opentelemetry-demo-otelcol-type + properties: + - key: prometheus + type: INTEGER + value: 9464 + required: true + - key: jaeger-compact + type: INTEGER + value: 6831 + required: true + - key: jaeger-thrift + type: INTEGER + value: 14268 + required: true + - key: zipkin + type: INTEGER + value: 9411 + required: true + - key: jaeger-grpc + type: INTEGER + value: 14250 + required: true + - key: otlp + type: INTEGER + value: 4317 + required: true + - key: metrics + type: INTEGER + value: 8888 + required: true + - key: otlp-http + type: INTEGER + value: 4318 + required: true + - key: GOMEMLIMIT + type: STRING + value: "160MiB" + required: true + - key: metrics + type: STRING + value: "8888:8888" + required: true + - key: jaeger-grpc + type: STRING + value: "14250:14250" + required: true + - key: jaeger-thrift + type: STRING + value: "14268:14268" + required: true + - key: otlp-http + type: STRING + value: "4318:4318" + required: true + - key: jaeger-compact + type: STRING + value: "6831:6831" + required: true + - key: zipkin + type: STRING + value: "9411:9411" + required: true + - key: prometheus + type: STRING + value: "9464:9464" + required: true + - key: otlp + type: STRING + value: "4317:4317" + required: true + operations: + [] + artifacts: + - type: docker_image + name: "otel/opentelemetry-collector-contrib:0.102.1" + fileURI: "-" + - name: opentelemetry-demo-prometheus-server + type: opentelemetry-demo-prometheus-server-type + properties: + - key: container_port + type: INTEGER + value: 9090 + required: true + - key: http + type: STRING + value: "9090:9090" + required: true + operations: + [] + artifacts: + - type: docker_image + name: "quay.io/prometheus/prometheus:v2.52.0" + fileURI: "-" +relations: + - default-operating-system_HostedOn_default: + type: "HostedOn" + description: null + source: "default-operating-system" + target: "default" + properties: [ ] + operations: [ ] + - default-container-runtime_HostedOn_default-operating-system: + type: "HostedOn" + description: null + source: "default-container-runtime" + target: "default-operating-system" + properties: [ ] + operations: [ ] + - opentelemetry-demo-accountingservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-accountingservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-adservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-adservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-cartservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-cartservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-checkoutservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-checkoutservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-currencyservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-currencyservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-emailservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-emailservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-flagd_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-flagd" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-frauddetectionservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-frauddetectionservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-frontend_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-frontend" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-frontendproxy_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-frontendproxy" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-grafana_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-grafana" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-imageprovider_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-imageprovider" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-kafka_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-kafka" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-loadgenerator_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-loadgenerator" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-otelcollector_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-otelcollector" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-paymentservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-paymentservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-productcatalogservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-productcatalogservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-prometheus_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-prometheus" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-quoteservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-quoteservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-recommendataionservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-recommendataionservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + - opentelemetry-demo-shippingservice_HostedOn_default-container-runtime: + type: "HostedOn" + description: null + source: "opentelemetry-demo-shippingservice" + target: "default-container-runtime" + properties: [ ] + operations: [ ] + + +component types: + - name: opentelemetry-demo-currencyservice-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: VERSION + type: STRING + value: "'1.10.0'" + required: true + - key: CURRENCY_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-frauddetectionservice-type + extends: + properties: + - key: KAFKA_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-kafka:9092'" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4318" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + operations: + [] + - name: opentelemetry-demo-paymentservice-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: PAYMENT_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-quoteservice-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: QUOTE_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_PHP_AUTOLOAD_ENABLED + type: STRING + value: "true" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4318" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-frontend-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: WEB_OTEL_SERVICE_NAME + type: STRING + value: "frontend-web" + required: true + - key: FRONTEND_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: RECOMMENDATION_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-recommendationservice:8080'" + required: true + - key: CHECKOUT_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-checkoutservice:8080'" + required: true + - key: PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + type: STRING + value: "http://localhost:8080/otlp-http/v1/traces" + required: true + - key: FRONTEND_ADDR + type: STRING + value: ":8080" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: PRODUCT_CATALOG_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-productcatalogservice:8080'" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: AD_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-adservice:8080'" + required: true + - key: OTEL_COLLECTOR_HOST + type: STRING + value: "$(OTEL_COLLECTOR_NAME)" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: CURRENCY_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-currencyservice:8080'" + required: true + - key: SHIPPING_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-shippingservice:8080'" + required: true + - key: CART_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-cartservice:8080'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-grafana-type + extends: + properties: + - key: grafana + type: INTEGER + value: 3000 + required: true + - key: gossip-tcp + type: INTEGER + value: 9094 + required: true + - key: gossip-udp + type: INTEGER + value: 9094 + required: true + - key: GF_PATHS_PROVISIONING + type: STRING + value: "/etc/grafana/provisioning" + required: true + - key: GF_PATHS_PLUGINS + type: STRING + value: "/var/lib/grafana/plugins" + required: true + - key: GF_PATHS_DATA + type: STRING + value: "/var/lib/grafana/" + required: true + - key: GF_PATHS_LOGS + type: STRING + value: "/var/log/grafana" + required: true + - key: service + type: STRING + value: "80:3000" + required: true + operations: + [] + - name: opentelemetry-demo-redis-type + extends: + properties: + - key: redis + type: INTEGER + value: 6379 + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: redis + type: STRING + value: "6379:6379" + required: true + operations: + [] + - name: otel-demo-opensearch-type + extends: + properties: + - key: transport + type: INTEGER + value: 9300 + required: true + - key: metrics + type: INTEGER + value: 9600 + required: true + - key: http + type: INTEGER + value: 9200 + required: true + - key: discovery.seed_hosts + type: STRING + value: "opensearch-cluster-master-headless" + required: true + - key: network.host + type: STRING + value: "0.0.0.0" + required: true + - key: node.roles + type: STRING + value: "master,ingest,data,remote_cluster_client," + required: true + - key: cluster.name + type: STRING + value: "demo-cluster" + required: true + - key: DISABLE_INSTALL_DEMO_CONFIG + type: STRING + value: "true" + required: true + - key: discovery.type + type: STRING + value: "single-node" + required: true + - key: bootstrap.memory_lock + type: STRING + value: "true" + required: true + - key: DISABLE_SECURITY_PLUGIN + type: STRING + value: "true" + required: true + - key: OPENSEARCH_JAVA_OPTS + type: STRING + value: "-Xms300m -Xmx300m" + required: true + operations: + [] + - name: opentelemetry-demo-flagd-type + extends: + properties: + - key: service + type: INTEGER + value: 8013 + required: true + - key: FLAGD_METRICS_EXPORTER + type: STRING + value: "otel" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: FLAGD_OTEL_COLLECTOR_URI + type: STRING + value: "$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: tcp-service + type: STRING + value: "8013:8013" + required: true + operations: + [] + - name: opentelemetry-demo-mongo-type + extends: + properties: + - key: plaintext + type: INTEGER + value: 27017 + required: true + - key: MONGO_INITDB_ROOT_PASSWORD + type: STRING + value: "'mongo_product_catalog'" + required: true + - key: MONGO_INITDB_ROOT_USERNAME + type: STRING + value: "'mongo'" + required: true + - key: plaintext + type: STRING + value: "27017:27017" + required: true + operations: + [] + - name: opentelemetry-demo-frontendproxy-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: GRAFANA_SERVICE_PORT + type: STRING + value: "80" + required: true + - key: OTEL_COLLECTOR_PORT_GRPC + type: STRING + value: "4317" + required: true + - key: JAEGER_SERVICE_PORT + type: STRING + value: "16686" + required: true + - key: FRONTEND_PORT + type: STRING + value: "8080" + required: true + - key: GRAFANA_SERVICE_HOST + type: STRING + value: "'opentelemetry-demo-grafana'" + required: true + - key: ENVOY_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: LOCUST_WEB_PORT + type: STRING + value: "8089" + required: true + - key: OTEL_COLLECTOR_PORT_HTTP + type: STRING + value: "4318" + required: true + - key: IMAGE_PROVIDER_HOST + type: STRING + value: "'opentelemetry-demo-imageprovider'" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: LOCUST_WEB_HOST + type: STRING + value: "'opentelemetry-demo-loadgenerator'" + required: true + - key: OTEL_COLLECTOR_HOST + type: STRING + value: "$(OTEL_COLLECTOR_NAME)" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: JAEGER_SERVICE_HOST + type: STRING + value: "'opentelemetry-demo-jaeger-query'" + required: true + - key: FRONTEND_HOST + type: STRING + value: "'opentelemetry-demo-frontend'" + required: true + - key: IMAGE_PROVIDER_PORT + type: STRING + value: "8081" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-loadgenerator-type + extends: + properties: + - key: service + type: INTEGER + value: 8089 + required: true + - key: LOCUST_USERS + type: STRING + value: "10" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION + type: STRING + value: "python" + required: true + - key: LOCUST_WEB_PORT + type: STRING + value: "8089" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: LOCUST_BROWSER_TRAFFIC_ENABLED + type: STRING + value: "true" + required: true + - key: LOCUST_HOST + type: STRING + value: "http://opentelemetry-demo-frontendproxy:8080" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: LOCUST_AUTOSTART + type: STRING + value: "true" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: LOCUST_SPAWN_RATE + type: STRING + value: "1" + required: true + - key: LOCUST_HEADLESS + type: STRING + value: "false" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8089:8089" + required: true + operations: + [] + - name: opentelemetry-demo-adservice-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4318" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: AD_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_LOGS_EXPORTER + type: STRING + value: "otlp" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-jaeger-type + extends: + properties: + - key: container_port + type: INTEGER + value: 5775 + required: true + - key: container_port + type: INTEGER + value: 6831 + required: true + - key: container_port + type: INTEGER + value: 6832 + required: true + - key: container_port + type: INTEGER + value: 5778 + required: true + - key: container_port + type: INTEGER + value: 9411 + required: true + - key: container_port + type: INTEGER + value: 16685 + required: true + - key: container_port + type: INTEGER + value: 4317 + required: true + - key: container_port + type: INTEGER + value: 16686 + required: true + - key: container_port + type: INTEGER + value: 4318 + required: true + - key: SPAN_STORAGE_TYPE + type: STRING + value: "memory" + required: true + - key: COLLECTOR_ZIPKIN_HOST_PORT + type: STRING + value: ":9411" + required: true + - key: COLLECTOR_OTLP_ENABLED + type: STRING + value: "true" + required: true + - key: METRICS_STORAGE_TYPE + type: STRING + value: "prometheus" + required: true + - key: JAEGER_DISABLED + type: STRING + value: "false" + required: true + - key: grpc-query + type: STRING + value: "16685:16685" + required: true + - key: http-query + type: STRING + value: "16686:16686" + required: true + - key: otlp-http + type: STRING + value: "4318:4318" + required: true + - key: jaeger-compact + type: STRING + value: "6831:6831" + required: true + - key: zipkin + type: STRING + value: "9411:9411" + required: true + - key: otlp + type: STRING + value: "4317:4317" + required: true + operations: + [] + - name: opentelemetry-demo-cartservice-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: ASPNETCORE_URLS + type: STRING + value: "http://*:$(CART_SERVICE_PORT)" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: CART_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: REDIS_ADDR + type: STRING + value: "'opentelemetry-demo-redis:6379'" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-emailservice-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: APP_ENV + type: STRING + value: "production" + required: true + - key: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4318/v1/traces" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: EMAIL_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-imageprovider-type + extends: + properties: + - key: service + type: INTEGER + value: 8081 + required: true + - key: OTEL_COLLECTOR_PORT_GRPC + type: STRING + value: "4317" + required: true + - key: OTEL_COLLECTOR_HOST + type: STRING + value: "$(OTEL_COLLECTOR_NAME)" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: IMAGE_PROVIDER_PORT + type: STRING + value: "8081" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: tcp-service + type: STRING + value: "8081:8081" + required: true + operations: + [] + - name: opentelemetry-demo-productcatalogservice-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: MONGO_HOST + type: STRING + value: "'opentelemetry-demo-mongo'" + required: true + - key: PRODUCT_CATALOG_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: MONGO_PASSWORD + type: STRING + value: "'mongo_product_catalog'" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: MONGO_PORT + type: STRING + value: "'27017'" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: MONGO_USERNAME + type: STRING + value: "'mongo'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-accountingservice-type + extends: + properties: + - key: KAFKA_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-kafka:9092'" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + operations: + [] + - name: opentelemetry-demo-checkoutservice-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: KAFKA_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-kafka:9092'" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: PRODUCT_CATALOG_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-productcatalogservice:8080'" + required: true + - key: CHECKOUT_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: PAYMENT_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-paymentservice:8080'" + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: EMAIL_SERVICE_ADDR + type: STRING + value: "http://opentelemetry-demo-emailservice:8080" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: CURRENCY_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-currencyservice:8080'" + required: true + - key: SHIPPING_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-shippingservice:8080'" + required: true + - key: CART_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-cartservice:8080'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-shippingservice-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: QUOTE_SERVICE_ADDR + type: STRING + value: "http://opentelemetry-demo-quoteservice:8080" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: SHIPPING_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-recommendationservice-type + extends: + properties: + - key: service + type: INTEGER + value: 8080 + required: true + - key: FLAGD_PORT + type: STRING + value: "8013" + required: true + - key: OTEL_PYTHON_LOG_CORRELATION + type: STRING + value: "true" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4317" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: PRODUCT_CATALOG_SERVICE_ADDR + type: STRING + value: "'opentelemetry-demo-productcatalogservice:8080'" + required: true + - key: RECOMMENDATION_SERVICE_PORT + type: STRING + value: "8080" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION + type: STRING + value: "python" + required: true + - key: FLAGD_HOST + type: STRING + value: "'opentelemetry-demo-flagd'" + required: true + - key: tcp-service + type: STRING + value: "8080:8080" + required: true + operations: + [] + - name: opentelemetry-demo-kafka-type + extends: + properties: + - key: controller + type: INTEGER + value: 9093 + required: true + - key: plaintext + type: INTEGER + value: 9092 + required: true + - key: KAFKA_HEAP_OPTS + type: STRING + value: "-Xmx400M -Xms400M" + required: true + - key: OTEL_EXPORTER_OTLP_ENDPOINT + type: STRING + value: "http://$(OTEL_COLLECTOR_NAME):4318" + required: true + - key: KAFKA_ADVERTISED_LISTENERS + type: STRING + value: "PLAINTEXT://opentelemetry-demo-kafka:9092" + required: true + - key: OTEL_RESOURCE_ATTRIBUTES + type: STRING + value: "service.name=$(OTEL_SERVICE_NAME),service.namespace=opentelemetry-demo,service.version=1.10.0" + required: true + - key: OTEL_COLLECTOR_NAME + type: STRING + value: "'opentelemetry-demo-otelcol'" + required: true + - key: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + type: STRING + value: "cumulative" + required: true + - key: controller + type: STRING + value: "9093:9093" + required: true + - key: plaintext + type: STRING + value: "9092:9092" + required: true + operations: + [] + - name: opentelemetry-demo-otelcol-type + extends: + properties: + - key: prometheus + type: INTEGER + value: 9464 + required: true + - key: jaeger-compact + type: INTEGER + value: 6831 + required: true + - key: jaeger-thrift + type: INTEGER + value: 14268 + required: true + - key: zipkin + type: INTEGER + value: 9411 + required: true + - key: jaeger-grpc + type: INTEGER + value: 14250 + required: true + - key: otlp + type: INTEGER + value: 4317 + required: true + - key: metrics + type: INTEGER + value: 8888 + required: true + - key: otlp-http + type: INTEGER + value: 4318 + required: true + - key: GOMEMLIMIT + type: STRING + value: "160MiB" + required: true + - key: metrics + type: STRING + value: "8888:8888" + required: true + - key: jaeger-grpc + type: STRING + value: "14250:14250" + required: true + - key: jaeger-thrift + type: STRING + value: "14268:14268" + required: true + - key: otlp-http + type: STRING + value: "4318:4318" + required: true + - key: jaeger-compact + type: STRING + value: "6831:6831" + required: true + - key: zipkin + type: STRING + value: "9411:9411" + required: true + - key: prometheus + type: STRING + value: "9464:9464" + required: true + - key: otlp + type: STRING + value: "4317:4317" + required: true + operations: + [] + - name: opentelemetry-demo-prometheus-server-type + extends: + properties: + - key: container_port + type: INTEGER + value: 9090 + required: true + - key: http + type: STRING + value: "9090:9090" + required: true + operations: + [] +relation types: + - DependsOn: + extends: "-" + description: "generic relation type" + properties: [] + operations: [] + - HostedOn: + extends: "DependsOn" + description: "hosted on relation" + properties: [] + operations: [] + - ConnectsTo: + extends: "DependsOn" + description: "connects to relation" + properties: [] + operations: [] From 53de8ecab76140e843d958ef6d6dddb6d96a1891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20M=C3=BCller?= Date: Thu, 18 Jul 2024 17:35:30 +0200 Subject: [PATCH 24/39] feat: ES-39 add Terrfaform Model of otel-shop --- main.tf | 940 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 940 insertions(+) create mode 100644 main.tf diff --git a/main.tf b/main.tf new file mode 100644 index 0000000000..9294e332c4 --- /dev/null +++ b/main.tf @@ -0,0 +1,940 @@ +terraform { + required_providers { + docker = { + source = "kreuzwerker/docker" + version = "~> 2.13.0" + } + } +} + +variable "project_path" { + type = string + default = "C:\\Users\\Pasca\\Documents\\Uni\\Master\\3. Semester\\Enpro\\opentelemetry-demo" + description = "Path to the project" +} + +variable "seperator" { + type = string + default = "\\" + description = "Path seperator" +} + +provider "docker" { + host = "npipe:////.//pipe//docker_engine" +} + + +# Network Ressource +resource "docker_network" "open-telemetry-network" { + name = "opentelemetry-demo" + driver = "bridge" +} + +# accounting service container +resource "docker_container" "accountingservice-container" { + name = "accounting-service" + image = "ghcr.io/open-telemetry/demo:latest-accountingservice" + depends_on = [docker_container.otelcol, docker_container.kafka] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "accountingservice" + memory = 20 + restart = "unless-stopped" + env = [ + "KAFKA_SERVICE_ADDR=kafka:9092", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317", + "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=Cumulative", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME = accountingservice" + ] + + +} + +#ad service container +resource "docker_container" "adservice-container" { + name = "ad-service" + image = "ghcr.io/open-telemetry/demo:latest-adservice" + depends_on = [docker_container.otelcol, docker_container.flagd] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "adservice" + memory = 300 + restart = "unless-stopped" + ports { + internal = 9555 + } + env = [ + "AD_SERVICE_PORT=9555", + "FLAGD_HOST=flagd", + "FLAGD_PORT=8013", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318", + "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=Cumulative", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_LOGS_EXPORTER=otlp", + "OTEL_SERVICE_NAME=adservice" + ] +} + +#cart service container + +resource "docker_container" "cartservice-container" { + name = "cart-service" + image = "ghcr.io/open-telemetry/demo:latest-cartservice" + depends_on = [docker_container.valkey-cart, docker_container.otelcol, docker_container.flagd] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "cartservice" + memory = 160 + restart = "unless-stopped" + ports { + internal = 7070 + } + env = [ + "CART_SERVICE_PORT=7070", + "FLAGD_HOST=flagd", + "FLAGD_PORT=8013", + "REDIS_ADDR=redis-cart:6379", + "VALKEY_ADDR=valkey-cart:6379", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=cartservice", + "ASPNETCORE_URLS=http://*:7070" + ] + +} + +# checkout service container + +resource "docker_container" "checkoutservice-container" { + name = "checkout-service" + image = "ghcr.io/open-telemetry/demo:latest-checkoutservice" + depends_on = [docker_container.cartservice-container, + docker_container.currencyservice-container, + docker_container.emailservice-container, + docker_container.paymentservice, + docker_container.productcatalogservice, + docker_container.shippingservice, + docker_container.otelcol, + docker_container.flagd] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "checkoutservice" + memory = 20 + restart = "unless-stopped" + ports { + internal = 5050 + } + env = [ + "FLAGD_HOST =flagd", + "FLAGD_PORT =8013", + "CHECKOUT_SERVICE_PORT=5050", + "CART_SERVICE_ADDR=cart-service:7070", + "CURRENCY_SERVICE_ADDR=currencyservice:7001", + "EMAIL_SERVICE_ADDR=http://emailservice:6060", + "PAYMENT_SERVICE_ADDR=paymentservice:50051", + "PRODUCT_CATALOG_SERVICE_ADDR=productcatalogservice:3550", + "SHIPPING_SERVICE_ADDR=shippingservice:50050", + "KAFKA_SERVICE_ADDR=kafka:9092", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318", + "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=Cumulative", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=checkoutservice" + + ] + +} + +# currency service container + +resource "docker_container" "currencyservice-container" { + name = "currency-service" + image = "ghcr.io/open-telemetry/demo:latest-currencyservice" + depends_on = [docker_container.otelcol] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "currencyservice" + memory = 20 + restart = "unless-stopped" + ports { + internal = 7001 + } + env = [ + "CURRENCY_SERVICE_PORT=7001", + "VERSION=1.10.0", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4317", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose ,service.name=currencyservice" + ] + +} + +# email service container + +resource "docker_container" "emailservice-container" { + name = "email-service" + image = "demo/emailservice-contrib:latest" + depends_on = [docker_container.otelcol] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "emailservice" + memory = 100 + restart = "unless-stopped" + ports { + internal = 6060 + } + env = [ + "APP_ENV=production", + "EMAIL_SERVICE_PORT =6060", + "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otelcol:4318/v1/traces", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=emailservice" + ] + +} + +# fraud detection service container + +resource "docker_container" "frauddetectionservice-container" { + name = "frauddetection-service" + image = "ghcr.io/open-telemetry/demo:latest-frauddetectionservice" + depends_on = [docker_container.otelcol, docker_container.kafka] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "frauddetectionservice" + memory = 300 + restart = "unless-stopped" + env = [ + "FLAGD_HOST=flagd", + "FLAGD_PORT=8013", + "KAFKA_SERVICE_ADDR=kafka:9092", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318", + "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=Cumulative", + "OTEL_INSTRUMENTATION_KAFKA_EXPERIMENTAL_SPAN_ATTRIBUTES=true", + "OTEL_INSTRUMENTATION_MESSAGING_EXPERIMENTAL_RECEIVE_TELEMETRY_ENABLED=true", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=frauddetectionservice" + ] + +} + +# frontend container + +resource "docker_container" "frontend" { + name = "frontend" + image = "ghcr.io/open-telemetry/demo:latest-frontend" + depends_on = [docker_container.adservice-container, + docker_container.cartservice-container, + docker_container.checkoutservice-container, + docker_container.currencyservice-container, + docker_container.productcatalogservice, + docker_container.quoteservice, + docker_container.recommendationservice, + docker_container.shippingservice, + docker_container.otelcol, + docker_container.imageprovider, + docker_container.flagd + ] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + memory = 250 + restart = "unless-stopped" + ports { + internal = 8080 + } + env = [ + "PORT=8080", + "FRONTEND_ADDR=frontend:8080", + "AD_SERVICE_ADDR=adservice:9555", + "CART_SERVICE_ADDR=cartservice:7070", + "CHECKOUT_SERVICE_ADDR=checkoutservice:5050", + "CURRENCY_SERVICE_ADDR=currencyservice:7001", + "PRODUCT_CATALOG_SERVICE_ADDR=productcatalogservice:3550", + "RECOMMENDATION_SERVICE_ADDR=recommendationservice:9001", + "SHIPPING_SERVICE_ADDR=shippingservice:50050", + "OTEL_EXPORTER_OTLP_ENDPOINT = http://otelcol:4317", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "ENV_PLATFORM = local", + "OTEL_SERVICE_NAME=frontend", + "PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:8080/otlp-http/v1/traces", + "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative", + "WEB_OTEL_SERVICE_NAME=frontend-web", + "OTEL_COLLECTOR_HOST=otelcol", + "FLAGD_HOST = flagd", + "FLAGD_PORT = 8013" + ] +} + +# frontend proxy (envoy) container + +resource "docker_container" "frontendproxy" { + name = "frontend-proxy" + image = "ghcr.io/open-telemetry/demo:latest-frontendproxy" + depends_on = [docker_container.frontend, + docker_container.loadgenerator, + docker_container.jaeger, + docker_container.grafana] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "frontendproxy" + memory = 50 + restart = "unless-stopped" + ports { + internal = 1000 + external = 1000 + } + ports { + internal = 8080 + external = 8080 + } + env = [ + "FRONTEND_PORT=8080", + "FRONTEND_HOST=frontend", + "LOCUST_WEB_HOST=loadgenerator", + "LOCUST_WEB_PORT=8089", + "GRAFANA_SERVICE_PORT=3000", + "GRAFANA_SERVICE_HOST=grafana", + "JAEGER_SERVICE_PORT=16686", + "JAEGER_SERVICE_HOST=jaeger", + "OTEL_COLLECTOR_HOST=otelcol", + "IMAGE_PROVIDER_HOST=imageprovider", + "IMAGE_PROVIDER_PORT=8081", + "OTEL_COLLECTOR_PORT_GRPC=4317", + "OTEL_COLLECTOR_PORT_HTTP=4318", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "ENVOY_PORT=8080", + "FLAGD_HOST=flagd", + "FLAGD_PORT=8013" + ] + +} + +# image provider container + +resource "docker_container" "imageprovider" { + name = "image-provider" + image = "ghcr.io/open-telemetry/demo:latest-imageprovider" + depends_on = [docker_container.otelcol] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "imageprovider" + memory = 120 + restart = "unless-stopped" + ports { + internal = 8081 + } + env = [ + "IMAGE_PROVIDER_PORT=8081", + "OTEL_COLLECTOR_HOST=otelcol", + "OTEL_COLLECTOR_PORT_GRPC=4317", + "OTEL_SERVICE_NAME=imageprovider", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose" + ] + +} + +# load generator container + +resource "docker_container" "loadgenerator" { + name = "load-generator" + image = "ghcr.io/open-telemetry/demo:latest-loadgenerator" + depends_on = [docker_container.frontend, + docker_container.flagd] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "loadgenerator" + memory = 1000 + restart = "unless-stopped" + ports { + internal = 8089 + } + env = [ + "LOCUST_WEB_PORT=8089", + "LOCUST_USERS=10", + "LOCUST_HOST=http://frontend-proxy:8080", + "LOCUST_HEADLESS=false", + "LOCUST_AUTOSTART=true", + "LOCUST_BROWSER_TRAFFIC_ENABLED=true", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4317", + "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=loadgenerator", + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python", + "LOCUST_WEB_HOST=0.0.0.0", + "FLAGD_HOST=flagd", + "FLAGD_PORT=8013" + ] + +} + +# payment service container + +resource "docker_container" "paymentservice" { + name = "payment-service" + image = "ghcr.io/open-telemetry/demo:latest-paymentservice" + depends_on = [docker_container.otelcol, + docker_container.flagd] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "paymentservice" + memory = 120 + restart = "unless-stopped" + ports { + internal = 50051 + } + env = [ + "PAYMENT_SERVICE_PORT=50051", + "FLAGD_HOST=flagd", + "FLAGD_PORT=8013", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4317", + "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=paymentservice" + ] + +} + +# product catalog service container + +resource "docker_container" "productcatalogservice" { + name = "product-catalog-service" + image = "ghcr.io/open-telemetry/demo:latest-productcatalogservice" + depends_on = [docker_container.otelcol, + docker_container.flagd, + docker_container.mongodb-catalog] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "productcatalogservice" + memory = 20 + restart = "unless-stopped" + ports { + internal = 3550 + } + env = [ + "PRODUCT_CATALOG_SERVICE_PORT=3550", + "FLAGD_HOST=flagd", + "FLAGD_PORT=8013", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4317", + "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=productcatalogservice", + "MONGO_USERNAME=mongo", + "MONGO_PASSWORD=mongo_product_catalog", + "MONGO_HOSTNAME=mongo", + "MONGO_PORT=27017" + ] +} + +# quote service container + +resource "docker_container" "quoteservice" { + name = "quote-service" + image = "ghcr.io/open-telemetry/demo:latest-quoteservice" + depends_on = [docker_container.otelcol] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "quoteservice" + memory = 40 + restart = "unless-stopped" + ports { + internal = 8090 + } + env = [ + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318", + "OTEL_PHP_AUTOLOAD_ENABLED=true", + "QUOTE_SERVICE_PORT=8090", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=quoteservice", + "OTEL_PHP_INTERNAL_METRICS_ENABLED=true" + ] + +} + +# recommendation service container + +resource "docker_container" "recommendationservice" { + name = "recommendation-service" + image = "ghcr.io/open-telemetry/demo:latest-recommendationservice" + depends_on = [docker_container.productcatalogservice, + docker_container.otelcol, + docker_container.flagd + ] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "recommendationservice" + memory = 500 + restart = "unless-stopped" + ports { + internal = 9001 + } + env = [ + "RECOMMENDATION_SERVICE_PORT=9001", + "PRODUCT_CATALOG_SERVICE_ADDR=productcatalogservice:50051", + "FLAGD_HOST=flagd", + "FLAGD_PORT=8013", + "OTEL_PYTHON_LOG_CORRELATION=true", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4317", + "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=recommendationservice", + "PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python" + ] + +} + +# shipping service container + +resource "docker_container" "shippingservice" { + name = "shipping-service" + image = "ghcr.io/open-telemetry/demo:latest-shippingservice" + depends_on = [docker_container.otelcol] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "shippingservice" + memory = 20 + restart = "unless-stopped" + ports { + internal = 50050 + } + env = [ + "SHIPPING_SERVICE_PORT=50050", + "QUOTE_SERVICE_ADDR=http://quoteservice:8090", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4317", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=shippingservice" + ] +} + +# dependent services + +# flagd feature flagging service container + +resource "docker_container" "flagd" { + name = "flagd" + image = "ghcr.io/open-feature/flagd:v0.10.2" + memory = 50 + env = [ + "FLAGD_OTEL_COLLECTOR_URI=otelcol:4317", + "FLAGD_METRICS_EXPORTER=otel", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=flagd" + ] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + command = [ + "start", + "--uri", + "file:./etc/flagd/demo.flagd.json" + ] + ports { + internal = 8013 + } + volumes { + host_path = "${var.project_path}${var.seperator}src${var.seperator}flagd" + container_path = "/etc/flagd" + } + +} + +# kafka container + +resource "docker_container" "kafka" { + name = "kafka" + image = "ghcr.io/open-telemetry/demo:latest-kafka" + memory = 600 + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + restart = "unless-stopped" + ports { + internal = 9092 + } + env = [ + "KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092", + "OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318", + "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative", + "OTEL_RESOURCE_ATTRIBUTES=docker.cli.cobra.command_path=docker%20compose", + "OTEL_SERVICE_NAME=kafka", + "KAFKA_HEAP_OPTS=-Xmx400m -Xms400m" + ] + healthcheck { + test = ["nc", "-z", "kafka 9092"] + start_period = "10s" + interval = "5s" + timeout = "10s" + retries = 10 + + } +} + +# valkey service container (used by cart container) + +resource "docker_container" "valkey-cart" { + name = "valkey-cart" + image = "valkey/valkey:7.2-alpine" + user = "valkey" + memory = 20 + restart = "unless-stopped" + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + ports { + internal = 6379 + } +} + +# mongodb service container (used by product catalog container) + +resource "docker_container" "mongodb-catalog" { + name = "mongodb-catalog" + image = "mongo:8.0.0-rc9" + memory = 256 + restart = "unless-stopped" + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + hostname = "mongo" + ports { + internal = 27017 + external = 27017 + } + env = [ + "MONGO_INITDB_ROOT_USERNAME=mongo", + "MONGO_INITDB_ROOT_PASSWORD=mongo_product_catalog" + ] + healthcheck { + test = [ "echo", "db.runCommand(\"ping\").ok", "|", "mongosh", "localhost:27017/test", "--quiet"] + start_period = "10s" + interval = "5s" + timeout = "10s" + retries = 10 + + } + +} + +# telemetry components + +# jaeger container + +resource "docker_container" "jaeger" { + name = "jaeger" + image = "jaegertracing/all-in-one:1.57" + command = [ + "--memory.max-traces=5000", + "--query.base-path=/jaeger/ui", + "--prometheus.server-url=http://prometheus:9090", + "--prometheus.query.normalize-calls=true", + "--prometheus.query.normalize-duration=true" + ] + memory = 400 + restart = "unless-stopped" + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + ports { + internal = 16686 + } + ports { + internal = 4317 + } + env = [ + "METRICS_STORAGE_TYPE=prometheus" + ] +} + +# grafana container + +resource "docker_container" "grafana" { + name = "grafana" + image = "grafana/grafana:10.4.3" + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + memory = 100 + restart = "unless-stopped" + env = ["GF_INSTALL_PLUGINS=grafana-opensearch-datasource"] + volumes { + host_path = "${var.project_path}${var.seperator}src${var.seperator}grafana${var.seperator}grafana.ini" + container_path = "/etc/grafana/grafana.ini" + + } + volumes { + host_path = "${var.project_path}${var.seperator}src${var.seperator}grafana${var.seperator}provisioning${var.seperator}" + container_path = "/etc/grafana/provisioning/" + } + ports { + internal = 3000 + } + +} + +# opentelemetry collector container + +resource "docker_container" "otelcol" { + name = "otelcol" + image = "otel/opentelemetry-collector-contrib:0.102.1" + depends_on = [docker_container.jaeger] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + memory = 200 + restart = "unless-stopped" + command = ["--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" + ] + volumes { + host_path = "${var.project_path}${var.seperator}src${var.seperator}otelcollector${var.seperator}otelcol-config.yml" + container_path = "/etc/otelcol-config.yml" + } + volumes { + host_path = "${var.project_path}${var.seperator}src${var.seperator}otelcollector${var.seperator}otelcol-config-extras.yml" + container_path = "/etc/otelcol-config-extras.yml" + } + volumes { + host_path = "/var/run/docker.sock" + container_path = "/var/run/docker.sock" + } + ports { + internal = 4317 + } + ports { + internal = 4318 + } + env = ["ENVOY_PORT=8080", + "OTEL_COLLECTOR_HOST=otelcol", + "OTEL_COLLECTOR_PORT_GRPC=4317", + "OTEL_COLLECTOR_PORT_HTTP=4318" + ] + +} + +# prometheus container + +resource "docker_container" "prometheus" { + name = "prometheus" + image = "quay.io/prometheus/prometheus:v2.52.0" + command = ["--web.console.templates=/etc/prometheus/consoles", + "--web.console.libraries=/etc/prometheus/console_libraries", + "--storage.tsdb.retention.time=1h", + "--config.file=/etc/prometheus/prometheus-config.yaml", + "--storage.tsdb.path=/prometheus", + "--web.enable-lifecycle", + "--web.route-prefix=/", + "--enable-feature=exemplar-storage", + "--enable-feature=otlp-write-receiver" + ] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + volumes { + host_path = "${var.project_path}${var.seperator}src${var.seperator}prometheus${var.seperator}prometheus-config.yaml" + container_path = "/etc/prometheus/prometheus-config.yaml" + } + memory = 300 + restart = "unless-stopped" + ports { + internal = 9090 + external = 9090 + } +} + +# open search container + +resource "docker_container" "opensearch" { + name = "opensearch" + image = "opensearchproject/opensearch:1.2.0" + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + memory = 1000 + restart = "unless-stopped" + env = [ + "cluster.name=demo-cluster", + "node.name=demo-node", + "bootstrap.memory_lock=true", + "discovery.type=single-node", + "OPENSEARCH_JAVA_OPTS=-Xms300m -Xmx300m", + "DISABLE_INSTALL_DEMO_CONFIG=true", + "DISABLE_SECURITY_PLUGIN=true" + ] + ports { + internal = 9200 + } +} +# test container + +#frontend test container + +resource "docker_container" "namfrontendTests" { + name = "frontend-tests" + image = "ghcr.io/open-telemetry/demo:latest-frontend-tests" + depends_on = [docker_container.frontend] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + volumes { + host_path = "${var.project_path}${var.seperator}src${var.seperator}frontend${var.seperator}cypress${var.seperator}videos" + container_path = "/app/cypress/videos" + } + volumes { + host_path = "${var.project_path}${var.seperator}src${var.seperator}frontend${var.seperator}cypress${var.seperator}screenshots" + container_path = "/app/cypress/screenshots" + } + env = [ + "CYPRESS_baseUrl=http://frontend:8080", + "FRONTEND_ADDR=frontend:8080", + "NODE_ENV=production"] +} + +# tracebased test container + +resource "docker_container" "traceBasedTests" { + name = "traceBasedTests" + image = "ghcr.io/open-telemetry/demo:latest-traceBasedTests" + depends_on = [docker_container.tracetest-server, + docker_container.frontend, + docker_container.adservice-container, + docker_container.cartservice-container, + docker_container.checkoutservice-container, + docker_container.currencyservice-container, + docker_container.emailservice-container, + docker_container.paymentservice, + docker_container.productcatalogservice, + docker_container.recommendationservice, + docker_container.shippingservice, + docker_container.quoteservice, + docker_container.accountingservice-container, + docker_container.frauddetectionservice-container, + docker_container.flagd] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + env = [ + "AD_SERVICE_ADDR=adservice:9555", + "CART_SERVICE_ADDR = cartservice:7070", + "CHECKOUT_SERVICE_ADDR = checkoutservice:5050", + "CURRENCY_SERVICE_ADDR = currencyservice:7001", + "EMAIL_SERVICE_ADDR = http://emailservice:6060", + "FRONTEND_ADDR = frontend:8080", + "PAYMENT_SERVICE_ADDR = paymentservice:50051", + "PRODUCT_CATALOG_SERVICE_ADDR = productcatalogservice:3550", + "RECOMMENDATION_SERVICE_ADDR = recommendationservice:9001", + "SHIPPING_SERVICE_ADDR = shippingservice:50050", + "KAFKA_SERVICE_ADDR = kafka:9092" + ] + volumes { + host_path = "${var.project_path}${var.seperator}test${var.seperator}tracetesting" + container_path = "/app/test/tracetesting" + } + volumes { + host_path = "${var.project_path}${var.seperator}pb" + container_path = "/app/pb" + } + +} + +# tracetest server container + +resource "docker_container" "tracetest-server" { + name = "tracetest-server" + image = "kubeshop/tracetest:v1.3.0" + depends_on = [docker_container.tracetest-postgres, docker_container.otelcol, docker_container.frontendproxy] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + volumes { + host_path = "${var.project_path}${var.seperator}test${var.seperator}tracetesting${var.seperator}tracetest-config.yaml" + container_path = "/app/tracetest.yaml" + } + volumes { + host_path = "${var.project_path}${var.seperator}test${var.seperator}tracetesting${var.seperator}tracetest-provision.yaml" + container_path = "/app/provision.yaml" + } + command = ["--provisioning-file /app/provision.yaml"] + ports { + internal = 11633 + external = 11633 + } + healthcheck { + test = ["wget", "--spider", "localhost:11633"] + interval = "1s" + timeout = "3s" + retries = 60 + } + +} + +#tracetest postgress container + +resource "docker_container" "tracetest-postgres" { + name = "tracetest-postgres" + image = "postgres:16.3" + env = [ + "POSTGRES_PASSWORD= postgres", + "POSTGRES_USER= postgres" + ] + network_mode = "bridge" + networks_advanced { + name = docker_network.open-telemetry-network.name + } + healthcheck { + test = ["pg_isready", "-U", "$$POSTGRES_USER", "-d", "$$POSTGRES_DB"] + interval = "1s" + timeout = "5s" + retries = 60 + } + ports { + internal = 5432 + } + +} + + + + + + From 6776ead5bc3f691b186dd66890f4505b34d20cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20M=C3=BCller?= Date: Thu, 18 Jul 2024 17:37:03 +0200 Subject: [PATCH 25/39] feat: ES-44 add Ansible Model of otel-shop --- ansible/README.md | 5 + ansible/hosts.yaml | 4 + ansible/main.yaml | 142 + .../accountingservice/defaults/main.yaml | 5 + .../roles/accountingservice/meta/main.yaml | 4 + .../roles/accountingservice/tasks/main.yaml | 27 + ansible/roles/adservice/defaults/main.yaml | 6 + ansible/roles/adservice/meta/main.yaml | 4 + ansible/roles/adservice/tasks/main.yaml | 31 + ansible/roles/cartservice/defaults/main.yaml | 6 + ansible/roles/cartservice/meta/main.yaml | 5 + ansible/roles/cartservice/tasks/main.yaml | 32 + .../roles/checkoutservice/defaults/main.yaml | 13 + ansible/roles/checkoutservice/meta/main.yaml | 11 + ansible/roles/checkoutservice/tasks/main.yaml | 39 + .../roles/currencyservice/defaults/main.yaml | 7 + ansible/roles/currencyservice/meta/main.yaml | 3 + ansible/roles/currencyservice/tasks/main.yaml | 28 + ansible/roles/emailservice/defaults/main.yaml | 6 + ansible/roles/emailservice/meta/main.yaml | 3 + ansible/roles/emailservice/tasks/main.yaml | 28 + ansible/roles/flagd/defaults/main.yaml | 7 + ansible/roles/flagd/files/demo.flagd.json | 105 + ansible/roles/flagd/tasks/main.yaml | 28 + .../frauddetectionservice/defaults/main.yaml | 6 + .../frauddetectionservice/meta/main.yaml | 4 + .../frauddetectionservice/tasks/main.yaml | 31 + ansible/roles/frontend/defaults/main.yaml | 16 + ansible/roles/frontend/meta/main.yaml | 13 + ansible/roles/frontend/tasks/main.yaml | 45 + .../roles/frontendproxy/defaults/main.yaml | 16 + ansible/roles/frontendproxy/meta/main.yaml | 6 + ansible/roles/frontendproxy/tasks/main.yaml | 37 + ansible/roles/grafana/defaults/main.yaml | 7 + ansible/roles/grafana/files/grafana.ini | 1172 ++++++ .../files/provisioning/dashboards/demo.yaml | 14 + .../dashboards/demo/demo-dashboard.json | 1025 +++++ .../opentelemetry-collector-data-flow.json | 2224 +++++++++++ .../demo/opentelemetry-collector.json | 3365 +++++++++++++++++ .../demo/spanmetrics-dashboard.json | 1003 +++++ .../provisioning/datasources/default.yaml | 21 + .../provisioning/datasources/jaeger.yaml | 13 + .../provisioning/datasources/opensearch.yaml | 20 + ansible/roles/grafana/tasks/main.yaml | 26 + .../roles/imageprovider/defaults/main.yaml | 5 + ansible/roles/imageprovider/meta/main.yaml | 3 + ansible/roles/imageprovider/tasks/main.yaml | 29 + ansible/roles/jaeger/defaults/main.yaml | 12 + ansible/roles/jaeger/tasks/main.yaml | 26 + ansible/roles/kafka/defaults/main.yaml | 7 + ansible/roles/kafka/meta/main.yaml | 3 + ansible/roles/kafka/tasks/main.yaml | 29 + .../roles/loadgenerator/defaults/main.yaml | 15 + ansible/roles/loadgenerator/meta/main.yaml | 4 + ansible/roles/loadgenerator/tasks/main.yaml | 41 + ansible/roles/mongo/defaults/main.yaml | 6 + ansible/roles/mongo/tasks/main.yaml | 24 + ansible/roles/opensearch/defaults/main.yaml | 15 + ansible/roles/opensearch/tasks/main.yaml | 25 + ansible/roles/otelcol/defaults/main.yaml | 12 + .../otelcol/files/otelcol-config-extras.yml | 18 + .../roles/otelcol/files/otelcol-config.yml | 69 + ansible/roles/otelcol/tasks/main.yaml | 31 + .../roles/paymentservice/defaults/main.yaml | 5 + ansible/roles/paymentservice/meta/main.yaml | 4 + ansible/roles/paymentservice/tasks/main.yaml | 31 + .../productcatalogservice/defaults/main.yaml | 10 + .../productcatalogservice/meta/main.yaml | 5 + .../productcatalogservice/tasks/main.yaml | 35 + ansible/roles/prometheus/defaults/main.yaml | 15 + .../prometheus/files/prometheus-config.yaml | 11 + ansible/roles/prometheus/tasks/main.yaml | 25 + ansible/roles/quoteservice/defaults/main.yaml | 5 + ansible/roles/quoteservice/meta/main.yaml | 3 + ansible/roles/quoteservice/tasks/main.yaml | 29 + .../recommendationservice/defaults/main.yaml | 8 + .../recommendationservice/meta/main.yaml | 5 + .../recommendationservice/tasks/main.yaml | 33 + .../roles/shippingservice/defaults/main.yaml | 5 + ansible/roles/shippingservice/meta/main.yaml | 3 + ansible/roles/shippingservice/tasks/main.yaml | 28 + ansible/roles/valkeycart/defaults/main.yaml | 5 + ansible/roles/valkeycart/tasks/main.yaml | 22 + 83 files changed, 10274 insertions(+) create mode 100644 ansible/README.md create mode 100644 ansible/hosts.yaml create mode 100644 ansible/main.yaml create mode 100644 ansible/roles/accountingservice/defaults/main.yaml create mode 100644 ansible/roles/accountingservice/meta/main.yaml create mode 100644 ansible/roles/accountingservice/tasks/main.yaml create mode 100644 ansible/roles/adservice/defaults/main.yaml create mode 100644 ansible/roles/adservice/meta/main.yaml create mode 100644 ansible/roles/adservice/tasks/main.yaml create mode 100644 ansible/roles/cartservice/defaults/main.yaml create mode 100644 ansible/roles/cartservice/meta/main.yaml create mode 100644 ansible/roles/cartservice/tasks/main.yaml create mode 100644 ansible/roles/checkoutservice/defaults/main.yaml create mode 100644 ansible/roles/checkoutservice/meta/main.yaml create mode 100644 ansible/roles/checkoutservice/tasks/main.yaml create mode 100644 ansible/roles/currencyservice/defaults/main.yaml create mode 100644 ansible/roles/currencyservice/meta/main.yaml create mode 100644 ansible/roles/currencyservice/tasks/main.yaml create mode 100644 ansible/roles/emailservice/defaults/main.yaml create mode 100644 ansible/roles/emailservice/meta/main.yaml create mode 100644 ansible/roles/emailservice/tasks/main.yaml create mode 100644 ansible/roles/flagd/defaults/main.yaml create mode 100644 ansible/roles/flagd/files/demo.flagd.json create mode 100644 ansible/roles/flagd/tasks/main.yaml create mode 100644 ansible/roles/frauddetectionservice/defaults/main.yaml create mode 100644 ansible/roles/frauddetectionservice/meta/main.yaml create mode 100644 ansible/roles/frauddetectionservice/tasks/main.yaml create mode 100644 ansible/roles/frontend/defaults/main.yaml create mode 100644 ansible/roles/frontend/meta/main.yaml create mode 100644 ansible/roles/frontend/tasks/main.yaml create mode 100644 ansible/roles/frontendproxy/defaults/main.yaml create mode 100644 ansible/roles/frontendproxy/meta/main.yaml create mode 100644 ansible/roles/frontendproxy/tasks/main.yaml create mode 100644 ansible/roles/grafana/defaults/main.yaml create mode 100644 ansible/roles/grafana/files/grafana.ini create mode 100644 ansible/roles/grafana/files/provisioning/dashboards/demo.yaml create mode 100644 ansible/roles/grafana/files/provisioning/dashboards/demo/demo-dashboard.json create mode 100644 ansible/roles/grafana/files/provisioning/dashboards/demo/opentelemetry-collector-data-flow.json create mode 100644 ansible/roles/grafana/files/provisioning/dashboards/demo/opentelemetry-collector.json create mode 100644 ansible/roles/grafana/files/provisioning/dashboards/demo/spanmetrics-dashboard.json create mode 100644 ansible/roles/grafana/files/provisioning/datasources/default.yaml create mode 100644 ansible/roles/grafana/files/provisioning/datasources/jaeger.yaml create mode 100644 ansible/roles/grafana/files/provisioning/datasources/opensearch.yaml create mode 100644 ansible/roles/grafana/tasks/main.yaml create mode 100644 ansible/roles/imageprovider/defaults/main.yaml create mode 100644 ansible/roles/imageprovider/meta/main.yaml create mode 100644 ansible/roles/imageprovider/tasks/main.yaml create mode 100644 ansible/roles/jaeger/defaults/main.yaml create mode 100644 ansible/roles/jaeger/tasks/main.yaml create mode 100644 ansible/roles/kafka/defaults/main.yaml create mode 100644 ansible/roles/kafka/meta/main.yaml create mode 100644 ansible/roles/kafka/tasks/main.yaml create mode 100644 ansible/roles/loadgenerator/defaults/main.yaml create mode 100644 ansible/roles/loadgenerator/meta/main.yaml create mode 100644 ansible/roles/loadgenerator/tasks/main.yaml create mode 100644 ansible/roles/mongo/defaults/main.yaml create mode 100644 ansible/roles/mongo/tasks/main.yaml create mode 100644 ansible/roles/opensearch/defaults/main.yaml create mode 100644 ansible/roles/opensearch/tasks/main.yaml create mode 100644 ansible/roles/otelcol/defaults/main.yaml create mode 100755 ansible/roles/otelcol/files/otelcol-config-extras.yml create mode 100755 ansible/roles/otelcol/files/otelcol-config.yml create mode 100644 ansible/roles/otelcol/tasks/main.yaml create mode 100644 ansible/roles/paymentservice/defaults/main.yaml create mode 100644 ansible/roles/paymentservice/meta/main.yaml create mode 100644 ansible/roles/paymentservice/tasks/main.yaml create mode 100644 ansible/roles/productcatalogservice/defaults/main.yaml create mode 100644 ansible/roles/productcatalogservice/meta/main.yaml create mode 100644 ansible/roles/productcatalogservice/tasks/main.yaml create mode 100644 ansible/roles/prometheus/defaults/main.yaml create mode 100644 ansible/roles/prometheus/files/prometheus-config.yaml create mode 100644 ansible/roles/prometheus/tasks/main.yaml create mode 100644 ansible/roles/quoteservice/defaults/main.yaml create mode 100644 ansible/roles/quoteservice/meta/main.yaml create mode 100644 ansible/roles/quoteservice/tasks/main.yaml create mode 100644 ansible/roles/recommendationservice/defaults/main.yaml create mode 100644 ansible/roles/recommendationservice/meta/main.yaml create mode 100644 ansible/roles/recommendationservice/tasks/main.yaml create mode 100644 ansible/roles/shippingservice/defaults/main.yaml create mode 100644 ansible/roles/shippingservice/meta/main.yaml create mode 100644 ansible/roles/shippingservice/tasks/main.yaml create mode 100644 ansible/roles/valkeycart/defaults/main.yaml create mode 100644 ansible/roles/valkeycart/tasks/main.yaml diff --git a/ansible/README.md b/ansible/README.md new file mode 100644 index 0000000000..48f2cc862b --- /dev/null +++ b/ansible/README.md @@ -0,0 +1,5 @@ +### ANSIBLE +To execute the ansible files from run in this directory (ansible): +```shell +sudo ansible-playbook -i hosts.yaml main.yaml +``` \ No newline at end of file diff --git a/ansible/hosts.yaml b/ansible/hosts.yaml new file mode 100644 index 0000000000..ece60a1e5e --- /dev/null +++ b/ansible/hosts.yaml @@ -0,0 +1,4 @@ +all: + hosts: + localhost: + ansible_connection: local \ No newline at end of file diff --git a/ansible/main.yaml b/ansible/main.yaml new file mode 100644 index 0000000000..8a77c84e6f --- /dev/null +++ b/ansible/main.yaml @@ -0,0 +1,142 @@ +--- +- name: Deploy OpenTelemetry Demo + hosts: all + become: true + vars: + demo_version: "1.10.0" + network_name: "opentelemetry-demo" + state: "started" + restart_policy: "unless-stopped" + log_driver: "json-file" + log_options_max_size: "5m" + log_options_max_file: "2" + flagd_host: "flagd" + flagd_port: "8013" + otel_collector_host: "otelcol" + otel_collector_port_grpc: "4317" + otel_collector_port_http: "4318" + envoy_port: "8080" + pre_tasks: + #- name: Ensure Docker is installed + # apt: + # name: docker.io + # state: present + # become: true + + - name: Ensure default network is created + docker_network: + name: opentelemetry-demo + driver: bridge + + roles: + - role: accountingservice + become: true + - role: adservice + become: true + - role: cartservice + become: true + - role: checkoutservice + become: true + - role: currencyservice + become: true + - role: emailservice + become: true + - role: frauddetectionservice + become: true + - role: flagd + become: true + - role: frontend + become: true + - role: frontendproxy + become: true + - role: grafana + become: true + - role: imageprovider + become: true + - role: jaeger + become: true + - role: kafka + become: true + - role: loadgenerator + become: true + - role: mongo + become: true + - role: opensearch + become: true + - role: otelcol + become: true + - role: paymentservice + become: true + - role: productcatalogservice + become: true + - role: prometheus + become: true + - role: quoteservice + become: true + - role: recommendationservice + become: true + - role: shippingservice + become: true + - role: valkeycart + become: true + + post_tasks: + - name: Ensure services are started + community.general.launchd: + name: "{{ item }}" + state: "{{ state }}" + loop: + - accountingservice + - adservice + - cartservice + - checkoutservice + - emailservice + - flagd + - frauddetectionserice + - frontend + - frontendproxy + - grafana + - imageprovider + - jaeger + - kafka + - loadgenerator + - mongo + - opensearch + - otelcol + - paymentservice + - productcatalogservice + - prometheus + - quoteservice + - recommendationservice + - shippingservice + - valkeycart + + - name: Ensure services are enabled to start at boot + community.general.launchd: + name: "{{ item }}" + enabled: yes + loop: + - accountingservice + - adservice + - cartservice + - checkoutservice + - emailservice + - flagd + - frauddetectionserice + - frontend + - frontendproxy + - grafana + - imageprovider + - jaeger + - kafka + - loadgenerator + - mongo + - opensearch + - otelcol + - paymentservice + - productcatalogservice + - prometheus + - quoteservice + - recommendationservice + - shippingservice + - valkeycart diff --git a/ansible/roles/accountingservice/defaults/main.yaml b/ansible/roles/accountingservice/defaults/main.yaml new file mode 100644 index 0000000000..acf3cf78f0 --- /dev/null +++ b/ansible/roles/accountingservice/defaults/main.yaml @@ -0,0 +1,5 @@ +service_name: "accountingservice" +image_name: "ghcr.io/open-telemetry/demo:1.10.0-accountingservice" +otlp_metrics_temporality_preference : "cumulative" +memory_limit: "50M" +kafkaservice_addr: "kafka:9092" \ No newline at end of file diff --git a/ansible/roles/accountingservice/meta/main.yaml b/ansible/roles/accountingservice/meta/main.yaml new file mode 100644 index 0000000000..ffb62d3178 --- /dev/null +++ b/ansible/roles/accountingservice/meta/main.yaml @@ -0,0 +1,4 @@ +--- +dependencies: + - role: kafka + - role: otelcol \ No newline at end of file diff --git a/ansible/roles/accountingservice/tasks/main.yaml b/ansible/roles/accountingservice/tasks/main.yaml new file mode 100644 index 0000000000..9e4a9e382d --- /dev/null +++ b/ansible/roles/accountingservice/tasks/main.yaml @@ -0,0 +1,27 @@ +--- +- name: Pull the latest Docker image + docker_image: + name: "{{ image_name }}:{{ demo_version }}-{{ service_name }}" + source: pull + +- name: Deploy Service + docker_container: + name: "{{ service_name }}" + image: "{{ image_name }}" + env: + OTEL_EXPORTER_OTLP_ENDPOINT: "http://{{ otel_collector_host }}:{{ otel_collector_port_http }}" + OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: "{{ otlp_metrics_temporality_preference }}" + OTEL_RESOURCE_ATTRIBUTES: "service.name={{ service_name }},service.namespace=opentelemetry-demo,service.version={{ demo_version }}" + OTEL_SERVICE_NAME: "{{ service_name }}" + KAFKA_SERVICE_ADDR: "{{ kafkaservice_addr }}" + restart_policy: "{{ restart_policy }}" + memory: "{{ memory_limit }}" + state: "{{ state }}" + network_mode: "{{ network_name }}" + networks: + - name: "{{ network_name }}" + log_driver: "{{ log_driver }}" + log_options: + max-size: "{{ log_options_max_size }}" + max-file: "{{ log_options_max_file }}" + tag: "{{ service_name }}" \ No newline at end of file diff --git a/ansible/roles/adservice/defaults/main.yaml b/ansible/roles/adservice/defaults/main.yaml new file mode 100644 index 0000000000..21150941d4 --- /dev/null +++ b/ansible/roles/adservice/defaults/main.yaml @@ -0,0 +1,6 @@ +service_name: "adservice" +image_name: "ghcr.io/open-telemetry/demo:1.10.0-adservice" +ports: "9555" +otlp_metrics_temporality_preference : "cumulative" +memory_limit: "300M" +logs_exporter: "otlp" diff --git a/ansible/roles/adservice/meta/main.yaml b/ansible/roles/adservice/meta/main.yaml new file mode 100644 index 0000000000..40f8df1485 --- /dev/null +++ b/ansible/roles/adservice/meta/main.yaml @@ -0,0 +1,4 @@ +--- +dependencies: + - role: otelcol + - role: flagd \ No newline at end of file diff --git a/ansible/roles/adservice/tasks/main.yaml b/ansible/roles/adservice/tasks/main.yaml new file mode 100644 index 0000000000..60fd565229 --- /dev/null +++ b/ansible/roles/adservice/tasks/main.yaml @@ -0,0 +1,31 @@ +--- +- name: Pull the latest Docker image + docker_image: + name: "{{ image_name }}:{{ demo_version }}-{{ service_name }}" + source: pull + +- name: Deploy Service + docker_container: + name: "{{ service_name }}" + image: "{{ image_name }}" + env: + OTEL_EXPORTER_OTLP_ENDPOINT: "http://{{ otel_collector_host }}:{{ otel_collector_port_http }}" + OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: "{{ otlp_metrics_temporality_preference }}" + OTEL_RESOURCE_ATTRIBUTES: "service.name={{ service_name }},service.namespace=opentelemetry-demo,service.version={{ demo_version }}" + OTEL_SERVICE_NAME: "{{ service_name }}" + OTEL_LOGS_EXPORTER: "{{ logs_exporter }}" + AD_SERVICE_PORT: "{{ ports }}" + FLAGD_HOST: "{{ flagd_host }}" + FLAGD_PORT: "{{ flagd_port }}" + restart_policy: "{{ restart_policy }}" + memory: "{{ memory_limit }}" + state: "{{ state }}" + ports: "{{ ports }}" + network_mode: "{{ network_name }}" + networks: + - name: "{{ network_name }}" + log_driver: "{{ log_driver }}" + log_options: + max-size: "{{ log_options_max_size }}" + max-file: "{{ log_options_max_file }}" + tag: "{{ service_name }}" \ No newline at end of file diff --git a/ansible/roles/cartservice/defaults/main.yaml b/ansible/roles/cartservice/defaults/main.yaml new file mode 100644 index 0000000000..c8cfbfd4a5 --- /dev/null +++ b/ansible/roles/cartservice/defaults/main.yaml @@ -0,0 +1,6 @@ +service_name: "cartservice" +image_name: "ghcr.io/open-telemetry/demo:1.10.0-cartservice" +ports: "7070" +memory_limit: "160M" +valkey_addr: "valkeycart:6379" +aspnetcore_urls: "http://*:7070" \ No newline at end of file diff --git a/ansible/roles/cartservice/meta/main.yaml b/ansible/roles/cartservice/meta/main.yaml new file mode 100644 index 0000000000..c9f8762a7a --- /dev/null +++ b/ansible/roles/cartservice/meta/main.yaml @@ -0,0 +1,5 @@ +--- +dependencies: + - role: otelcol + - role: flagd + - role: valkeycart \ No newline at end of file diff --git a/ansible/roles/cartservice/tasks/main.yaml b/ansible/roles/cartservice/tasks/main.yaml new file mode 100644 index 0000000000..7e481c32a1 --- /dev/null +++ b/ansible/roles/cartservice/tasks/main.yaml @@ -0,0 +1,32 @@ +--- +- name: Pull the latest Docker image + docker_image: + name: "{{ image_name }}:{{ demo_version }}-{{ service_name }}" + source: pull + +- name: Deploy Service + docker_container: + name: "{{ service_name }}" + image: "{{ image_name }}" + env: + OTEL_EXPORTER_OTLP_ENDPOINT: "http://{{ otel_collector_host }}:{{ otel_collector_port_grpc }}" + OTEL_RESOURCE_ATTRIBUTES: "service.name={{ service_name }},service.namespace=opentelemetry-demo,service.version={{ demo_version }}" + OTEL_SERVICE_NAME: "{{ service_name }}" + CART_SERVICE_PORT: "{{ ports }}" + VALKEY_ADDR: "{{ valkey_addr }}" + REDIS_ADDR: "{{ valkey_addr }}" + ASPNETCORE_URLS: "{{ aspnetcore_urls }}" + FLAGD_HOST: "{{ flagd_host }}" + FLAGD_PORT: "{{ flagd_port }}" + restart_policy: "{{ restart_policy }}" + memory: "{{ memory_limit }}" + state: "{{ state }}" + ports: "{{ ports }}" + network_mode: "{{ network_name }}" + networks: + - name: "{{ network_name }}" + log_driver: "{{ log_driver }}" + log_options: + max-size: "{{ log_options_max_size }}" + max-file: "{{ log_options_max_file }}" + tag: "{{ service_name }}" \ No newline at end of file diff --git a/ansible/roles/checkoutservice/defaults/main.yaml b/ansible/roles/checkoutservice/defaults/main.yaml new file mode 100644 index 0000000000..fdc1d6ac29 --- /dev/null +++ b/ansible/roles/checkoutservice/defaults/main.yaml @@ -0,0 +1,13 @@ +service_name: "checkoutservice" +image_name: "ghcr.io/open-telemetry/demo:1.10.0-checkoutservice" +ports: "5050" +otlp_metrics_temporality_preference : "cumulative" +memory_limit: "20M" +logs_exporter: "otlp" +cartservice_addr: "cartservice:7070" +currencyservice_addr: "currencyservice:7001" +emailservice_addr: "http://emailservice:6060" +paymentservice_addr: "paymentservice:50051" +productcatalogservice_addr: "productcatalogservice:3550" +shippingservice_addr: "shippingservice:50050" +kafkaservice_addr: "kafka:9092" \ No newline at end of file diff --git a/ansible/roles/checkoutservice/meta/main.yaml b/ansible/roles/checkoutservice/meta/main.yaml new file mode 100644 index 0000000000..f76e5e61db --- /dev/null +++ b/ansible/roles/checkoutservice/meta/main.yaml @@ -0,0 +1,11 @@ +--- +dependencies: + - role: cartservice + - role: currencyservice + - role: emailservice + - role: paymentservice + - role: productcatalogservice + - role: shippingservice + - role: otelcol + - role: kafka + - role: flagd \ No newline at end of file diff --git a/ansible/roles/checkoutservice/tasks/main.yaml b/ansible/roles/checkoutservice/tasks/main.yaml new file mode 100644 index 0000000000..2f38a1532d --- /dev/null +++ b/ansible/roles/checkoutservice/tasks/main.yaml @@ -0,0 +1,39 @@ +--- +- name: Pull the latest Docker image + docker_image: + name: "{{ image_name }}:{{ demo_version }}-{{ service_name }}" + source: pull + +- name: Deploy Service + docker_container: + name: "{{ service_name }}" + image: "{{ image_name }}" + env: + OTEL_EXPORTER_OTLP_ENDPOINT: "http://{{ otel_collector_host }}:{{ otel_collector_port_grpc }}" + OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: "{{ otlp_metrics_temporality_preference }}" + OTEL_RESOURCE_ATTRIBUTES: "service.name={{ service_name }},service.namespace=opentelemetry-demo,service.version={{ demo_version }}" + OTEL_SERVICE_NAME: "{{ service_name }}" + OTEL_LOGS_EXPORTER: "{{ logs_exporter }}" + CHECKOUT_SERVICE_PORT: "{{ ports }}" + FLAGD_HOST: "{{ flagd_host }}" + FLAGD_PORT: "{{ flagd_port }}" + CART_SERVICE_ADDR: "{{ cartservice_addr }}" + CURRENCY_SERVICE_ADDR: "{{ currencyservice_addr }}" + EMAIL_SERVICE_ADDR: "{{ emailservice_addr }}" + PAYMENT_SERVICE_ADDR: "{{ paymentservice_addr }}" + PRODUCT_CATALOG_SERVICE_ADDR: "{{ productcatalogservice_addr }}" + SHIPPING_SERVICE_ADDR: "{{ shippingservice_addr }}" + KAFKA_SERVICE_ADDR: "{{ kafkaservice_addr }}" + + restart_policy: "{{ restart_policy }}" + memory: "{{ memory_limit }}" + state: "{{ state }}" + ports: "{{ ports }}" + network_mode: "{{ network_name }}" + networks: + - name: "{{ network_name }}" + log_driver: "{{ log_driver }}" + log_options: + max-size: "{{ log_options_max_size }}" + max-file: "{{ log_options_max_file }}" + tag: "{{ service_name }}" \ No newline at end of file diff --git a/ansible/roles/currencyservice/defaults/main.yaml b/ansible/roles/currencyservice/defaults/main.yaml new file mode 100644 index 0000000000..2bb299e9d8 --- /dev/null +++ b/ansible/roles/currencyservice/defaults/main.yaml @@ -0,0 +1,7 @@ +service_name: "currencyservice" +image_name: "ghcr.io/open-telemetry/demo:1.10.0-currencyservice" +ports: "7001" +otlp_metrics_temporality_preference : "cumulative" +memory_limit: "20M" + +logs_exporter: "otlp" diff --git a/ansible/roles/currencyservice/meta/main.yaml b/ansible/roles/currencyservice/meta/main.yaml new file mode 100644 index 0000000000..9ef25e04db --- /dev/null +++ b/ansible/roles/currencyservice/meta/main.yaml @@ -0,0 +1,3 @@ +--- +dependencies: + - role: otelcol \ No newline at end of file diff --git a/ansible/roles/currencyservice/tasks/main.yaml b/ansible/roles/currencyservice/tasks/main.yaml new file mode 100644 index 0000000000..e4b75e7fde --- /dev/null +++ b/ansible/roles/currencyservice/tasks/main.yaml @@ -0,0 +1,28 @@ +--- +- name: Pull the latest Docker image + docker_image: + name: "{{ image_name }}:{{ demo_version }}-{{ service_name }}" + source: pull + +- name: Deploy Service + docker_container: + name: "{{ service_name }}" + image: "{{ image_name }}" + env: + OTEL_EXPORTER_OTLP_ENDPOINT: "http://{{ otel_collector_host }}:{{ otel_collector_port_grpc }}" + OTEL_RESOURCE_ATTRIBUTES: "service.name={{ service_name }},service.namespace=opentelemetry-demo,service.version={{ demo_version }}" + OTEL_SERVICE_NAME: "{{ service_name }}" + VERSION: "{{ demo_version }}" + CURRENCY_SERVICE_PORT: "{{ ports }}" + restart_policy: "{{ restart_policy }}" + memory: "{{ memory_limit }}" + state: "{{ state }}" + ports: "{{ ports }}" + network_mode: "{{ network_name }}" + networks: + - name: "{{ network_name }}" + log_driver: "{{ log_driver }}" + log_options: + max-size: "{{ log_options_max_size }}" + max-file: "{{ log_options_max_file }}" + tag: "{{ service_name }}" \ No newline at end of file diff --git a/ansible/roles/emailservice/defaults/main.yaml b/ansible/roles/emailservice/defaults/main.yaml new file mode 100644 index 0000000000..77bed9bd9c --- /dev/null +++ b/ansible/roles/emailservice/defaults/main.yaml @@ -0,0 +1,6 @@ +service_name: "emailservice" +image_name: "ghcr.io/open-telemetry/demo:1.10.0-emailservice" +ports: "6060" +otlp_metrics_temporality_preference : "cumulative" +memory_limit: "100M" +app_env: "production" \ No newline at end of file diff --git a/ansible/roles/emailservice/meta/main.yaml b/ansible/roles/emailservice/meta/main.yaml new file mode 100644 index 0000000000..9ef25e04db --- /dev/null +++ b/ansible/roles/emailservice/meta/main.yaml @@ -0,0 +1,3 @@ +--- +dependencies: + - role: otelcol \ No newline at end of file diff --git a/ansible/roles/emailservice/tasks/main.yaml b/ansible/roles/emailservice/tasks/main.yaml new file mode 100644 index 0000000000..07a49acbff --- /dev/null +++ b/ansible/roles/emailservice/tasks/main.yaml @@ -0,0 +1,28 @@ +--- +- name: Pull the latest Docker image + docker_image: + name: "{{ image_name }}"#:{{ demo_version }}-{{ service_name }}" + source: pull + +- name: Deploy Service + docker_container: + name: "{{ service_name }}" + image: "{{ image_name }}" + env: + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://{{ otel_collector_host }}:{{ otel_collector_port_http }}/v1/traces" + OTEL_RESOURCE_ATTRIBUTES: "service.name={{ service_name }},service.namespace=opentelemetry-demo,service.version={{ demo_version }}" + OTEL_SERVICE_NAME: "{{ service_name }}" + EMAIL_SERVICE_PORT: "{{ ports }}" + APP_ENV: "{{ app_env }}" + restart_policy: "{{ restart_policy }}" + memory: "{{ memory_limit }}" + state: "{{ state }}" + ports: "{{ ports }}" + network_mode: "{{ network_name }}" + networks: + - name: "{{ network_name }}" + log_driver: "{{ log_driver }}" + log_options: + max-size: "{{ log_options_max_size }}" + max-file: "{{ log_options_max_file }}" + tag: "{{ service_name }}" \ No newline at end of file diff --git a/ansible/roles/flagd/defaults/main.yaml b/ansible/roles/flagd/defaults/main.yaml new file mode 100644 index 0000000000..249f95e9cf --- /dev/null +++ b/ansible/roles/flagd/defaults/main.yaml @@ -0,0 +1,7 @@ +service_name: "flagd" +image_name: "ghcr.io/open-feature/flagd:v0.10.2" +ports: "8013" +memory_limit: "50M" +command: '["start", "--uri", "file:./etc/flagd/demo.flagd.json"]' +volumes: + - ./roles/flagd/files/demo.flagd.json:/etc/flagd/demo.flagd.json \ No newline at end of file diff --git a/ansible/roles/flagd/files/demo.flagd.json b/ansible/roles/flagd/files/demo.flagd.json new file mode 100644 index 0000000000..2d46891ef2 --- /dev/null +++ b/ansible/roles/flagd/files/demo.flagd.json @@ -0,0 +1,105 @@ +{ + "$schema": "https://flagd.dev/schema/v0/flags.json", + "flags": { + "productCatalogFailure": { + "description": "Fail product catalog service on a specific product", + "state": "ENABLED", + "variants": { + "on": true, + "off": false + }, + "defaultVariant": "off" + }, + "recommendationServiceCacheFailure": { + "description": "Fail recommendation service cache", + "state": "ENABLED", + "variants": { + "on": true, + "off": false + }, + "defaultVariant": "off" + }, + "adServiceManualGc": { + "description": "Triggers full manual garbage collections in the ad service", + "state": "ENABLED", + "variants": { + "on": true, + "off": false + }, + "defaultVariant": "off" + }, + "adServiceHighCpu": { + "description": "Triggers high cpu load in the ad service", + "state": "ENABLED", + "variants": { + "on": true, + "off": false + }, + "defaultVariant": "off" + }, + "adServiceFailure": { + "description": "Fail ad service", + "state": "ENABLED", + "variants": { + "on": true, + "off": false + }, + "defaultVariant": "off" + }, + "kafkaQueueProblems": { + "description": "Overloads Kafka queue while simultaneously introducing a consumer side delay leading to a lag spike", + "state": "ENABLED", + "variants": { + "on": 100, + "off": 0 + }, + "defaultVariant": "off" + }, + "cartServiceFailure": { + "description": "Fail cart service", + "state": "ENABLED", + "variants": { + "on": true, + "off": false + }, + "defaultVariant": "off" + }, + "paymentServiceFailure": { + "description": "Fail payment service charge requests", + "state": "ENABLED", + "variants": { + "on": true, + "off": false + }, + "defaultVariant": "off" + }, + "paymentServiceUnreachable": { + "description": "Payment service is unavailable", + "state": "ENABLED", + "variants": { + "on": true, + "off": false + }, + "defaultVariant": "off" + }, + "loadgeneratorFloodHomepage": { + "description": "Flood the frontend with a large amount of requests.", + "state": "ENABLED", + "variants": { + "on": 100, + "off": 0 + }, + "defaultVariant": "off" + }, + "imageSlowLoad": { + "description": "slow loading images in the frontend", + "state": "ENABLED", + "variants": { + "10sec": 10000, + "5sec": 5000, + "off": 0 + }, + "defaultVariant": "off" + } + } +} diff --git a/ansible/roles/flagd/tasks/main.yaml b/ansible/roles/flagd/tasks/main.yaml new file mode 100644 index 0000000000..93a8e7741a --- /dev/null +++ b/ansible/roles/flagd/tasks/main.yaml @@ -0,0 +1,28 @@ +--- +- name: Pull the latest Docker image + docker_image: + name: "{{ image_name }}" + source: pull + +- name: Deploy Service + docker_container: + name: "{{ service_name }}" + image: "{{ image_name }}" + env: + FLAGD_OTEL_COLLECTOR_URI: "{{ otel_collector_host }}:{{ otel_collector_port_grpc }}" + FLAGD_METRICS_EXPORTER: "otel" + OTEL_RESOURCE_ATTRIBUTES: "service.name={{ service_name }},service.namespace=opentelemetry-demo,service.version={{ demo_version }}" + OTEL_SERVICE_NAME: "{{ service_name }}" + memory: "{{ memory_limit }}" + ports: "{{ ports }}" + state: "{{ state }}" + command: "{{ command }}" + volumes: "{{ volumes }}" + network_mode: "{{ network_name }}" + networks: + - name: "{{ network_name }}" + log_driver: "{{ log_driver }}" + log_options: + max-size: "{{ log_options_max_size }}" + max-file: "{{ log_options_max_file }}" + tag: "{{ service_name }}" \ No newline at end of file diff --git a/ansible/roles/frauddetectionservice/defaults/main.yaml b/ansible/roles/frauddetectionservice/defaults/main.yaml new file mode 100644 index 0000000000..11a8588b85 --- /dev/null +++ b/ansible/roles/frauddetectionservice/defaults/main.yaml @@ -0,0 +1,6 @@ +service_name: "frauddetectionservice" +image_name: "ghcr.io/open-telemetry/demo:1.10.0-frauddetectionservice" +otlp_metrics_temporality_preference : "cumulative" +memory_limit: "300M" +kafkaservice_addr: "kafka:9092" +otlp_experimental_features: "true" \ No newline at end of file diff --git a/ansible/roles/frauddetectionservice/meta/main.yaml b/ansible/roles/frauddetectionservice/meta/main.yaml new file mode 100644 index 0000000000..81fa803285 --- /dev/null +++ b/ansible/roles/frauddetectionservice/meta/main.yaml @@ -0,0 +1,4 @@ +--- +dependencies: + - role: otelcol + - role: kafka \ No newline at end of file diff --git a/ansible/roles/frauddetectionservice/tasks/main.yaml b/ansible/roles/frauddetectionservice/tasks/main.yaml new file mode 100644 index 0000000000..d11f741c24 --- /dev/null +++ b/ansible/roles/frauddetectionservice/tasks/main.yaml @@ -0,0 +1,31 @@ +--- +- name: Pull the latest Docker image + docker_image: + name: "{{ image_name }}:{{ demo_version }}-{{ service_name }}" + source: pull + +- name: Deploy Service + docker_container: + name: "{{ service_name }}" + image: "{{ image_name }}" + env: + OTEL_EXPORTER_OTLP_ENDPOINT: "http://{{ otel_collector_host }}:{{ otel_collector_port_http }}" + OTEL_RESOURCE_ATTRIBUTES: "service.name={{ service_name }},service.namespace=opentelemetry-demo,service.version={{ demo_version }}" + OTEL_SERVICE_NAME: "{{ service_name }}" + FLAGD_HOST: "{{ flagd_host }}" + FLAGD_PORT: "{{ flagd_port }}" + KAFKA_SERVICE_ADDR: "{{ kafkaservice_addr }}" + OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: "{{ otlp_metrics_temporality_preference }}" + OTEL_INSTRUMENTATION_KAFKA_EXPERIMENTAL_SPAN_ATTRIBUTES: "{{ otlp_experimental_features }}" + OTEL_INSTRUMENTATION_MESSAGING_EXPERIMENTAL_RECEIVE_TELEMETRY_ENABLED: "{{ otlp_experimental_features }}" + restart_policy: "{{ restart_policy }}" + memory: "{{ memory_limit }}" + state: "{{ state }}" + network_mode: "{{ network_name }}" + networks: + - name: "{{ network_name }}" + log_driver: "{{ log_driver }}" + log_options: + max-size: "{{ log_options_max_size }}" + max-file: "{{ log_options_max_file }}" + tag: "{{ service_name }}" \ No newline at end of file diff --git a/ansible/roles/frontend/defaults/main.yaml b/ansible/roles/frontend/defaults/main.yaml new file mode 100644 index 0000000000..0d6b0e22bf --- /dev/null +++ b/ansible/roles/frontend/defaults/main.yaml @@ -0,0 +1,16 @@ +service_name: "frontend" +image_name: "ghcr.io/open-telemetry/demo:1.10.0-frontend" +ports: "8080" +otlp_metrics_temporality_preference : "cumulative" +memory_limit: "250M" +kafkaservice_addr: "kafka:9092" +adservice_addr: "adservice:9555" +cartservice_addr: "cartservice:7070" +checkoutservice_addr: "checkoutservice:5050" +currencyservice_addr: "currencyservice:7001" +productcatalogservice_addr: "productcatalogservice:3550" +recommendationservice_addr: "recommendationservice:9001" +shippingservice_addr: "shippingservice:50050" +env_platform: "local" +otlp_exporter_traces_endpoint: "http://otelcol:8080/otlp-http/v1/traces" +web_otel_service_name: "frontend-web" \ No newline at end of file diff --git a/ansible/roles/frontend/meta/main.yaml b/ansible/roles/frontend/meta/main.yaml new file mode 100644 index 0000000000..cae13714bb --- /dev/null +++ b/ansible/roles/frontend/meta/main.yaml @@ -0,0 +1,13 @@ +--- +dependencies: + - role: adservice + - role: cartservice + - role: checkoutservice + - role: currencyservice + - role: productcatalogservice + - role: quoteservice + - role: recommendationservice + - role: shippingservice + - role: otelcol + - role: imageprovider + - role: flagd \ No newline at end of file diff --git a/ansible/roles/frontend/tasks/main.yaml b/ansible/roles/frontend/tasks/main.yaml new file mode 100644 index 0000000000..2a04687d9b --- /dev/null +++ b/ansible/roles/frontend/tasks/main.yaml @@ -0,0 +1,45 @@ +--- +- name: Pull the latest Docker image + docker_image: + name: "{{ image_name }}:{{ demo_version }}-{{ service_name }}" + source: pull + +- name: Deploy Service + docker_container: + name: "{{ service_name }}" + image: "{{ image_name }}" + env: + OTEL_EXPORTER_OTLP_ENDPOINT: "http://{{ otel_collector_host }}:{{ otel_collector_port_grpc }}" + OTEL_RESOURCE_ATTRIBUTES: "service.name={{ service_name }},service.namespace=opentelemetry-demo,service.version={{ demo_version }}" + OTEL_SERVICE_NAME: "{{ service_name }}" + VERSION: "{{ demo_version }}" + FLAGD_HOST: "{{ flagd_host }}" + FLAGD_PORT: "{{ flagd_port }}" + KAFKA_SERVICE_ADDR: "{{ kafkaservice_addr }}" + OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: "{{ otlp_metrics_temporality_preference }}" + PORT: "{{ ports }}" + FRONTEND_ADDR: "{{ service_name }}:{{ ports }}" + AD_SERVICE_ADDR: "{{ adservice_addr }}" + CART_SERVICE_ADDR: "{{ cartservice_addr }}" + CHECKOUT_SERVICE_ADDR: "{{ checkoutservice_addr }}" + CURRENCY_SERVICE_ADDR: "{{ currencyservice_addr }}" + PRODUCT_CATALOG_SERVICE_ADDR: "{{ productcatalogservice_addr }}" + RECOMMENDATION_SERVICE_ADDR: "{{ recommendationservice_addr }}" + SHIPPING_SERVICE_ADDR: "{{ shippingservice_addr }}" + ENV_PLATFORM: "{{ env_platform }}" + PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "{{ otlp_exporter_traces_endpoint }}" + WEB_OTEL_SERVICE_NAME: "{{ web_otel_service_name }}" + otel_collector_host: "{{ otel_collector_host }}" + + restart_policy: "{{ restart_policy }}" + memory: "{{ memory_limit }}" + ports: "{{ ports }}" + state: "{{ state }}" + network_mode: "{{ network_name }}" + networks: + - name: "{{ network_name }}" + log_driver: "{{ log_driver }}" + log_options: + max-size: "{{ log_options_max_size }}" + max-file: "{{ log_options_max_file }}" + tag: "{{ service_name }}" \ No newline at end of file diff --git a/ansible/roles/frontendproxy/defaults/main.yaml b/ansible/roles/frontendproxy/defaults/main.yaml new file mode 100644 index 0000000000..350ae1d9a4 --- /dev/null +++ b/ansible/roles/frontendproxy/defaults/main.yaml @@ -0,0 +1,16 @@ +service_name: "frontendproxy" +image_name: "ghcr.io/open-telemetry/demo:1.10.0-frontendproxy" +ports: + - "10000:10000" + - "8080:8080" +memory_limit: "50M" +locust_web_host: "loadgenerator" +locust_web_port: "8089" +jaeger_host: "jaeger" +jaeger_port: "16686" +imageprovider_host: "imageprovider" +imageprovider_port: "8081" +grafana_host: "grafana" +grafana_port: "3000" +frontend_host: "frontend" +frontend_port: "8080" \ No newline at end of file diff --git a/ansible/roles/frontendproxy/meta/main.yaml b/ansible/roles/frontendproxy/meta/main.yaml new file mode 100644 index 0000000000..719fed4a58 --- /dev/null +++ b/ansible/roles/frontendproxy/meta/main.yaml @@ -0,0 +1,6 @@ +--- +dependencies: + - role: frontend + - role: jaeger + - role: loadgenerator + - role: grafana diff --git a/ansible/roles/frontendproxy/tasks/main.yaml b/ansible/roles/frontendproxy/tasks/main.yaml new file mode 100644 index 0000000000..fdf1c92644 --- /dev/null +++ b/ansible/roles/frontendproxy/tasks/main.yaml @@ -0,0 +1,37 @@ +--- +- name: Pull the latest Docker image + docker_image: + name: "{{ image_name }}:{{ demo_version }}-{{ service_name }}" + source: pull + +- name: Deploy Service + docker_container: + name: "{{ service_name }}" + image: "{{ image_name }}" + env: + OTEL_RESOURCE_ATTRIBUTES: "service.name={{ service_name }},service.namespace=opentelemetry-demo,service.version={{ demo_version }}" + OTEL_SERVICE_NAME: "{{ service_name }}" + OTEL_COLLECTOR_HOST: "{{ otel_collector_host }}" + FLAGD_HOST: "{{ flagd_host }}" + FLAGD_PORT: "{{ flagd_port }}" + OTEL_COLLECTOR_PORT_GRPC: "{{ otel_collector_port_grpc }}" + OTEL_COLLECTOR_PORT_HTTP: "{{ otel_collector_port_http }}" + FRONTEND_HOST: "{{ frontend_host }}" + FRONTEND_PORT: "{{ frontend_port }}" + GRAFANA_SERVICE_HOST: "{{ grafana_host }}" + GRAFANA_SERVICE_PORT: "{{ grafana_port }}" + IMAGE_PROVIDER_HOST: "{{ imageprovider_host }}" + IMAGE_PROVIDER_PORT: "{{ imageprovider_port }}" + JAEGER_SERVICE_HOST: "{{ jaeger_host }}" + JAEGER_SERVICE_PORT: "{{ jaeger_port }}" + LOCUST_WEB_HOST: "{{ locust_web_host }}" + LOCUST_WEB_PORT: "{{ locust_web_port }}" + ENVOY_PORT: "{{ envoy_port }}" + restart_policy: "{{ restart_policy }}" + memory: "{{ memory_limit }}" + ports: "{{ ports }}" + state: "{{ state }}" + network_mode: "{{ network_name }}" + networks: + - name: "{{ network_name }}" + log_driver: "{{ log_driver }}" \ No newline at end of file diff --git a/ansible/roles/grafana/defaults/main.yaml b/ansible/roles/grafana/defaults/main.yaml new file mode 100644 index 0000000000..f1488d6ba5 --- /dev/null +++ b/ansible/roles/grafana/defaults/main.yaml @@ -0,0 +1,7 @@ +service_name: "grafana" +image_name: "grafana/grafana:10.4.3" +memory_limit: "100M" +ports: "3000" +volumes: + - ./roles/grafana/files/grafana.ini:/etc/grafana/grafana.ini + - ./roles/grafana/files/provisioning/:/etc/grafana/provisioning/ \ No newline at end of file diff --git a/ansible/roles/grafana/files/grafana.ini b/ansible/roles/grafana/files/grafana.ini new file mode 100644 index 0000000000..2443041290 --- /dev/null +++ b/ansible/roles/grafana/files/grafana.ini @@ -0,0 +1,1172 @@ + + +##################### Grafana Configuration Example ##################### +# +# Everything has defaults so you only need to uncomment things you want to +# change + +# possible values : production, development +;app_mode = production + +# instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty +;instance_name = ${HOSTNAME} + +# force migration will run migrations that might cause dataloss +;force_migration = false + +#################################### Paths #################################### +[paths] +# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used) +;data = /var/lib/grafana + +# Temporary files in `data` directory older than given duration will be removed +;temp_data_lifetime = 24h + +# Directory where grafana can store logs +;logs = /var/log/grafana + +# Directory where grafana will automatically scan and look for plugins +;plugins = /var/lib/grafana/plugins + +# folder that contains provisioning config files that grafana will apply on startup and while running. +provisioning = /etc/grafana/provisioning + +#################################### Server #################################### +[server] +# Protocol (http, https, h2, socket) +protocol = http + +# The ip address to bind to, empty will bind to all interfaces +;http_addr = + +# The http port to use +http_port = 3000 + +# The public facing domain name used to access grafana from a browser +domain = localhost + +# Redirect to correct domain if host header does not match domain +# Prevents DNS rebinding attacks +;enforce_domain = false + +# The full public facing url you use in browser, used for redirects and emails +# If you use reverse proxy and sub path specify full url (with sub path) +root_url = %(protocol)s://%(domain)s/grafana/ + +# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons. +serve_from_sub_path = true + +# Log web requests +;router_logging = false + +# the path relative working path +;static_root_path = public + +# enable gzip +;enable_gzip = false + +# https certs & key file +;cert_file = +;cert_key = + +# Unix socket path +;socket = + +# CDN Url +;cdn_url = + +# Sets the maximum time using a duration format (5s/5m/5ms) before timing out read of an incoming request and closing idle connections. +# `0` means there is no timeout for reading the request. +;read_timeout = 0 + +#################################### Database #################################### +[database] +# You can configure the database connection by specifying type, host, name, user and password +# as separate properties or as on string using the url properties. + +# Either "mysql", "postgres" or "sqlite3", it's your choice +;type = sqlite3 +;host = 127.0.0.1:3306 +;name = grafana +;user = root +# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" +;password = + +# Use either URL or the previous fields to configure the database +# Example: mysql://user:secret@host:port/database +;url = + +# For "postgres" only, either "disable", "require" or "verify-full" +;ssl_mode = disable + +# Database drivers may support different transaction isolation levels. +# Currently, only "mysql" driver supports isolation levels. +# If the value is empty - driver's default isolation level is applied. +# For "mysql" use "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ" or "SERIALIZABLE". +;isolation_level = + +;ca_cert_path = +;client_key_path = +;client_cert_path = +;server_cert_name = + +# For "sqlite3" only, path relative to data_path setting +;path = grafana.db + +# Max idle conn setting default is 2 +;max_idle_conn = 2 + +# Max conn setting default is 0 (mean not set) +;max_open_conn = + +# Connection Max Lifetime default is 14400 (means 14400 seconds or 4 hours) +;conn_max_lifetime = 14400 + +# Set to true to log the sql calls and execution times. +;log_queries = + +# For "sqlite3" only. cache mode setting used for connecting to the database. (private, shared) +;cache_mode = private + +# For "mysql" only if lockingMigration feature toggle is set. How many seconds to wait before failing to lock the database for the migrations, default is 0. +;locking_attempt_timeout_sec = 0 + +################################### Data sources ######################### +[datasources] +# Upper limit of data sources that Grafana will return. This limit is a temporary configuration and it will be deprecated when pagination will be introduced on the list data sources API. +;datasource_limit = 5000 + +#################################### Cache server ############################# +[remote_cache] +# Either "redis", "memcached" or "database" default is "database" +;type = database + +# cache connectionstring options +# database: will use Grafana primary database. +# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=0,ssl=false`. Only addr is required. ssl may be 'true', 'false', or 'insecure'. +# memcache: 127.0.0.1:11211 +;connstr = + +#################################### Data proxy ########################### +[dataproxy] + +# This enables data proxy logging, default is false +;logging = false + +# How long the data proxy waits to read the headers of the response before timing out, default is 30 seconds. +# This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set. +;timeout = 30 + +# How long the data proxy waits to establish a TCP connection before timing out, default is 10 seconds. +;dialTimeout = 10 + +# How many seconds the data proxy waits before sending a keepalive probe request. +;keep_alive_seconds = 30 + +# How many seconds the data proxy waits for a successful TLS Handshake before timing out. +;tls_handshake_timeout_seconds = 10 + +# How many seconds the data proxy will wait for a server's first response headers after +# fully writing the request headers if the request has an "Expect: 100-continue" +# header. A value of 0 will result in the body being sent immediately, without +# waiting for the server to approve. +;expect_continue_timeout_seconds = 1 + +# Optionally limits the total number of connections per host, including connections in the dialing, +# active, and idle states. On limit violation, dials will block. +# A value of zero (0) means no limit. +;max_conns_per_host = 0 + +# The maximum number of idle connections that Grafana will keep alive. +;max_idle_connections = 100 + +# How many seconds the data proxy keeps an idle connection open before timing out. +;idle_conn_timeout_seconds = 90 + +# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false. +;send_user_header = false + +# Limit the amount of bytes that will be read/accepted from responses of outgoing HTTP requests. +;response_limit = 0 + +# Limits the number of rows that Grafana will process from SQL data sources. +;row_limit = 1000000 + +#################################### Analytics #################################### +[analytics] +# Server reporting, sends usage counters to stats.grafana.org every 24 hours. +# No ip addresses are being tracked, only simple counters to track +# running instances, dashboard and error counts. It is very helpful to us. +# Change this option to false to disable reporting. +;reporting_enabled = true + +# The name of the distributor of the Grafana instance. Ex hosted-grafana, grafana-labs +;reporting_distributor = grafana-labs + +# Set to false to disable all checks to https://grafana.com +# for new versions of grafana. The check is used +# in some UI views to notify that a grafana update exists. +# This option does not cause any auto updates, nor send any information +# only a GET request to https://raw.githubusercontent.com/grafana/grafana/main/latest.json to get the latest version. +;check_for_updates = true + +# Set to false to disable all checks to https://grafana.com +# for new versions of plugins. The check is used +# in some UI views to notify that a plugin update exists. +# This option does not cause any auto updates, nor send any information +# only a GET request to https://grafana.com to get the latest versions. +;check_for_plugin_updates = true + +# Google Analytics universal tracking code, only enabled if you specify an id here +;google_analytics_ua_id = + +# Google Tag Manager ID, only enabled if you specify an id here +;google_tag_manager_id = + +# Rudderstack write key, enabled only if rudderstack_data_plane_url is also set +;rudderstack_write_key = + +# Rudderstack data plane url, enabled only if rudderstack_write_key is also set +;rudderstack_data_plane_url = + +# Rudderstack SDK url, optional, only valid if rudderstack_write_key and rudderstack_data_plane_url is also set +;rudderstack_sdk_url = + +# Rudderstack Config url, optional, used by Rudderstack SDK to fetch source config +;rudderstack_config_url = + +# Controls if the UI contains any links to user feedback forms +;feedback_links_enabled = true + +#################################### Security #################################### +[security] +# disable creation of admin user on first start of grafana +;disable_initial_admin_creation = false + +# default admin user, created on startup +;admin_user = admin + +# default admin password, can be changed before first start of grafana, or in profile settings +;admin_password = admin + +# used for signing +;secret_key = SW2YcwTIb9zpOOhoPsMm + +# current key provider used for envelope encryption, default to static value specified by secret_key +;encryption_provider = secretKey.v1 + +# list of configured key providers, space separated (Enterprise only): e.g., awskms.v1 azurekv.v1 +;available_encryption_providers = + +# disable gravatar profile images +;disable_gravatar = false + +# data source proxy whitelist (ip_or_domain:port separated by spaces) +;data_source_proxy_whitelist = + +# disable protection against brute force login attempts +;disable_brute_force_login_protection = false + +# set to true if you host Grafana behind HTTPS. default is false. +;cookie_secure = false + +# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict", "none" and "disabled" +;cookie_samesite = lax + +# set to true if you want to allow browsers to render Grafana in a ,