Skip to content

tyler36/ddev-site-metrics-cakephp

Repository files navigation

add-on registry tests last commit release

DDEV Site Metrics CakePHP

Overview

This add-on adds Open Telemetry for CakePHP projects. It is designed to integrate with tyler36/ddev-site-metrics. This is achieved by:

  • installing opentelemetry PHP addon.
  • configures system-level environmental variables

Installation

ddev add-on get tyler36/ddev-site-metrics-cakephp
ddev restart

After installation, make sure to commit the .ddev directory to version control.

Usage

Traces are automatically injected into PHP calls. This is configured via .ddev/.env.web.

OTEL_PHP_AUTOLOAD_ENABLED="true"
OTEL_SERVICE_NAME="cakephp"
OTEL_METRIC_EXPORTER="none"
OTEL_LOGS_EXPORTER="console"
OTEL_TRACES_EXPORTER="console"
  • To disable all telemetry, update .ddev/.env.web and restart DDEV.
OTEL_PHP_AUTOLOAD_ENABLED="false"
  • To send traces to ddev-site-metrics, update .ddev/.env.web and restart DDEV.
OTEL_TRACES_EXPORTER="otlp"
OTEL_EXPORTER_OTLP_ENDPOINT=http://grafana-alloy:4317

Configuration

Environmental Variables

Environmental variables need to be set early in the process. This addon uses .ddev/.env.web to set them for the container. Additionally, we set them in the web container to prevent leakage into other containers.

Debugging

  • Confirm PHP module is installed.
$ ddev php --ri opentelemetry
...
opentelemetry hooks => enabled

Credits

Contributed and maintained by @tyler36

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages