{"id":20347749,"url":"https://github.com/subzerobo/elastic-apm-php-agent","last_synced_at":"2025-04-12T01:02:59.791Z","repository":{"id":57061066,"uuid":"183405993","full_name":"subzerobo/elastic-apm-php-agent","owner":"subzerobo","description":"PHP Agent for Elastic APM With Intake API v2 Support + UDP Support + ProtoBuf","archived":false,"fork":false,"pushed_at":"2024-08-28T03:38:11.000Z","size":107,"stargazers_count":11,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T01:02:52.533Z","etag":null,"topics":["apm-agent","elastic-apm","php","php-library","protobuf","udp-client","udp-protocol"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subzerobo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-25T09:51:16.000Z","updated_at":"2024-08-28T03:33:24.000Z","dependencies_parsed_at":"2022-08-24T14:53:42.457Z","dependency_job_id":null,"html_url":"https://github.com/subzerobo/elastic-apm-php-agent","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subzerobo%2Felastic-apm-php-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subzerobo%2Felastic-apm-php-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subzerobo%2Felastic-apm-php-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subzerobo%2Felastic-apm-php-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subzerobo","download_url":"https://codeload.github.com/subzerobo/elastic-apm-php-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501869,"owners_count":21114683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apm-agent","elastic-apm","php","php-library","protobuf","udp-client","udp-protocol"],"created_at":"2024-11-14T22:17:55.488Z","updated_at":"2025-04-12T01:02:59.772Z","avatar_url":"https://github.com/subzerobo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elastic-apm-php-agent\n\nPHP Agent for Elastic APM With **Intake API v2 Support** + **UDP Support** + **ProtoBuf**\n\n# Examples \n\n## Using PSR7Middleware\nProject is using PSR7 Standard to wrap the whole app or any specific route you may need using PSR7Middleware Class\n\n```\n\u003c?php\n$app = new \\Slim\\App();\n$container = $app-\u003egetContainer();\n\n$settings = [\n    'defaultConnector'  =\u003e 'udp', // Send Data Using UDP or TCP \n    'appName'           =\u003e 'Sample APP',\n    'appVersion'        =\u003e '2.0.0',\n    'active'            =\u003e true \u0026\u0026 PHP_SAPI !== 'cli',\n    'serverUrl'         =\u003e 'http://your_elastic_apm_server_ip.com/intake/v2/events',\n    'secretToken'       =\u003e null,\n    'host'              =\u003e 'your_elastic_apm_server.com', // to disable dns resolve\n    'hostname'          =\u003e gethostname(),\n    'timeout'           =\u003e 5, // seconds\n    'apmVersion'        =\u003e 'v2', \n    'env'               =\u003e ['DOCUMENT_ROOT', 'REMOTE_ADDR'],\n    'cookies'           =\u003e [],\n    'httpClient'        =\u003e [],\n    'environment'       =\u003e 'development',\n    'backtraceLimit'    =\u003e 0,\n    'udpAgentIP'        =\u003e '144.22.22.22', // Go UDP Sidecar IP Address\n    'udpAgentPort'      =\u003e 1113, // GO UDP Sidecar Port\n    'udpUseProto'       =\u003e true,  // Use Protobuf Transport i GO UDP Sidecar\n    'isDockerContainer' =\u003e false,\n    'containerIdEnv'    =\u003e 'CONTAINER_ID',\n    'isKubernetes'      =\u003e false,\n    'kuberNamespaceEnv' =\u003e 'MY_POD_NAMESPACE',\n    'kuberPodNameEnv'   =\u003e 'MY_POD_NAME',\n    'kuberPodUidEnv'    =\u003e 'MY_POD_UID' ,\n    'kuberNodeNameEnv'  =\u003e 'MY_NODE_NAME' ,\n    'cleanup_rules' =\u003e [], // Cleanup naming\n];\n\n$apmAgent = new \\Subzerobo\\ElasticApmPhpAgent\\ApmAgent($settings);\n\n$mw = new \\Subzerobo\\ElasticApmPhpAgent\\Middlewares\\PSR7Middleware($container, $apmAgent)\n\n$app-\u003eadd($mw);\n\n```\n## Wrapping Redis/Mysql/other resources Weapper\n\n[ActionWrappers](https://github.com/subzerobo/elastic-apm-php-agent/tree/master/src/ActionWrappers)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubzerobo%2Felastic-apm-php-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubzerobo%2Felastic-apm-php-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubzerobo%2Felastic-apm-php-agent/lists"}