Skip to content

Commit

Permalink
chore: bump otel api to 1.27.0 and instrumentation to 0.48 (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
wrn14897 authored Oct 31, 2024
1 parent 8a85093 commit e14db62
Show file tree
Hide file tree
Showing 15 changed files with 485 additions and 551 deletions.
2 changes: 1 addition & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ In the smoke-tests directory there exists a `docker-compose.yml` to run in Docke
Because each example uses the same port, either comment out the other apps in the docker-compose file, or specify the app to run:

```bash
cd smoke-tests && docker-compose up --build app-sdk-grpc
cd smoke-tests && docker compose up --build app-sdk-grpc
```

## Testing
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ smoke:
@echo ""
@echo "+++ Temporary Placeholder."
@echo ""
cd smoke-tests && docker-compose up --build app-sdk-grpc
cd smoke-tests && docker compose up --build app-sdk-grpc

#: placeholder for smoke tests, tear down the app
unsmoke:
@echo ""
@echo "+++ Spinning down the smokers."
@echo ""
cd smoke-tests && docker-compose down --volumes
cd smoke-tests && docker compose down --volumes

EXAMPLE_SERVICE_NAME ?= otel-python-example
run_example: export OTEL_SERVICE_NAME := $(EXAMPLE_SERVICE_NAME)
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ We have the HONEYCOMB_API_ENDPOINT set to an OpenTelemetry Collector. This can b
Because each example uses the same port, either comment out the other apps in the docker-compose file, or specify the app and protocol to run:

```bash
cd smoke-tests && docker-compose up --build app-sdk-grpc
cd smoke-tests && docker compose up --build app-sdk-grpc
```
4 changes: 2 additions & 2 deletions examples/hello-world-django/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ readme = "README.md"
python = "^3.11"
django = "^5.0.1"
hyperdx-opentelemetry = {path = "../../", develop = true}
opentelemetry-api = "1.22.0"
opentelemetry-instrumentation = "0.43b0"
opentelemetry-api = "1.27.0"
opentelemetry-instrumentation = "0.48b0"

[build-system]
requires = ["poetry-core"]
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-world-flask/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# to be run with docker-compose in smoke-tests directory
# to be run with docker compose in smoke-tests directory
FROM python:3.10-slim

WORKDIR /app
Expand Down
4 changes: 2 additions & 2 deletions examples/hello-world-flask/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ python = "^3.10"
flask = "2.2.5"
Werkzeug = "2.2.2"
hyperdx-opentelemetry = {path = "../../", develop = true}
opentelemetry-api = "1.22.0"
opentelemetry-instrumentation-flask = "0.43b0"
opentelemetry-api = "1.27.0"
opentelemetry-instrumentation-flask = "0.48b0"

[build-system]
requires = ["poetry-core"]
Expand Down
4 changes: 2 additions & 2 deletions examples/hello-world/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# to be run with docker-compose in smoke-tests directory
# to be run with docker compose in smoke-tests directory
FROM python:3.10-slim

WORKDIR /app
Expand All @@ -25,4 +25,4 @@ RUN cd ./examples/hello-world && poetry install

# From this point forward, we're operating on the example app.
WORKDIR /app/examples/hello-world
CMD ["python", "app.py"]
CMD ["python", "app.py"]
2 changes: 1 addition & 1 deletion examples/hello-world/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
hyperdx-opentelemetry = {path = "../../", develop = true}
opentelemetry-api = "1.22.0"
opentelemetry-api = "1.27.0"

[build-system]
requires = ["poetry-core"]
Expand Down
954 changes: 444 additions & 510 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[tool.poetry]
name = "hyperdx-opentelemetry"
version = "0.1.0"
version = "0.2.0"
description = "HyperDX OpenTelemetry Distro for Python"
authors = ["HyperDX <[email protected]>"]
readme = "README.md"
packages = [{include = "hyperdx", from = "src" }]

[tool.poetry.dependencies]
python = "^3.7, >= 3.7.2"
opentelemetry-api = "1.22.0"
opentelemetry-sdk = "1.22.0"
opentelemetry-exporter-otlp = "1.22.0"
opentelemetry-instrumentation = "0.43b0"
python = ">= 3.8"
opentelemetry-api = "1.27.0"
opentelemetry-sdk = "1.27.0"
opentelemetry-exporter-otlp = "1.27.0"
opentelemetry-instrumentation = "0.48b0"

[tool.poetry.group.dev.dependencies]
coverage = ">=6.5,<8.0"
Expand Down
10 changes: 5 additions & 5 deletions smoke-tests/smoke-sdk-grpc-flask.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TRACER_NAME="hello_world_flask_tracer"
METER_NAME="hello_world_flask_meter"

setup_file() {
docker-compose up --build --detach collector ${CONTAINER_NAME}
docker compose up --build --detach collector ${CONTAINER_NAME}
wait_for_ready_app ${CONTAINER_NAME}
curl --silent localhost:5000
wait_for_traces
Expand All @@ -18,16 +18,16 @@ setup_file() {

teardown_file() {
cp collector/data.json collector/data-results/data-${CONTAINER_NAME}.json
docker-compose stop ${CONTAINER_NAME}
docker-compose restart collector
docker compose stop ${CONTAINER_NAME}
docker compose restart collector
wait_for_flush
}

# TESTS

@test "Auto instrumentation produces a flask span" {
result=$(span_names_for "opentelemetry.instrumentation.flask")
assert_equal "$result" '"/"'
assert_equal "$result" '"GET /"'
}

@test "Manual instrumentation produces parent and child spans with names of spans" {
Expand All @@ -49,4 +49,4 @@ teardown_file() {
@test "Manual instrumentation produces metrics" {
result=$(metric_names_for ${METER_NAME})
assert_equal "$result" '"bee_counter"'
}
}
10 changes: 5 additions & 5 deletions smoke-tests/smoke-sdk-grpc.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ METER_NAME="hello_world_meter"

setup_file() {
echo "# 🚧" >&3
docker-compose up --build --detach collector
docker compose up --build --detach collector
wait_for_ready_collector ${COLLECTOR_NAME}
docker-compose up --build --detach ${CONTAINER_NAME}
docker compose up --build --detach ${CONTAINER_NAME}
wait_for_traces
wait_for_metrics
}

teardown_file() {
cp collector/data.json collector/data-results/data-${CONTAINER_NAME}.json
docker-compose stop ${CONTAINER_NAME}
docker-compose restart collector
docker compose stop ${CONTAINER_NAME}
docker compose restart collector
wait_for_flush
}

Expand All @@ -45,4 +45,4 @@ teardown_file() {
@test "Manual instrumentation produces metrics" {
result=$(metric_names_for ${METER_NAME})
assert_equal "$result" '"sheep"'
}
}
10 changes: 5 additions & 5 deletions smoke-tests/smoke-sdk-http-flask.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TRACER_NAME="hello_world_flask_tracer"
METER_NAME="hello_world_flask_meter"

setup_file() {
docker-compose up --build --detach collector ${CONTAINER_NAME}
docker compose up --build --detach collector ${CONTAINER_NAME}
wait_for_ready_app ${CONTAINER_NAME}
curl --silent localhost:5000
wait_for_traces
Expand All @@ -18,16 +18,16 @@ setup_file() {

teardown_file() {
cp collector/data.json collector/data-results/data-${CONTAINER_NAME}.json
docker-compose stop ${CONTAINER_NAME}
docker-compose restart collector
docker compose stop ${CONTAINER_NAME}
docker compose restart collector
wait_for_flush
}

# TESTS

@test "Auto instrumentation produces a flask span" {
result=$(span_names_for "opentelemetry.instrumentation.flask")
assert_equal "$result" '"/"'
assert_equal "$result" '"GET /"'
}

@test "Manual instrumentation produces parent and child spans with names of spans" {
Expand All @@ -49,4 +49,4 @@ teardown_file() {
@test "Manual instrumentation produces metrics" {
result=$(metric_names_for ${METER_NAME})
assert_equal "$result" '"bee_counter"'
}
}
10 changes: 5 additions & 5 deletions smoke-tests/smoke-sdk-http.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ METER_NAME="hello_world_meter"

setup_file() {
echo "# 🚧" >&3
docker-compose up --build --detach collector
docker compose up --build --detach collector
wait_for_ready_collector ${COLLECTOR_NAME}
docker-compose up --build --detach ${CONTAINER_NAME}
docker compose up --build --detach ${CONTAINER_NAME}
wait_for_traces
wait_for_metrics
}

teardown_file() {
cp collector/data.json collector/data-results/data-${CONTAINER_NAME}.json
docker-compose stop ${CONTAINER_NAME}
docker-compose restart collector
docker compose stop ${CONTAINER_NAME}
docker compose restart collector
wait_for_flush
}

Expand All @@ -45,4 +45,4 @@ teardown_file() {
@test "Manual instrumentation produces metrics" {
result=$(metric_names_for ${METER_NAME})
assert_equal "$result" '"sheep"'
}
}
6 changes: 3 additions & 3 deletions smoke-tests/test_helpers/utilities.bash
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ wait_for_ready_collector() {
MAX_RETRIES=10
echo -n "# 🍿 Setting up ${COLLECTOR}" >&3
NEXT_WAIT_TIME=0
until [ $NEXT_WAIT_TIME -eq $MAX_RETRIES ] || [[ $(docker-compose logs ${COLLECTOR} | grep "Everything is ready. Begin running and processing data.") ]]
until [ $NEXT_WAIT_TIME -eq $MAX_RETRIES ] || [[ $(docker compose logs ${COLLECTOR} | grep "Everything is ready. Begin running and processing data.") ]]
do
echo -n " ... $(( NEXT_WAIT_TIME++ ))s" >&3
sleep $NEXT_WAIT_TIME
Expand All @@ -118,7 +118,7 @@ wait_for_ready_app() {
MAX_RETRIES=10
echo -n "# 🍿 Setting up ${CONTAINER}" >&3
NEXT_WAIT_TIME=0
until [ $NEXT_WAIT_TIME -eq $MAX_RETRIES ] || [[ $(docker-compose logs ${CONTAINER} | grep "Running on http:") ]]
until [ $NEXT_WAIT_TIME -eq $MAX_RETRIES ] || [[ $(docker compose logs ${CONTAINER} | grep "Running on http:") ]]
do
echo -n " ... $(( NEXT_WAIT_TIME++ ))s" >&3
sleep $NEXT_WAIT_TIME
Expand All @@ -143,4 +143,4 @@ assert_equal() {
} >&2 # output error to STDERR
return 1
fi
}
}

0 comments on commit e14db62

Please sign in to comment.