-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Help]: Configurations in Docker and kubernetes #2663
Comments
Environment variables for PHP are more difficult, because every SAPI tends to handle them differently. INI settings are generally much more consistent across SAPIs, so I recommend setting them that way. The
|
Thanks @morrisonlevi for quick response .
|
I tried following configs : Config 1 :
Config 2 with clear_env = no:
I am passing KUBERNETES_HOST_IP via helm chart.
ISSUE I faced: It does not set I then Injected DD_AGENT_HOST via helm chart like this and now datadog.agent_host has the correct IP even without making entry in www.conf file.
Seems like configurations I have set in
However when I created a phpinfo() via echo I will try few more configs and keep updated. |
I tried one more config but still phpinfo() does not use the values I passed. Kind of hitting end of road now.
|
Update : I tries below config
The start command in base docker image is Here are installation logs
When I start container in kubernetes and run commands like I know I am so close but no idea why it's now working . |
@morrisonlevi
Here are how I am passing env variable via helm chart. The environment names like DD_AGENT_HOST , DD_ENV etc must be exactly same.
I also found one issue with DD official documentation . For Apache + mod_php in VirtualHost or server configuration file the example shows Dollar sign like this which is wrong.
The correct configs for apache2.conf
This documentation should be corrected. I cannot send PR as this seems part of datadog cloud private docs. Today I will try one more configuration . I will share results and simplified configs in case it works with pure Apache PassEnv + Standard DD_ OS variables combo. |
Here is the most simple config that also worked.
|
If you want to use env vars, that's fine. I'm glad you figured out how to pipe them through! I'll pass along the documentation issue you mentioned. |
Help in configuration
I am adding dd-trace-php to an existing Docker Image that has drupal and Apache2 server baked in.
I have looked at the documentation but it has lead to more confusion hence asking here.
Here is my Dockerfile
Installation logs :
Question : How do I set the configurations dynamically via OS environment variables when this image will run? I could see multiple options that are confusing me.
Q1. Can I set following env variables while starting the Image ? DD_SERVICE,DD_VERSION,DD_AGENT_HOST ? Will php-tracer automatically read then on run time . I have used Java and Node tracer in past and they can do that. Need confirmation for php.
My docker image is reused across projects hence I donot want to bake hardcoded details via Dockerfile.
Q2. If this information cannot be read dynamically automatically in php then where should I write this ? I see many options that is confusing ?
Few recommendations are for .htaccess / server config files as well. Any help greatly appreciated.
PHP version
8.1.28
Tracer or profiler version
0.99.1
Installed extensions
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
ddappsec
ddtrace
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
openssl
pcntl
pcre
PDO
pdo_pgsql
pgsql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
ddappsec
ddtrace
Output of
phpinfo()
No response
Upgrading from
No response
The text was updated successfully, but these errors were encountered: