Hi everyone, I performed all the steps to instrument a php application into Splunk O11y Saas and there is not data(spans). Following the steps done below: 1. Installed the linux packages. luiz...
See more...
Hi everyone, I performed all the steps to instrument a php application into Splunk O11y Saas and there is not data(spans). Following the steps done below: 1. Installed the linux packages. luizpolli@PCWIN11-LPOLLI:~$ dpkg -l|egrep make
ii automake 1:1.16.5-1.3 all Tool for generating GNU Standards-compliant Makefiles
ii make 4.3-4.1build1 amd64 utility for directing compilation
ii xxd 2:8.2.3995-1ubuntu2.21 amd64 tool to make (or reverse) a hex dump
luizpolli@PCWIN11-LPOLLI:~$ dpkg -l|egrep autoconf
ii autoconf 2.71-2 all automatic configure script builder
luizpolli@PCWIN11-LPOLLI:~$ dpkg -l|grep gcc
ii gcc 4:11.2.0-1ubuntu1 amd64 GNU C compiler
ii gcc-11 11.4.0-1ubuntu1~22.04 amd64 GNU C compiler
ii gcc-11-base:amd64 11.4.0-1ubuntu1~22.04 amd64 GCC, the GNU Compiler Collection (base package)
ii gcc-12-base:amd64 12.3.0-1ubuntu1~22.04 amd64 GCC, the GNU Compiler Collection (base package)
ii libgcc-11-dev:amd64 11.4.0-1ubuntu1~22.04 amd64 GCC support library (development files)
ii libgcc-s1:amd64 12.3.0-1ubuntu1~22.04 amd64 GCC support library
luizpolli@PCWIN11-LPOLLI:~$ 2. Installed php extension using pecl and added the opentelemetry.so inside php.ini file. 3. Installed some extensions using composer. php composer.phar install open-telemetry/exporter-otlp:^1.0.3
php composer.phar install php-http/guzzle7-adapter:^1.0 luizpolli@PCWIN11-LPOLLI:~$ composer show
brick/math 0.12.1 Arbitrary-precision arithmetic library
composer/semver 3.4.3 Semver library that offers utilities, version constraint parsing and validation.
google/protobuf 4.29.1 proto library for PHP
guzzlehttp/guzzle 7.9.2 Guzzle is a PHP HTTP client library
guzzlehttp/promises 2.0.4 Guzzle promises library
guzzlehttp/psr7 2.7.0 PSR-7 message implementation that also provides common utility methods
nyholm/psr7 1.8.2 A fast PHP7 implementation of PSR-7
nyholm/psr7-server 1.1.0 Helper classes to handle PSR-7 server requests
open-telemetry/api 1.1.1 API for OpenTelemetry PHP.
open-telemetry/context 1.1.0 Context implementation for OpenTelemetry PHP.
open-telemetry/exporter-otlp 1.1.0 OTLP exporter for OpenTelemetry.
open-telemetry/gen-otlp-protobuf 1.2.1 PHP protobuf files for communication with OpenTelemetry OTLP collectors/servers.
open-telemetry/sdk 1.1.2 SDK for OpenTelemetry PHP.
open-telemetry/sem-conv 1.27.1 Semantic conventions for OpenTelemetry PHP.
php-http/discovery 1.20.0 Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations
php-http/guzzle7-adapter 1.1.0 Guzzle 7 HTTP Adapter
php-http/httplug 2.4.1 HTTPlug, the HTTP client abstraction for PHP
php-http/promise 1.3.1 Promise used for asynchronous HTTP requests
psr/container 2.0.2 Common Container Interface (PHP FIG PSR-11)
psr/http-client 1.0.3 Common interface for HTTP clients
psr/http-factory 1.1.0 PSR-17: Common interfaces for PSR-7 HTTP message factories
psr/http-message 2.0 Common interface for HTTP messages
psr/log 3.0.2 Common interface for logging libraries
ralouphie/getallheaders 3.0.3 A polyfill for getallheaders.
ramsey/collection 2.0.0 A PHP library for representing and manipulating collections.
ramsey/uuid 4.7.6 A PHP library for generating and working with universally unique identifiers (UUIDs).
symfony/deprecation-contracts 3.5.1 A generic function and convention to trigger deprecation notices
symfony/http-client 6.4.16 Provides powerful methods to fetch HTTP resources synchronously or asynchronously
symfony/http-client-contracts 3.5.1 Generic abstractions related to HTTP clients
symfony/polyfill-mbstring 1.31.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php82 1.31.0 Symfony polyfill backporting some PHP 8.2+ features to lower PHP versions
symfony/service-contracts 3.5.1 Generic abstractions related to writing services
tbachert/spi 1.0.2 Service provider loading facility
luizpolli@PCWIN11-LPOLLI:~$ 4. Set linux env variables and php.ini. luizpolli@PCWIN11-LPOLLI:~$ env|grep OTEL
OTEL_EXPORTER_OTLP_TRACES_HEADERS=x-sf-token=uv8z-g77txiCZigBV1OZVg
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=prod,service.version=1.0
OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.eu1.signalfx.com/trace/otlp
OTEL_SERVICE_NAME=shopping
OTEL_PHP_AUTOLOAD_ENABLED=true
luizpolli@PCWIN11-LPOLLI:~$ cat /etc/php/8.1/apache2/php.ini |grep OTEL
OTEL_RESOURCE_ATTRIBUTES="deployment.environment=prod,service.version=1.0"
OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
OTEL_SERVICE_NAME=shopping
OTEL_PHP_AUTOLOAD_ENABLED=true
luizpolli@PCWIN11-LPOLLI:~$ 5. Restarted the application. luizpolli@PCWIN11-LPOLLI:~$ sudo systemctl restart apache2
[sudo] password for luizpolli:
luizpolli@PCWIN11-LPOLLI:~$ sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2024-12-10 17:32:43 CET; 3s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 53957 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 53961 (apache2)
Tasks: 6 (limit: 18994)
Memory: 13.8M
CGroup: /system.slice/apache2.service
├─53961 /usr/sbin/apache2 -k start
├─53962 /usr/sbin/apache2 -k start
├─53963 /usr/sbin/apache2 -k start
├─53964 /usr/sbin/apache2 -k start
├─53965 /usr/sbin/apache2 -k start
└─53966 /usr/sbin/apache2 -k start
Dec 10 17:32:43 PCWIN11-LPOLLI systemd[1]: Starting The Apache HTTP Server...
Dec 10 17:32:43 PCWIN11-LPOLLI systemd[1]: Started The Apache HTTP Server.
luizpolli@PCWIN11-LPOLLI:~$ 6. Checking Splunk O11y SaaS apm page we cannot spans. Any ideas on what is wrong or missing?