Skip to content

Commit f0d7ddc

Browse files
committed
Rename DDTRACE_EXT_VERSION to DDTRACE_EXT_PHP_API and update the default value to 20210902
1 parent db0aaf1 commit f0d7ddc

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@ heroku buildpacks:add --app <your-app-name> https://github.com/SpeedCurve-Metric
1616

1717
## Configuration
1818

19-
This buildpack accepts several config vars:
19+
This buildpack accepts several config vars. All of them are optional:
2020

21-
- `DDTRACE_EXT_VERSION` - The extension version that PHP is compiled with. Defaults to `20180731`.
22-
- `DDTRACE_EXT_RELEASE` - The release name of [dd-trace-php](https://github.com/DataDog/dd-trace-php/releases/) to download. Defaults to `0.54.0`.
21+
- `DDTRACE_EXT_PHP_API` - The PHP API version that your application uses. Defaults to `20210902`. Use `phpinfo()` to find the API version if you're not sure.
22+
- `DDTRACE_EXT_RELEASE` - The release name of [dd-trace-php](https://github.com/DataDog/dd-trace-php/releases/) to download. Defaults to `0.82.0`.
2323
- `DDTRACE_EXT_PKG_URL` - The URL to a dd-trace-php `.deb` file. This option overides `DDTRACE_EXT_RELEASE`.
2424

25-
### More information: `DDTRACE_EXT_VERSION`
25+
### More information: `DDTRACE_EXT_PHP_API`
2626

27-
PHP on Heroku is compiled with a specific version of the ddtrace extension. By default, this buildpack enables version `20190902` of the extension. If PHP was compiled with a different version, you will see warnings like this in your application logs:
27+
This buildpack does not determine that PHP API version automatically. The default value should work for most PHP versions, but if the version is wrong then you will see warnings like this in your application logs:
2828

2929
```
3030
PHP Warning: PHP Startup: ddtrace: Unable to initialize module
31-
Module compiled with module API=20180731
32-
PHP compiled with module API=20190902
31+
Module compiled with module API=20210902
32+
PHP compiled with module API=20220829
3333
These options need to match
3434
```
3535

36-
You can change the extension version that is enabled by this buildpack by setting the `DDTRACE_EXT_VERSION` config var in Heroku. For example:
36+
You can change the version by setting the `DDTRACE_EXT_VERSION` config var in Heroku. For example:
3737

3838
```
39-
heroku config:set --app <your-app-name> DDTRACE_EXT_VERSION=20190902
39+
heroku config:set --app <your-app-name> DDTRACE_EXT_VERSION=20220829
4040
```

bin/compile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ else
4747
if [[ -n ${DDTRACE_EXT_RELEASE:-} ]]; then
4848
echo "Using dd-trace-php release '$DDTRACE_EXT_RELEASE' (from "'$DDTRACE_EXT_RELEASE env var).' | indent
4949
else
50-
export DDTRACE_EXT_RELEASE="0.54.0"
50+
export DDTRACE_EXT_RELEASE="0.82.0"
5151
echo "Using dd-trace-php release '$DDTRACE_EXT_RELEASE' (default value)." | indent
5252
fi
5353
export DDTRACE_EXT_PKG_URL="https://github.com/DataDog/dd-trace-php/releases/download/"$DDTRACE_EXT_RELEASE"/datadog-php-tracer_"$DDTRACE_EXT_RELEASE"_amd64.deb"
@@ -69,18 +69,16 @@ dpkg -x $PACKAGE_FILE $BUILD_DIR/.apt/
6969

7070
topic "Enabling ddtrace PHP extension"
7171

72-
if [[ -n ${DDTRACE_EXT_VERSION:-} ]]; then
73-
echo "Using version '$DDTRACE_EXT_VERSION' (from "'$DDTRACE_EXT_VERSION env var).' | indent
72+
if [[ -n ${DDTRACE_EXT_PHP_API:-} ]]; then
73+
echo "Using version '$DDTRACE_EXT_PHP_API' (from "'$DDTRACE_EXT_PHP_API env var).' | indent
7474
else
75-
export DDTRACE_EXT_VERSION="20190902"
76-
echo "Using version '$DDTRACE_EXT_VERSION' (default value)." | indent
75+
export DDTRACE_EXT_PHP_API="20210902"
76+
echo "Using version '$DDTRACE_EXT_PHP_API' (default value)." | indent
7777
fi
7878

7979
touch /app/.heroku/php/etc/php/conf.d/datadog-php-custom.ini
8080
echo "[PHP]" >> /app/.heroku/php/etc/php/conf.d/datadog-php-custom.ini
81-
echo "extension=/app/.apt/opt/datadog-php/extensions/ddtrace-$DDTRACE_EXT_VERSION.so" >> /app/.heroku/php/etc/php/conf.d/datadog-php-custom.ini
81+
echo "extension=/app/.apt/opt/datadog-php/extensions/ddtrace-$DDTRACE_EXT_PHP_API.so" >> /app/.heroku/php/etc/php/conf.d/datadog-php-custom.ini
8282
echo "ddtrace.request_init_hook=/app/.apt/opt/datadog-php/dd-trace-sources/bridge/dd_wrap_autoloader.php" >> /app/.heroku/php/etc/php/conf.d/datadog-php-custom.ini
8383

8484
echo "Done" | indent
85-
86-

0 commit comments

Comments
 (0)