{"id":13741038,"url":"https://github.com/kauche/proxy-wasm-cloud-logging-trace-context","last_synced_at":"2026-01-17T08:59:00.209Z","repository":{"id":57876702,"uuid":"525662739","full_name":"kauche/proxy-wasm-cloud-logging-trace-context","owner":"kauche","description":"A proxy-wasm compilant WebAssembly module for making proxies integrate with Google Cloud Logging.","archived":false,"fork":false,"pushed_at":"2022-08-25T07:56:31.000Z","size":10,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-15T11:36:16.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Zig","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/kauche.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-17T06:12:05.000Z","updated_at":"2024-04-20T08:07:29.000Z","dependencies_parsed_at":"2022-08-27T10:52:29.264Z","dependency_job_id":null,"html_url":"https://github.com/kauche/proxy-wasm-cloud-logging-trace-context","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauche%2Fproxy-wasm-cloud-logging-trace-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauche%2Fproxy-wasm-cloud-logging-trace-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauche%2Fproxy-wasm-cloud-logging-trace-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kauche%2Fproxy-wasm-cloud-logging-trace-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kauche","download_url":"https://codeload.github.com/kauche/proxy-wasm-cloud-logging-trace-context/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253153163,"owners_count":21862318,"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":[],"created_at":"2024-08-03T04:00:54.786Z","updated_at":"2026-01-17T08:59:00.156Z","avatar_url":"https://github.com/kauche.png","language":"Zig","funding_links":[],"categories":["Applications"],"sub_categories":[],"readme":"# proxy-wasm-cloud-logging-trace-context\n\nA [proxy-wasm](https://github.com/proxy-wasm/spec) compliant WebAssembly module for making proxies integrate with [Google Cloud Logging](https://cloud.google.com/logging/).\n\n## Overview\n\nIn order to generate logs associated with [Google Cloud Trace](https://cloud.google.com/trace) for [Google Cloud Logging](https://cloud.google.com/logging/), we need to add a [`logging.googleapis.com/trace` field](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.trace) to the log entries.\n\nThis [proxy-wasm](https://github.com/proxy-wasm/spec) compliant WebAssembly module helps proxies generate logs integrated with Cloud Logging and Cloud Trace by extracting the trace id from the `X-Cloud-Trace-Context` HTTP Header and populating `X-Cloud-Logging-Trace-Context` by using the extracted trace id. The populated `X-Cloud-Logging-Trace-Context` HTTP Header is formatted as `projects/\u003cYour Google Cloud Project ID\u003e/traces/\u003cTrace ID\u003e` and can be used to add a `logging.googleapis.com/trace` filed to logs.\n\n## Usage\n\n1. Download the latest WebAssembly module from the [release page](https://github.com/kauche/proxy-wasm-cloud-logging-trace-context/releases).\n\n2. Configure the proxy to use the WebAssembly module and generate logs like below (this assumes [Envoy](https://www.envoyproxy.io/) as the proxy):\n\n```yaml\naccess_log:\n  name: log\n  typed_config:\n    '@type': type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog\n    log_format:\n      json_format:\n        status: '%RESPONSE_CODE%'\n        message: access log\n        severity: INFO\n        component: envoy\n        logging.googleapis.com/trace: '%REQ(x-cloud-logging-trace-context)%'\nhttp_filters:\n  - name: envoy.filters.http.wasm\n    typed_config:\n      '@type': type.googleapis.com/udpa.type.v1.TypedStruct\n      type_url: type.googleapis.com/envoy.extensions.filters.http.wasm.v3.Wasm\n      value:\n        config:\n          vm_config:\n            runtime: envoy.wasm.runtime.v8\n            code:\n              local:\n                filename: /etc/envoy/proxy-wasm-cloud-logging-trace-context.wasm\n          configuration:\n            \"@type\": type.googleapis.com/google.protobuf.StringValue\n            value: |\n              {\n                \"project_id\": \"my-projectid\"\n              }\n  - name: envoy.filters.http.router\n    typed_config:\n      '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkauche%2Fproxy-wasm-cloud-logging-trace-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkauche%2Fproxy-wasm-cloud-logging-trace-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkauche%2Fproxy-wasm-cloud-logging-trace-context/lists"}