Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ CHAOS_SDK_CONFIG_DIR=/var/site24x7-labs/faults
# S247_APM_ENABLED=false
# S247_LICENSE_KEY=
# SITE24X7_APP_NAME=ZylkerKart-Auth

# ── Site24x7 OpenTelemetry (Optional) ───────────────────────────────────────
# Mutually exclusive with S247_APM_ENABLED. License key is sent as the OTLP
# `Api-Key` header. Pick the regional endpoint matching your datacenter.
# S247_OTEL_ENABLED=false
# S247_LICENSE_KEY=
# OTEL_SERVICE_NAME=ZylkerKart-Auth
# OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.site24x7.com:443
# OTEL_EXPORTER_OTLP_HEADERS=Api-Key=${S247_LICENSE_KEY}
# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
# OTEL_RESOURCE_ATTRIBUTES=service.name=ZylkerKart-Auth,service.version=1.0.0,deployment.environment=baremetal
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,14 @@ CHAOS_SDK_CONFIG_DIR=/var/site24x7-labs/faults
# APMINSIGHT_LICENSE_KEY=
# APMINSIGHT_APP_NAME=ZylkerKart-Order
# APMINSIGHT_APP_PORT=8082

# ── Site24x7 OpenTelemetry (Optional) ───────────────────────────────────────
# Mutually exclusive with S247_APM_ENABLED. License key is sent as the OTLP
# `Api-Key` header. Pick the regional endpoint matching your datacenter.
# S247_OTEL_ENABLED=false
# S247_LICENSE_KEY=
# OTEL_SERVICE_NAME=ZylkerKart-Order
# OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.site24x7.com:443
# OTEL_EXPORTER_OTLP_HEADERS=Api-Key=${S247_LICENSE_KEY}
# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
# OTEL_RESOURCE_ATTRIBUTES=service.name=ZylkerKart-Order,service.version=1.0.0,deployment.environment=baremetal
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,14 @@ CHAOS_SDK_CONFIG_DIR=/var/site24x7-labs/faults
# S247_APM_ENABLED=false
# S247_LICENSE_KEY=
# APM_APP_NAME=ZylkerKart-Payment

# ── Site24x7 OpenTelemetry (Optional) ───────────────────────────────────────
# Mutually exclusive with S247_APM_ENABLED. License key is sent as the OTLP
# `Api-Key` header. Pick the regional endpoint matching your datacenter.
# S247_OTEL_ENABLED=false
# S247_LICENSE_KEY=
# OTEL_SERVICE_NAME=ZylkerKart-Payment
# OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.site24x7.com:443
# OTEL_EXPORTER_OTLP_HEADERS=Api-Key=${S247_LICENSE_KEY}
# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
# OTEL_RESOURCE_ATTRIBUTES=service.name=ZylkerKart-Payment,service.version=1.0.0,deployment.environment=baremetal
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,14 @@ CHAOS_SDK_CONFIG_DIR=/var/site24x7-labs/faults
# ── Site24x7 APM (Optional) ─────────────────────────────────────────────────
# S247_APM_ENABLED=false
# S247_LICENSE_KEY=

# ── Site24x7 OpenTelemetry (Optional) ───────────────────────────────────────
# Mutually exclusive with S247_APM_ENABLED. License key is sent as the OTLP
# `Api-Key` header. Pick the regional endpoint matching your datacenter.
# S247_OTEL_ENABLED=false
# S247_LICENSE_KEY=
# OTEL_SERVICE_NAME=ZylkerKart-Product
# OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.site24x7.com:443
# OTEL_EXPORTER_OTLP_HEADERS=Api-Key=${S247_LICENSE_KEY}
# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
# OTEL_RESOURCE_ATTRIBUTES=service.name=ZylkerKart-Product,service.version=1.0.0,deployment.environment=baremetal
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,14 @@ CHAOS_SDK_CONFIG_DIR=/var/site24x7-labs/faults
# ── Site24x7 APM (Optional) ─────────────────────────────────────────────────
# S247_APM_ENABLED=false
# S247_LICENSE_KEY=

# ── Site24x7 OpenTelemetry (Optional) ───────────────────────────────────────
# Mutually exclusive with S247_APM_ENABLED. License key is sent as the OTLP
# `Api-Key` header. Pick the regional endpoint matching your datacenter.
# S247_OTEL_ENABLED=false
# S247_LICENSE_KEY=
# OTEL_SERVICE_NAME=ZylkerKart-Search
# OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.site24x7.com:443
# OTEL_EXPORTER_OTLP_HEADERS=Api-Key=${S247_LICENSE_KEY}
# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
# OTEL_RESOURCE_ATTRIBUTES=service.name=ZylkerKart-Search,service.version=1.0.0,deployment.environment=baremetal
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ CHAOS_SDK_CONFIG_DIR=/var/site24x7-labs/faults
# S247_APM_ENABLED=false
# S247_LICENSE_KEY=
# SITE24X7_RUM_KEY=

# ── Site24x7 OpenTelemetry (Optional) ───────────────────────────────────────
# Mutually exclusive with S247_APM_ENABLED. License key is sent as the OTLP
# `Api-Key` header. Pick the regional endpoint matching your datacenter.
# S247_OTEL_ENABLED=false
# S247_LICENSE_KEY=
# OTEL_SERVICE_NAME=ZylkerKart-Storefront
# OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.site24x7.com:443
# OTEL_EXPORTER_OTLP_HEADERS=Api-Key=${S247_LICENSE_KEY}
# OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
# OTEL_RESOURCE_ATTRIBUTES=service.name=ZylkerKart-Storefront,service.version=1.0.0,deployment.environment=baremetal
127 changes: 122 additions & 5 deletions Applications/ZylkerKart_Ecommerce/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,28 @@ version: "3.9"
# S247_LICENSE_KEY=your_license_key_here
#
# When S247_APM_ENABLED=false (default), services run without any APM overhead.
#
# Site24x7 OpenTelemetry Integration
# ──────────────────────────────────
# Alternatively (and mutually exclusive with the proprietary APM agents above),
# every service can export traces/metrics to Site24x7 via the OpenTelemetry
# OTLP/HTTP protocol:
#
# S247_OTEL_ENABLED=true \
# S247_LICENSE_KEY=<your_key> \
# S247_OTEL_ENDPOINT=https://otel.site24x7.com:443 \
# docker compose up
#
# Regional endpoints (set S247_OTEL_ENDPOINT accordingly):
# US https://otel.site24x7.com:443
# EU https://otel.site24x7.eu:443
# India https://otel.site24x7.in:443
# China https://otel.site24x7.cn:443
# Australia https://otel.site24x7.com.au:443
#
# The license key is sent as the `Api-Key` OTLP header. When S247_OTEL_ENABLED
# and S247_APM_ENABLED are both true, OTel takes precedence per service to
# avoid agent collisions (e.g. dual -javaagent loaders).
# ─────────────────────────────────────────────────────────────────────────────

services:
Expand Down Expand Up @@ -87,9 +109,28 @@ services:
REDIS_HOST: redis
REDIS_PORT: 6379
S247_APM_ENABLED: ${S247_APM_ENABLED:-false}
S247_OTEL_ENABLED: ${S247_OTEL_ENABLED:-false}
S247_LICENSE_KEY: ${S247_LICENSE_KEY:-}
S247_OTEL_ENDPOINT: ${S247_OTEL_ENDPOINT:-https://otel.site24x7.com:443}
OTEL_SERVICE_NAME: ZylkerKart-Product
entrypoint: ["/bin/sh", "-c", "
if [ \"$$S247_APM_ENABLED\" = \"true\" ]; then
if [ \"$$S247_OTEL_ENABLED\" = \"true\" ]; then
echo '[OTel] Enabled for Product Service (Java)';
if [ ! -f /opt/otel-agent/opentelemetry-javaagent.jar ]; then
echo '[OTel] Downloading OpenTelemetry Java agent...';
apt-get update -qq && apt-get install -y -qq wget > /dev/null 2>&1;
mkdir -p /opt/otel-agent;
wget -q -O /opt/otel-agent/opentelemetry-javaagent.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar;
echo '[OTel] Java agent installed.';
fi;
export OTEL_EXPORTER_OTLP_ENDPOINT=$$S247_OTEL_ENDPOINT;
export OTEL_EXPORTER_OTLP_HEADERS=\"Api-Key=$$S247_LICENSE_KEY\";
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf;
export OTEL_RESOURCE_ATTRIBUTES=service.name=$$OTEL_SERVICE_NAME,service.version=1.0.0,deployment.environment=demo;
exec java -Xms256m -Xmx512m
-javaagent:/opt/otel-agent/opentelemetry-javaagent.jar
-jar app.jar;
elif [ \"$$S247_APM_ENABLED\" = \"true\" ]; then
echo '[Site24x7] APM enabled for Product Service (Java)';
if [ ! -f /opt/s247-agent/apminsight-javaagent.jar ]; then
echo '[Site24x7] Downloading Java agent...';
Expand All @@ -113,6 +154,7 @@ services:
"]
volumes:
- s247_java_agent:/opt/s247-agent
- otel_java_product:/opt/otel-agent
depends_on:
mysql:
condition: service_healthy
Expand Down Expand Up @@ -150,12 +192,31 @@ services:
PAYMENT_SERVICE_URL: http://payment-service:8084
AUTH_SERVICE_URL: http://auth-service:8085
S247_APM_ENABLED: ${S247_APM_ENABLED:-false}
S247_OTEL_ENABLED: ${S247_OTEL_ENABLED:-false}
S247_LICENSE_KEY: ${S247_LICENSE_KEY:-}
S247_OTEL_ENDPOINT: ${S247_OTEL_ENDPOINT:-https://otel.site24x7.com:443}
OTEL_SERVICE_NAME: ZylkerKart-Order
APMINSIGHT_LICENSE_KEY: ${S247_LICENSE_KEY:-}
APMINSIGHT_APP_NAME: ZylkerKart-Order
APMINSIGHT_APP_PORT: 8082
command: ["/bin/sh", "-c", "
if [ \"$$S247_APM_ENABLED\" = \"true\" ]; then
if [ \"$$S247_OTEL_ENABLED\" = \"true\" ]; then
echo '[OTel] Enabled for Order Service (Node.js)';
npm install --silent --no-save \
@opentelemetry/api \
@opentelemetry/sdk-node \
@opentelemetry/auto-instrumentations-node \
@opentelemetry/exporter-trace-otlp-http \
@opentelemetry/exporter-metrics-otlp-http \
@opentelemetry/sdk-metrics \
@opentelemetry/resources \
@opentelemetry/semantic-conventions 2>/dev/null;
export OTEL_EXPORTER_OTLP_ENDPOINT=$$S247_OTEL_ENDPOINT;
export OTEL_EXPORTER_OTLP_HEADERS=\"Api-Key=$$S247_LICENSE_KEY\";
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf;
export OTEL_RESOURCE_ATTRIBUTES=service.name=$$OTEL_SERVICE_NAME,service.version=1.0.0,deployment.environment=demo;
exec node --require ./src/tracing.js src/app.js;
elif [ \"$$S247_APM_ENABLED\" = \"true\" ]; then
echo '[Site24x7] APM enabled for Order Service (Node.js)';
npm install apminsight --silent 2>/dev/null;
echo '[Site24x7] Node.js agent installed.';
Expand Down Expand Up @@ -197,6 +258,13 @@ services:
DB_NAME: db_search
REDIS_HOST: redis
REDIS_PORT: 6379
S247_OTEL_ENABLED: ${S247_OTEL_ENABLED:-false}
S247_LICENSE_KEY: ${S247_LICENSE_KEY:-}
OTEL_SERVICE_NAME: ZylkerKart-Search
OTEL_EXPORTER_OTLP_ENDPOINT: ${S247_OTEL_ENDPOINT:-https://otel.site24x7.com:443}
OTEL_EXPORTER_OTLP_HEADERS: "Api-Key=${S247_LICENSE_KEY:-}"
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
OTEL_RESOURCE_ATTRIBUTES: "service.name=ZylkerKart-Search,service.version=1.0.0,deployment.environment=demo"
depends_on:
mysql:
condition: service_healthy
Expand Down Expand Up @@ -232,10 +300,24 @@ services:
REDIS_HOST: redis
REDIS_PORT: 6379
S247_APM_ENABLED: ${S247_APM_ENABLED:-false}
S247_OTEL_ENABLED: ${S247_OTEL_ENABLED:-false}
S247_LICENSE_KEY: ${S247_LICENSE_KEY:-}
S247_OTEL_ENDPOINT: ${S247_OTEL_ENDPOINT:-https://otel.site24x7.com:443}
OTEL_SERVICE_NAME: ZylkerKart-Payment
APM_APP_NAME: ZylkerKart-Payment
command: ["/bin/sh", "-c", "
if [ \"$$S247_APM_ENABLED\" = \"true\" ]; then
if [ \"$$S247_OTEL_ENABLED\" = \"true\" ]; then
echo '[OTel] Enabled for Payment Service (Python)';
pip install -q opentelemetry-distro opentelemetry-exporter-otlp \
opentelemetry-instrumentation-fastapi opentelemetry-instrumentation-mysql \
opentelemetry-instrumentation-httpx opentelemetry-instrumentation-logging 2>/dev/null;
opentelemetry-bootstrap -a install >/dev/null 2>&1 || true;
export OTEL_EXPORTER_OTLP_ENDPOINT=$$S247_OTEL_ENDPOINT;
export OTEL_EXPORTER_OTLP_HEADERS=\"Api-Key=$$S247_LICENSE_KEY\";
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf;
export OTEL_RESOURCE_ATTRIBUTES=service.name=$$OTEL_SERVICE_NAME,service.version=1.0.0,deployment.environment=demo;
exec opentelemetry-instrument uvicorn app.main:app --host 0.0.0.0 --port 8084;
elif [ \"$$S247_APM_ENABLED\" = \"true\" ]; then
echo '[Site24x7] APM enabled for Payment Service (Python)';
if [ ! -f /opt/S247DataExporter/bin/service.sh ]; then
echo '[Site24x7] Installing S247DataExporter...';
Expand Down Expand Up @@ -292,10 +374,20 @@ services:
JWT_EXPIRY_MINUTES: 15
JWT_REFRESH_EXPIRY_DAYS: 7
S247_APM_ENABLED: ${S247_APM_ENABLED:-false}
S247_OTEL_ENABLED: ${S247_OTEL_ENABLED:-false}
S247_LICENSE_KEY: ${S247_LICENSE_KEY:-}
S247_OTEL_ENDPOINT: ${S247_OTEL_ENDPOINT:-https://otel.site24x7.com:443}
OTEL_SERVICE_NAME: ZylkerKart-Auth
OTEL_EXPORTER_OTLP_ENDPOINT: ${S247_OTEL_ENDPOINT:-https://otel.site24x7.com:443}
OTEL_EXPORTER_OTLP_HEADERS: "Api-Key=${S247_LICENSE_KEY:-}"
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
OTEL_RESOURCE_ATTRIBUTES: "service.name=ZylkerKart-Auth,service.version=1.0.0,deployment.environment=demo"
SITE24X7_APP_NAME: ZylkerKart-Auth
entrypoint: ["/bin/sh", "-c", "
if [ \"$$S247_APM_ENABLED\" = \"true\" ]; then
if [ \"$$S247_OTEL_ENABLED\" = \"true\" ]; then
echo '[OTel] Enabled for Auth Service (.NET) — exporter wired via OpenTelemetry SDK';
exec dotnet AuthService.dll;
elif [ \"$$S247_APM_ENABLED\" = \"true\" ]; then
echo '[Site24x7] APM enabled for Auth Service (.NET)';
if [ ! -f /opt/apminsight/dotnet/ApmInsightDotNetCoreAgent/DotNetCoreAgent/apminsight.conf ]; then
echo '[Site24x7] Downloading .NET agent...';
Expand Down Expand Up @@ -357,9 +449,28 @@ services:
REDIS_HOST: redis
REDIS_PORT: 6379
S247_APM_ENABLED: ${S247_APM_ENABLED:-false}
S247_OTEL_ENABLED: ${S247_OTEL_ENABLED:-false}
S247_LICENSE_KEY: ${S247_LICENSE_KEY:-}
S247_OTEL_ENDPOINT: ${S247_OTEL_ENDPOINT:-https://otel.site24x7.com:443}
OTEL_SERVICE_NAME: ZylkerKart-Storefront
entrypoint: ["/bin/sh", "-c", "
if [ \"$$S247_APM_ENABLED\" = \"true\" ]; then
if [ \"$$S247_OTEL_ENABLED\" = \"true\" ]; then
echo '[OTel] Enabled for Storefront (Java)';
if [ ! -f /opt/otel-agent/opentelemetry-javaagent.jar ]; then
echo '[OTel] Downloading OpenTelemetry Java agent...';
apt-get update -qq && apt-get install -y -qq wget > /dev/null 2>&1;
mkdir -p /opt/otel-agent;
wget -q -O /opt/otel-agent/opentelemetry-javaagent.jar https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar;
echo '[OTel] Java agent installed.';
fi;
export OTEL_EXPORTER_OTLP_ENDPOINT=$$S247_OTEL_ENDPOINT;
export OTEL_EXPORTER_OTLP_HEADERS=\"Api-Key=$$S247_LICENSE_KEY\";
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf;
export OTEL_RESOURCE_ATTRIBUTES=service.name=$$OTEL_SERVICE_NAME,service.version=1.0.0,deployment.environment=demo;
exec java -Xms256m -Xmx512m
-javaagent:/opt/otel-agent/opentelemetry-javaagent.jar
-jar app.jar;
elif [ \"$$S247_APM_ENABLED\" = \"true\" ]; then
echo '[Site24x7] APM enabled for Storefront (Java)';
if [ ! -f /opt/s247-agent/apminsight-javaagent.jar ]; then
echo '[Site24x7] Downloading Java agent...';
Expand All @@ -383,6 +494,7 @@ services:
"]
volumes:
- s247_java_storefront:/opt/s247-agent
- otel_java_storefront:/opt/otel-agent
depends_on:
- product-service
- order-service
Expand Down Expand Up @@ -436,6 +548,11 @@ volumes:
driver: local
s247_java_storefront:
driver: local
# OTel javaagent cache volumes (persist across restarts)
otel_java_product:
driver: local
otel_java_storefront:
driver: local

# ── Networks ───────────────────────────────────────────────────────────────
networks:
Expand Down
51 changes: 51 additions & 0 deletions Applications/ZylkerKart_Ecommerce/k8s/site24x7-otel-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# ─────────────────────────────────────────────────────────────────────────────
# ZylkerKart — Site24x7 OpenTelemetry credentials
# ─────────────────────────────────────────────────────────────────────────────
# This Secret holds the Site24x7 license key used by the OTel exporter as the
# OTLP `Api-Key` header. Apply it before rolling out workloads with
# S247_OTEL_ENABLED=true:
#
# 1. Replace REPLACE_WITH_YOUR_SITE24X7_LICENSE_KEY below (or apply via
# `kubectl create secret generic ...` with --from-literal).
# 2. kubectl apply -f k8s/site24x7-otel-secret.yaml
# 3. In each Deployment, source S247_LICENSE_KEY from this Secret (see the
# ConfigMap-based deployments in `Terraform Deployment/k8s-resources.tf`
# — switch the `value_from.config_map_key_ref` for S247_LICENSE_KEY to a
# `secret_key_ref` pointing at this Secret).
#
# Regional OTLP endpoints (set via the ConfigMap or per-Deployment env):
# US https://otel.site24x7.com:443
# EU https://otel.site24x7.eu:443
# India https://otel.site24x7.in:443
# China https://otel.site24x7.cn:443
# Australia https://otel.site24x7.com.au:443
# ─────────────────────────────────────────────────────────────────────────────
apiVersion: v1
kind: Secret
metadata:
name: site24x7-otel
namespace: zylkerkart
labels:
app.kubernetes.io/part-of: zylkerkart
app.kubernetes.io/component: observability
type: Opaque
stringData:
# Site24x7 device license key — used as the OTLP `Api-Key` header.
S247_LICENSE_KEY: "REPLACE_WITH_YOUR_SITE24X7_LICENSE_KEY"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: site24x7-otel-config
namespace: zylkerkart
labels:
app.kubernetes.io/part-of: zylkerkart
app.kubernetes.io/component: observability
data:
# Toggle OTel export on/off without touching service Deployments.
S247_OTEL_ENABLED: "true"
# Pick the regional endpoint matching your Site24x7 datacenter.
S247_OTEL_ENDPOINT: "https://otel.site24x7.com:443"
OTEL_EXPORTER_OTLP_ENDPOINT: "https://otel.site24x7.com:443"
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=demo,service.namespace=zylkerkart"
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0" />
<PackageReference Include="Site24x7.Chaos" Version="1.1.2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.2.0" />
<PackageReference Include="OpenTelemetry" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.10.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.10.0-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.10.0" />
</ItemGroup>

</Project>
Loading