{"id":15809428,"url":"https://github.com/mevdschee/php-observability","last_synced_at":"2025-04-01T13:33:50.203Z","repository":{"id":257558798,"uuid":"858639539","full_name":"mevdschee/php-observability","owner":"mevdschee","description":"High frequency logging in PHP and aggregating into metrics using Go","archived":false,"fork":false,"pushed_at":"2024-11-17T14:36:46.000Z","size":57,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T00:27:13.725Z","etag":null,"topics":["logging","metrics","observability","php","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mevdschee.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-17T09:14:25.000Z","updated_at":"2024-11-17T14:36:09.000Z","dependencies_parsed_at":"2024-09-17T11:48:43.083Z","dependency_job_id":"ec6a1806-c0cc-4178-8197-3a6e815b0fba","html_url":"https://github.com/mevdschee/php-observability","commit_stats":{"total_commits":118,"total_committers":1,"mean_commits":118.0,"dds":0.0,"last_synced_commit":"8868e579f4d3aba499b4da39cfbf22caea86bf8a"},"previous_names":["mevdschee/php-observability"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mevdschee%2Fphp-observability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mevdschee%2Fphp-observability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mevdschee%2Fphp-observability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mevdschee%2Fphp-observability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mevdschee","download_url":"https://codeload.github.com/mevdschee/php-observability/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246604612,"owners_count":20804100,"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":["logging","metrics","observability","php","prometheus"],"created_at":"2024-10-05T03:22:56.649Z","updated_at":"2025-04-01T13:33:49.906Z","avatar_url":"https://github.com/mevdschee.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-observability\n\nA code base to showcase high frequency logging in PHP and aggregating into metrics using Go. Read the blog post:\n\n[https://tqdev.com/2024-high-frequency-metrics-in-php-using-tcp-sockets](https://tqdev.com/2024-high-frequency-metrics-in-php-using-tcp-sockets)\n\nand\n\n[https://tqdev.com/2024-distributed-metrics-in-php-using-go-and-gob](https://tqdev.com/2024-distributed-metrics-in-php-using-go-and-gob)\n\n### Requirements\n\n- PHP 8 or higher (see special PHP 5/7 compatible version)\n- Go 1.22 build environment\n\n### Usage\n\nTo run the server:\n\n    go run .\n\nIn bash run:\n\n    for run in {1..100}; do php writer.php \u0026 done\n\nAnd to stop:\n\n    killall php\n\nNow observe the metrics:\n\nhttp://localhost:8080/\n\nNB: The metrics are Prometheus compatible and follow the [OpenMetrics specification](https://github.com/OpenObservability/OpenMetrics/).\n\nThe metrics are also served in the Gob binary format on:\n\nhttp://localhost:9999/\n\nThis endpoint can be scraped by other tools such as [metrics-db-importer](https://github.com/mevdschee/metrics-db-importer) or this tool itself to aggregate the metrics of multiple nodes (using the \"-scrape\" parameter).\n\n### Example metrics\n\nHere is an example of published metrics:\n\n    # HELP database_calls_seconds A summary of the database calls.\n    # TYPE database_calls_seconds summary\n    database_calls_seconds_count{file=\"src/Controller/UserController.php@L123\"} 6630\n    database_calls_seconds_sum{file=\"src/Controller/UserController.php@L123\"} 947.142\n    # HELP database_calls_total_seconds A histogram of the database calls.\n    # TYPE database_calls_total_seconds histogram\n    database_calls_total_seconds_bucket{le=\"0.005\"} 0\n    database_calls_total_seconds_bucket{le=\"0.01\"} 0\n    database_calls_total_seconds_bucket{le=\"0.025\"} 0\n    database_calls_total_seconds_bucket{le=\"0.05\"} 0\n    database_calls_total_seconds_bucket{le=\"0.1\"} 0\n    database_calls_total_seconds_bucket{le=\"0.25\"} 6630\n    database_calls_total_seconds_bucket{le=\"0.5\"} 6630\n    database_calls_total_seconds_bucket{le=\"1\"} 6630\n    database_calls_total_seconds_bucket{le=\"2.5\"} 6630\n    database_calls_total_seconds_bucket{le=\"5\"} 6630\n    database_calls_total_seconds_bucket{le=\"10\"} 6630\n    database_calls_total_seconds_bucket{le=\"+Inf\"} 6630\n    database_calls_total_seconds_sum 947.142\n    database_calls_total_seconds_count 6630\n\nEnjoy!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmevdschee%2Fphp-observability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmevdschee%2Fphp-observability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmevdschee%2Fphp-observability/lists"}