compasshp / datadog-bundle
Automatically sends user information to Datadog APM/ASM.
Installs: 1 276
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.0
- symfony/config: ~5.3|^6.0
- symfony/dependency-injection: ~5.3|^6.0
- symfony/event-dispatcher: ~5.3|^6.0
- symfony/http-foundation: ~5.3|^6.0
- symfony/http-kernel: ~5.3|^6.0
- symfony/property-access: ~5.3|^6.0
- symfony/security-core: ~5.3|^6.0
- symfony/security-http: ~5.3|^6.0
- symfony/validator: ~5.3|^6.0
- symfony/yaml: ~5.3|^6.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/framework-bundle: ^5.4|^6.0
README
This bundle allows you to automatically track user information in DataDog's APM and ASM modules.
DataDog APM
For DataDog APM, it will automatically pass in the session ID, and -- if logged in -- the currently logged in username. You can additionally specify additional properties to pass to APM.
DataDog ASM
If enabled, for DataDog Application Security Monitoring, all success and failure login attempts will be passed to the datadog agent. You can additionally specify additional properties to pass to APM.
Installation
Prerequisites
The DataDog Agent needs to be configured in your application with tracing enabled.
If you are using Application Security Monitoring, the agent should be configured with the --enable-appsec
argument.
Get the bundle
Let Composer download and install the bundle by running
composer require compasshp/datadog-bundle
in a shell.
Enable the bundle
Register the bundle (you most likely don't want this bundle enable)
// in config/bundles.php return [ // ... Compass\DatadogBundle\CompassDatadogBundle::class => ['all' => true], ];
Configure
Create the configuration file:
# config/packages/compass_datadog.yaml # The DataDog agent is typically not available in your test environment. when@test: compass_datadog: tracing: enabled: false appsec: enabled: false compass_datadog: tracing: enabled: true user_entity: App\Entity\User user_properties: [ firstName, lastName, email ] # specify any additional properties you want traced. Username is always traced when someone is logged in. appsec: enabled: true # default is false
And that's it! Once configured, your application will automatically begin sending additional metadata to DataDog.