{"id":20515219,"url":"https://github.com/openclarity/wasm-filters","last_synced_at":"2025-04-14T00:16:48.336Z","repository":{"id":40547661,"uuid":"402415857","full_name":"openclarity/wasm-filters","owner":"openclarity","description":"Envoy Wasm filter for traffic tracing used in APIClarity.","archived":false,"fork":false,"pushed_at":"2024-06-19T14:48:58.000Z","size":984,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-14T00:16:37.060Z","etag":null,"topics":["envoy","go","golang","istio","proxy","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openclarity.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":"2021-09-02T12:41:21.000Z","updated_at":"2024-08-25T20:57:32.000Z","dependencies_parsed_at":"2024-06-21T15:34:33.362Z","dependency_job_id":"f4b9a2df-18aa-4318-afdd-fd598becfcb5","html_url":"https://github.com/openclarity/wasm-filters","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclarity%2Fwasm-filters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclarity%2Fwasm-filters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclarity%2Fwasm-filters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openclarity%2Fwasm-filters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openclarity","download_url":"https://codeload.github.com/openclarity/wasm-filters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799950,"owners_count":21163404,"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":["envoy","go","golang","istio","proxy","wasm","webassembly"],"created_at":"2024-11-15T21:20:16.541Z","updated_at":"2025-04-14T00:16:48.307Z","avatar_url":"https://github.com/openclarity.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trace Exporter\n## _APIClarity Envoy wasm filter_\n\nEnvoy wasm filter that can export http traffic from envoy proxy to any desired backend for analysis.\n\nThe exports are a POST request to /publish path, in the format:\n```sh\ntype (\n\tSCNTelemetry struct {\n\t\tRequestID          string       `json:\"request_id\"`\n\t\tScheme             string       `json:\"scheme\"`\n\t\tDestinationAddress string       `json:\"destination_address\"`\n                SourceAddress      string       'json:\"source_address\"'\n\t\tSCNTRequest        SCNTRequest  `json:\"scnt_request\"`\n\t\tSCNTResponse       SCNTResponse `json:\"scnt_response\"`\n\t}\n\n\tSCNTRequest struct {\n\t\tMethod string `json:\"method\"`\n\t\tPath   string `json:\"path\"`\n\t\tHost   string `json:\"host\"`\n\t\tSCNTCommon\n\t}\n\n\tSCNTResponse struct {\n\t\tStatusCode string `json:\"status_code\"`\n\t\tSCNTCommon\n\t}\n\tSCNTCommon struct {\n\t\tVersion       string      `json:\"version\"`\n\t\tHeaders       [][2]string `json:\"headers\"`\n\t\tBody          []byte      `json:\"body\"`\n\t\tTruncatedBody bool        `json:\"truncated_body\"`\n\t}\n)\n```\n## Configure\n\nIn order to set the backend address (where the traces will be sent to) you need to define the following environment variables:\n```sh\n    WASM_FILTER_TRACE_BACKEND_ADDRESS\n    WASM_FILTER_TRACE_BACKEND_PORT\n\n```\n\n### Deploy the filter\n\n```sh\n./deploy.sh \u003clist of namespaces seperated by space\u003e\n```\n\nThis will deploy the filter to all the deployments in the provided namespaces.\n\nThis will also create a configmap containing the wasm filter in each namespace, called wasm-filter.  \nIf you would like to change the name of the configmap, you can set the environment variable WASM_FILTER_CONFIG_MAP_NAME\n\nYou might need to restart your pods in order for the filter to be deployed.  \nAfter that you are good to go! \n\n## Build and deploy your own filter\n\nYou can build the filter using docker\n\n```sh\nmake docker_build\n```\n\nIf you want to build the filter without using docker you need to have tinygo installed\n\nOn Mac:  \n```sh\nbrew tap tinygo-org/tools  \nbrew install tinygo\n```\nThen you can run \n```sh\nmake build\n```\n\nThe wasm filter binary will be in `bin/http-trace-filter.wasm`\n\nSet the binary path via environment variable\n\n```sh\nexport WASM_FILTER_BINARY_PATH=bin/http-trace-filter.wasm\n```\n\nThen you can run the deploy script.\n\n##\nCurrent proxy-wasm-go-sdk version used is v0.13.0 Which supports istio 1.9.x, 1.10.x \n\nproxy-wasm-go-sdk depends on TinyGo's WASI (WebAssembly System Interface) target which is introduced in v0.16.0.\n\nSee https://github.com/tetratelabs/proxy-wasm-go-sdk for more details\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclarity%2Fwasm-filters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenclarity%2Fwasm-filters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenclarity%2Fwasm-filters/lists"}