Skip to content

Commit fb18a17

Browse files
authored
Merge branch 'main' into doctrine
2 parents ff6dd7f + 65de07e commit fb18a17

File tree

211 files changed

+9849
-553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+9849
-553
lines changed

.github/workflows/fossa.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: FOSSA scanning
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
fossa:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
17+
- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
18+
with:
19+
api-key: ${{secrets.FOSSA_API_KEY}}
20+
team: OpenTelemetry

.gitsplit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ splits:
1414
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/contrib-sdk-bundle.git"
1515
- prefix: "src/Instrumentation/CodeIgniter"
1616
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/contrib-auto-codeigniter.git"
17+
- prefix: "src/Instrumentation/Curl"
18+
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/contrib-auto-curl.git"
1719
- prefix: "src/Instrumentation/ExtAmqp"
1820
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/contrib-auto-ext-amqp.git"
1921
- prefix: "src/Instrumentation/ExtRdKafka"
@@ -28,6 +30,8 @@ splits:
2830
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/contrib-auto-laravel.git"
2931
- prefix: "src/Instrumentation/MongoDB"
3032
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/contrib-auto-mongodb.git"
33+
- prefix: "src/Instrumentation/MySqli"
34+
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/contrib-auto-mysqli.git"
3135
- prefix: "src/Instrumentation/OpenAIPHP"
3236
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/contrib-auto-openai.git"
3337
- prefix: "src/Instrumentation/PDO"

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ build: ## Build image
1919
install: ## Install dependencies
2020
$(DC_RUN_PHP) env XDEBUG_MODE=off composer install
2121
update: ## Update dependencies
22-
$(DC_RUN_PHP) env XDEBUG_MODE=off composer update
22+
$(DC_RUN_PHP) env XDEBUG_MODE=off composer update --no-plugins
2323
update-lowest: ## Update dependencies to lowest supported versions
24-
$(DC_RUN_PHP) env XDEBUG_MODE=off composer update --prefer-lowest
24+
$(DC_RUN_PHP) env XDEBUG_MODE=off composer update --no-plugins --prefer-lowest
2525
test: ## Run all tests
2626
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/phpunit --testdox --colors=always
2727
test-unit: ## Run unit tests
@@ -39,13 +39,13 @@ psalm-info: ## Run psalm with info
3939
phpstan: ## Run phpstan
4040
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/phpstan analyse --memory-limit=256M
4141
validate: ## Validate composer file
42-
$(DC_RUN_PHP) env XDEBUG_MODE=off composer validate
42+
$(DC_RUN_PHP) env XDEBUG_MODE=off composer validate --no-plugins
4343
packages-composer: ## Validate all composer packages
4444
$(DC_RUN) php env XDEBUG_MODE=off vendor/bin/otel packages:composer:validate
4545
bash: ## Bash shell
4646
$(DC_RUN_PHP) bash
4747
style: ## Run php-cs-fixer
48-
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --using-cache=no -vvv
48+
$(DC_RUN_PHP) env XDEBUG_MODE=off PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --using-cache=no -vvv
4949
split: ## git-split dry run
5050
${DOCKER_COMPOSE} -f docker/gitsplit/docker-compose.yaml --env-file ./.env up
5151
FORCE:

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"minimum-stability": "dev",
77
"prefer-stable": true,
88
"require": {
9-
"php": "^7.4 || ^8.0",
9+
"php": "^8.1",
1010
"ext-json": "*"
1111
},
1212
"require-dev": {
@@ -17,12 +17,14 @@
1717
"psr-4": {
1818
"OpenTelemetry\\Contrib\\Aws\\": "src/Aws/src",
1919
"OpenTelemetry\\Contrib\\Context\\Swoole\\": "src/Context/Swoole/src",
20+
"OpenTelemetry\\Contrib\\Instrumentation\\Curl\\": "src/Instrumentation/Curl/src",
2021
"OpenTelemetry\\Contrib\\Instrumentation\\ExtAmqp\\": "src/Instrumentation/ExtAmqp/src",
2122
"OpenTelemetry\\Contrib\\Instrumentation\\ExtRdKafka\\": "src/Instrumentation/ExtRdKafka/src",
2223
"OpenTelemetry\\Contrib\\Instrumentation\\Laravel\\": "src/Instrumentation/Laravel/src",
2324
"OpenTelemetry\\Contrib\\Instrumentation\\HttpAsyncClient\\": "src/Instrumentation/HttpAsyncClient/src",
2425
"OpenTelemetry\\Contrib\\Instrumentation\\IO\\": "src/Instrumentation/IO/src",
2526
"OpenTelemetry\\Contrib\\Instrumentation\\MongoDB\\": "src/Instrumentation/MongoDB/src",
27+
"OpenTelemetry\\Contrib\\Instrumentation\\MySqli\\": "src/Instrumentation/MySqli/src",
2628
"OpenTelemetry\\Contrib\\Instrumentation\\PDO\\": "src/Instrumentation/PDO/src",
2729
"OpenTelemetry\\Contrib\\Instrumentation\\Psr3\\": "src/Instrumentation/Psr3/src",
2830
"OpenTelemetry\\Contrib\\Instrumentation\\Psr15\\": "src/Instrumentation/Psr15/src",
@@ -39,12 +41,14 @@
3941
"OpenTelemetry\\Contrib\\Symfony\\": "src/Symfony/src"
4042
},
4143
"files": [
44+
"src/Instrumentation/Curl/_register.php",
4245
"src/Instrumentation/ExtAmqp/_register.php",
4346
"src/Instrumentation/ExtRdKafka/_register.php",
4447
"src/Instrumentation/HttpAsyncClient/_register.php",
4548
"src/Instrumentation/IO/_register.php",
4649
"src/Instrumentation/Laravel/_register.php",
4750
"src/Instrumentation/MongoDB/_register.php",
51+
"src/Instrumentation/MySqli/_register.php",
4852
"src/Instrumentation/PDO/_register.php",
4953
"src/Instrumentation/Psr3/_register.php",
5054
"src/Instrumentation/Psr15/_register.php",
@@ -59,10 +63,12 @@
5963
"open-telemetry/contrib-aws": "self.version",
6064
"open-telemetry/contrib-sdk-bundle": "self.version",
6165
"open-telemetry/context-swoole": "self.version",
66+
"open-telemetry/opentelemetry-auto-curl": "self.version",
6267
"open-telemetry/opentelemetry-auto-laravel": "self.version",
6368
"open-telemetry/opentelemetry-auto-http-async": "self.version",
6469
"open-telemetry/opentelemetry-auto-io": "self.version",
6570
"open-telemetry/opentelemetry-auto-mongodb": "self.version",
71+
"open-telemetry/opentelemetry-auto-mysqli": "self.version",
6672
"open-telemetry/opentelemetry-auto-pdo": "self.version",
6773
"open-telemetry/opentelemetry-auto-psr3": "self.version",
6874
"open-telemetry/opentelemetry-auto-psr15": "self.version",

docker-compose.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ services:
1414
PHP_IDE_CONFIG: ${PHP_IDE_CONFIG:-''}
1515
RABBIT_HOST: ${RABBIT_HOST:-rabbitmq}
1616
KAFKA_HOST: ${KAFKA_HOST:-kafka}
17+
MONGODB_HOST: ${MONGODB_HOST:-mongodb}
18+
MONGODB_PORT: ${MONGODB_PORT:-27017}
19+
MYSQL_HOST: ${MYSQL_HOST:-mysql}
1720

1821
zipkin:
1922
image: openzipkin/zipkin-slim
@@ -61,4 +64,26 @@ services:
6164
volumes:
6265
- ./docker/kafka/update_run.sh:/tmp/update_run.sh
6366

67+
mongodb:
68+
image: mongo:4
69+
hostname: mongodb
70+
ports:
71+
- "27017:27017/tcp"
6472

73+
mysql:
74+
image: mysql:8.0
75+
hostname: mysql
76+
ports:
77+
- "3306:3306/tcp"
78+
environment:
79+
MYSQL_ROOT_PASSWORD: root_password
80+
MYSQL_DATABASE: otel_db
81+
MYSQL_USER: otel_user
82+
MYSQL_PASSWORD: otel_passwd
83+
healthcheck:
84+
test: mysql -uotel_user -potel_passwd -e "USE otel_db;"
85+
interval: 30s
86+
timeout: 30s
87+
retries: 3
88+
volumes:
89+
- ./docker/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql

docker/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PHP_VERSION=8.0
1+
ARG PHP_VERSION=8.1
22
FROM ghcr.io/open-telemetry/opentelemetry-php/opentelemetry-php-base:${PHP_VERSION}
33

44
USER root
@@ -7,6 +7,7 @@ RUN install-php-extensions \
77
opentelemetry \
88
mongodb \
99
amqp \
10-
rdkafka
10+
rdkafka \
11+
mysqli
1112

1213
USER php

docker/mysql/init.sql

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
CREATE DATABASE IF NOT EXISTS otel_db2;
2+
CREATE USER 'otel_user2'@'%' IDENTIFIED BY 'otel_passwd';
3+
4+
5+
GRANT ALL PRIVILEGES ON *.* TO 'otel_user'@'%';
6+
GRANT ALL PRIVILEGES ON *.* TO 'otel_user2'@'%';
7+
FLUSH PRIVILEGES;
8+
9+
10+
USE otel_db;
11+
12+
CREATE TABLE users (
13+
id INT AUTO_INCREMENT PRIMARY KEY,
14+
name VARCHAR(255) NOT NULL,
15+
email VARCHAR(255) UNIQUE NOT NULL,
16+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
17+
);
18+
19+
INSERT INTO users (name, email) VALUES
20+
('John Doe', '[email protected]'),
21+
('Jane Smith', '[email protected]'),
22+
('Bob Johnson', '[email protected]');
23+
24+
CREATE TABLE products (
25+
id INT AUTO_INCREMENT PRIMARY KEY,
26+
name VARCHAR(255) NOT NULL,
27+
price DECIMAL(10, 2) NOT NULL,
28+
stock INT NOT NULL DEFAULT 0
29+
);
30+
31+
INSERT INTO products (name, price, stock) VALUES
32+
('Laptop', 999.99, 10),
33+
('Smartphone', 499.99, 25),
34+
('Headphones', 49.99, 50);

examples/instrumentation/Wordpress/autoinstrumented-wordpress.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM composer:2.5 as build
33
COPY composer.json ./
44
RUN composer install --ignore-platform-reqs
55

6-
FROM wordpress:6.2
6+
FROM wordpress:6.7.1
77
# Install the opentelemetry and protobuf extensions
88
RUN pecl install opentelemetry protobuf
99
COPY otel.php.ini $PHP_INI_DIR/conf.d/.

examples/instrumentation/Wordpress/compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ services:
4242
# OpenTelemetry collector. Make sure you set USERID and GOOGLE_APPLICATION_CREDENTIALS
4343
# environment variables for your container to authenticate correctly
4444
otel-collector:
45-
image: otel/opentelemetry-collector-contrib:0.79.0
45+
image: otel/opentelemetry-collector-contrib:0.91.0
4646
volumes:
4747
- ./otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
48-
48+
4949
jaeger:
50-
image: jaegertracing/all-in-one:1.46
50+
image: jaegertracing/all-in-one
5151
ports:
5252
- 16686:16686
5353
environment:
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"name": "opentelemetry/wordpress-example",
3-
"description": "An example of autoinstrumentation of wordpress with the official wordpress docker image",
4-
"type": "project",
5-
"minimum-stability": "beta",
6-
"require": {
7-
"open-telemetry/opentelemetry-auto-wordpress": "^0.0.15",
8-
"open-telemetry/sdk": "^1.0",
9-
"open-telemetry/exporter-otlp": "^1.0",
10-
"php-http/guzzle7-adapter": "^1.0"
11-
},
12-
"config": {
13-
"allow-plugins": {
14-
"php-http/discovery": true
15-
}
16-
}
17-
}
2+
"name": "opentelemetry/wordpress-example",
3+
"description": "An example of autoinstrumentation of wordpress with the official wordpress docker image",
4+
"type": "project",
5+
"minimum-stability": "beta",
6+
"require": {
7+
"open-telemetry/opentelemetry-auto-wordpress": "^0.0.16",
8+
"open-telemetry/sdk": "^1.1",
9+
"open-telemetry/exporter-otlp": "^1.1",
10+
"php-http/guzzle7-adapter": "^1.1"
11+
},
12+
"config": {
13+
"allow-plugins": {
14+
"php-http/discovery": true
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)