Skip to content

Commit

Permalink
Merge pull request #71
Browse files Browse the repository at this point in the history
Ref #70
- temporary patch for "the app should export traces using automatic instrumentation (ref #69 )": using server_programmatic.py instead of server_automatic.py
- updates done (otlp gRPC, apm-collector version)
  • Loading branch information
gwenblum authored Oct 17, 2023
2 parents 05bd665 + c1bbd67 commit d3145ba
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
12 changes: 6 additions & 6 deletions 103-opentelemetry-otlp-python-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ services:

opentelemetry-collector:

image: registry.hub.docker.com/aternity/apm-collector:2022.4.0-4
image: registry.hub.docker.com/aternity/apm-collector:2022.11.0-4

container_name: aternity-opentelemetry-collector
container_name: apm-collector

environment:

SERVER_URL: "wss://agents.apm.myaccount.aternity.com/?RPM_AGENT_CUSTOMER_ID=12341234-12341234-13241234"

ports:
- "4318:4318/tcp"
- "4317:4317/tcp"
```
Then, start the containers from the shell. The collector can be configured at the same time using environment variables.
Expand All @@ -58,7 +58,7 @@ export ATERNITY_SAAS_SERVER_HOST="agents.apm.myaccount.aternity.com"
export ATERNITY_CUSTOMER_ID="12341234-12341234-13241234"

# Start the containers
docker-compose up
docker compose up
```

Using PowerShell:
Expand All @@ -72,7 +72,7 @@ $env:ATERNITY_SAAS_SERVER_HOST="agents.apm.myaccount.aternity.com"
$env:ATERNITY_CUSTOMER_ID="12341234-12341234-13241234"
# Start the containers
docker-compose up
docker compose up
```

### 3. Generate traffic and telemetry
Expand Down Expand Up @@ -116,7 +116,7 @@ On the application container side, the `OTEL_EXPORTER_OTLP_ENDPOINT` environment

environment:

OTEL_EXPORTER_OTLP_ENDPOINT: http://aternity-opentelemetry-collector:4318
OTEL_EXPORTER_OTLP_ENDPOINT: http://apm-collector:4317

OTEL_SERVICE_NAME: service103_python
```
Expand Down
28 changes: 15 additions & 13 deletions 103-opentelemetry-otlp-python-app/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
#
# Aternity Tech-Community
# 103-opentelemetry-otlp-python-app
# version: 22.7.30
# version: 23.10.18
#
# Usage
# docker-compose up
# docker compose up
#
# Example in Bash
# export ATERNITY_SAAS_SERVER_HOST="agents.apm.myaccount.aternity.com"
# export ATERNITY_CUSTOMER_ID="12341234-12341234-13241234"
# docker-compose up
# docker compose up
#
# Example in PowerShell
# $env:ATERNITY_SAAS_SERVER_HOST="agents.apm.myaccount.aternity.com"
# $env:ATERNITY_CUSTOMER_ID="12341234-12341234-13241234"
# docker-compose up
# docker compose up

version: "3.8"

Expand All @@ -26,9 +26,9 @@ services:
# Aternity OpenTelemetry Collector
# https://hub.docker.com/r/aternity/apm-collector

image: registry.hub.docker.com/aternity/apm-collector:2022.4.0-4
image: registry.hub.docker.com/aternity/apm-collector:2022.11.0-4

container_name: aternity-opentelemetry-collector
container_name: apm-collector

environment:

Expand All @@ -39,9 +39,9 @@ services:
# Uncomment the telemetry protocol used by the application

# OpenTelemetry, https://opentelemetry.io
- "4318:4318/tcp" # OpenTelemetry OTLP JSON/Protobuf over HTTP
- "4317:4317/tcp" # OpenTelemetry OTLP over gRPC
# - "4318:4318/tcp" # OpenTelemetry OTLP JSON/Protobuf over HTTP
# - "55681:55681/tcp" # OpenTelemetry OTLP JSON/Protobuf over HTTP
# - "4317:4317/tcp" # OpenTelemetry OTLP over gRPC

# Jaeger, https://www.jaegertracing.io
# - "14268:14268/tcp" # Jaeger Thrift Binary over HTTP
Expand All @@ -56,11 +56,13 @@ services:

environment:

OTEL_EXPORTER_OTLP_ENDPOINT: http://aternity-opentelemetry-collector:4318
OTEL_EXPORTER_OTLP_ENDPOINT: http://apm-collector:4317

OTEL_SERVICE_NAME: service103_python

PY_APP_URL: https://raw.githubusercontent.com/open-telemetry/opentelemetry-python/main/docs/examples/auto-instrumentation/server_automatic.py
# TODO: fix issue server_automatic.py and auto instrumentation not sending trace anymore, and remove the temporary app server_programmatic.py that is not auto instrumentation
# PY_APP_URL: https://raw.githubusercontent.com/open-telemetry/opentelemetry-python/main/docs/examples/auto-instrumentation/server_automatic.py
PY_APP_URL: https://raw.githubusercontent.com/open-telemetry/opentelemetry-python/main/docs/examples/auto-instrumentation/server_programmatic.py

ports:
- "8103:80"
Expand All @@ -77,10 +79,10 @@ services:
curl -s -o app.py $$PY_APP_URL ;
# Run with OpenTelemetry auto-instrumentation
opentelemetry-instrument --traces_exporter otlp_proto_http flask run --port=80 --host="0.0.0.0"
opentelemetry-instrument --traces_exporter otlp --metrics_exporter none flask run --port=80 --host="0.0.0.0"
# DEBUG: OpenTelemetry
# opentelemetry-instrument --traces_exporter otlp_proto_http,console flask run --port=80 --host="0.0.0.0"
# opentelemetry-instrument --traces_exporter console,otlp --metrics_exporter none flask run --port=80 --host="0.0.0.0"
"
service103_traffic_generator:
Expand All @@ -91,7 +93,7 @@ services:
/bin/sh -c "
sleep 30;
while :; do
curl http://service103_python:80/server_request > /dev/null 1>&1;
curl http://service103_python:80/server_request\?param=103 > /dev/null 1>&1;
sleep 5;
done
"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To use the following contents you will need active licenses of the ALLUVIO Atern
| --- | --- | --- | --- | --- |
| [001](https://github.com/Aternity/FlyFast/tree/2dfce9b6b3ce6823e1b3423048a5d3393a6e9386) | OpenTelemetry with FlyFast microservices on a Docker Host. Collect the traces with [Aternity OpenTelemetry Collector](https://hub.docker.com/r/aternity/apm-collector) | [ALLUVIO Aternity APM](https://www.riverbed.com/products/application-performance-monitoring) | OpenTelemetry, Javascript, React, Python, Tornado, Microservices, Docker | jan. 2023 |
| [102](102-opentelemetry-spring-demo-app) | Quickstart OpenTelemetry Distributed tracing / Java microservices demo app with [Aternity OpenTelemetry Collector](https://hub.docker.com/r/aternity/apm-collector) | [ALLUVIO Aternity APM](https://www.riverbed.com/products/application-performance-monitoring) | OpenTelemetry, ZipKin, Java, WebApp, Microservices, Docker | mar. 2022 |
| [103](103-opentelemetry-otlp-python-app) | A simple Python web app exporting OTLP telemetry to the [Aternity OpenTelemetry Collector](https://hub.docker.com/r/aternity/apm-collector) | [ALLUVIO Aternity APM](https://www.riverbed.com/products/application-performance-monitoring) | OpenTelemetry, OTLP, Python, WebApp, Microservices, Docker | july 2022 |
| [103](103-opentelemetry-otlp-python-app) | A simple Python web app exporting OTLP telemetry to the [Aternity OpenTelemetry Collector](https://hub.docker.com/r/aternity/apm-collector) | [ALLUVIO Aternity APM](https://www.riverbed.com/products/application-performance-monitoring) | OpenTelemetry, OTLP, Python, WebApp, Microservices, Docker | oct. 2023 |
| [104](104-opentelemetry-zipkin-nodejs-app) | A Nodejs web app exporting Zipkin telemetry to the [Aternity OpenTelemetry Collector](https://hub.docker.com/r/aternity/apm-collector) | [ALLUVIO Aternity APM](https://www.riverbed.com/products/application-performance-monitoring) | OpenTelemetry, Zipkin, Javascript, Nodejs, Docker | mar. 2022 |
| [105](105-opentelemetry-go-app) | A Go 2-tier web app exporting OpenTelemetry/Jaeger/Zipkin telemetry to the [Aternity OpenTelemetry Collector](https://hub.docker.com/r/aternity/apm-collector) | [ALLUVIO Aternity APM](https://www.riverbed.com/products/application-performance-monitoring) | OpenTelemetry, Jaeger, Zipkin, Go, Docker, Kubernetes | jun. 2022 |
| [106](106-opentelemetry-autoinstrumentation-java-app) | Running in docker, this simple Java app is launched with OpenTelemetry autoinstrumentation and uses multiple exporters in parallel. The [Aternity OpenTelemetry Collector](https://hub.docker.com/r/aternity/apm-collector) is collecting OTLP-gRPC telemetry. | [ALLUVIO Aternity APM](https://www.riverbed.com/products/application-performance-monitoring) | OpenTelemetry, automatic instrumentation, OTLP, Jaeger, Java, Docker | mar. 2022 |
Expand Down

0 comments on commit d3145ba

Please sign in to comment.