Skip to content

Commit 59c6018

Browse files
committed
Migrate to libbuildpack-dynatrace (#1205)
Replace custom Dynatrace extension with official libbuildpack-dynatrace library, following the same pattern as go-buildpack. Changes: - Add libbuildpack-dynatrace v1.8.0 dependency - Implement Dynatrace hook in src/php/hooks/dynatrace.go - Add hooks_debug.go for debugging support (BP_DEBUG) - Remove custom dynatrace extension implementation - Remove dynatrace extension registration from supply/finalize - Update README to reflect new integration approach The new implementation uses the standard libbuildpack hook system during AfterCompile phase, ensuring Dynatrace software support and compatibility with other Cloud Foundry buildpacks. Fixes #1205
1 parent 0028465 commit 59c6018

18 files changed

Lines changed: 1073 additions & 859 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ The project is broken down into the following directories:
9090
- `supply/` - Dependency installation (PHP, HTTPD, Nginx)
9191
- `finalize/` - Final configuration and setup
9292
- `release/` - Release information
93-
- `extensions/` - Extension system (composer, newrelic, dynatrace, appdynamics, sessions)
93+
- `extensions/` - Extension system (composer, newrelic, appdynamics, sessions)
9494
- `config/` - Configuration management
9595
- `options/` - Options parsing
96-
- `hooks/` - Lifecycle hooks
96+
- `hooks/` - Lifecycle hooks (dynatrace integration)
9797
- `integration/` - Integration tests
9898
- `unit/` - Unit tests
9999
- `defaults/` - Default configuration files
@@ -145,7 +145,7 @@ The buildpack includes several built-in extensions written in Go:
145145

146146
- **[composer](src/php/extensions/composer/)** - [Downloads, installs and runs Composer](http://docs.cloudfoundry.org/buildpacks/php/gsg-php-composer.html). Automatically detects PHP version requirements from `composer.json` and validates against locked dependencies.
147147
- **[newrelic](src/php/extensions/newrelic/)** - [Downloads, installs and configures the NewRelic agent for PHP](http://docs.cloudfoundry.org/buildpacks/php/gsg-php-newrelic.html)
148-
- **[dynatrace](src/php/extensions/dynatrace/)** - Downloads and configures Dynatrace OneAgent. Looks for a bound service with name `dynatrace` and credentials containing `apiurl`, `environmentid`, and `apitoken`.
148+
- **[dynatrace](src/php/hooks/dynatrace.go)** - Downloads and configures Dynatrace OneAgent using the official [libbuildpack-dynatrace](https://github.com/Dynatrace/libbuildpack-dynatrace) library. Looks for a bound service with name `dynatrace` and credentials containing `apiurl`, `environmentid`, and `apitoken`.
149149
- **[appdynamics](src/php/extensions/appdynamics/)** - Downloads and configures AppDynamics agent
150150
- **[sessions](src/php/extensions/sessions/)** - [Configures PHP to store session information in a bound Redis or Memcached service instance](http://docs.cloudfoundry.org/buildpacks/php/gsg-php-sessions.html)
151151

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/cloudfoundry/php-buildpack
33
go 1.24.0
44

55
require (
6+
github.com/Dynatrace/libbuildpack-dynatrace v1.8.0
67
github.com/cloudfoundry/libbuildpack v0.0.0-20251203175254-7be530ec9fef
78
github.com/cloudfoundry/switchblade v0.9.4
89
github.com/onsi/ginkgo/v2 v2.27.2

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym
622622
github.com/CycloneDX/cyclonedx-go v0.7.1/go.mod h1:N/nrdWQI2SIjaACyyDs/u7+ddCkyl/zkNs8xFsHF2Ps=
623623
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
624624
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
625+
github.com/Dynatrace/libbuildpack-dynatrace v1.8.0 h1:VNcd8+rurUUdY12emGfLGUUj5cMH4hkNgrdk8LO3dHE=
626+
github.com/Dynatrace/libbuildpack-dynatrace v1.8.0/go.mod h1:Uu9aa5UFAk1Ua+zZXnvzo+avDXuEi+GtegeOyja9xg4=
625627
github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible/go.mod h1:BB1eHdMLYEFuFdBlRMb0N7YGVdM5s6Pt0njxgvfbGGs=
626628
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
627629
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=

0 commit comments

Comments
 (0)