elastic / elastic-otel-php

Elastic distribution of OpenTelemetry for PHP
Apache License 2.0
1 stars 2 forks source link

Investigation/POC Kubernetes (K8s) Zero-code Instrumentation #97

Open SergeyKleyman opened 1 month ago

SergeyKleyman commented 1 month ago

Implementation progress

Done

Verify that approach based on setting environment variables and mounted volume indeed works

Use the approach described at https://github.com/open-telemetry/opentelemetry-php/issues/932#issuecomment-2356402000 based on PHP_INI_SCAN_DIR environment variable to inject EDOT for PHP

Test it on applications

Verify the POC on Elastic APM Attacher

It's simpler to verify that the approach based on setting environment variables and mounted volume indeed works in k8s setup using our Elastic APM k8s Attacher instead of OpenTelemtry K8x operator because Elastic APM k8s Attacher is much easier to setup and make temporary changes just for this POC.

By following instructions at https://www.elastic.co/guide/en/apm/attacher/current/apm-attacher.html

In progress

Extended implementation to OpenTelemetry Operator for Kubernetes

Follow steps at https://github.com/open-telemetry/opentelemetry-operator/blob/main/CONTRIBUTING.md#deployment-with-webhooks I am currently at the step "Using a private container registry" to deploy container with EDOT PHP files that updated OTel k8s operator can pull and inject into application container.

Extended implementation to vanilla OTel PHP distribution using auto_prepend_file similar to

WordPress instrumentation's approach

Contribute implementation upstream

Opened PR at https://github.com/open-telemetry/opentelemetry-operator/ https://github.com/open-telemetry/opentelemetry-operator/pull/3331

TODO

Publish docker image with EDOT that can be used with OTel K8s operator

Update Elastic docs

On how to monitor PHP applications using OpenTelemetry Operator for Kubernetes + PHP

Update instructions shipped with Kibana

On how to monitor PHP applications using OpenTelemetry Operator for Kubernetes + PHP