Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: proxy_get_metric #152

Open
Sn0rt opened this issue Aug 16, 2023 · 0 comments
Open

bugfix: proxy_get_metric #152

Sn0rt opened this issue Aug 16, 2023 · 0 comments

Comments

@Sn0rt
Copy link
Contributor

Sn0rt commented Aug 16, 2023

error log

2023/08/15 23:29:17 [error] 10266#10266: failed to new instance: incompatible import type for `env::proxy_get_metric`

Caused by:
    function types incompatible: expected func of type `(i32, i32) -> (i32)`, found func of type `(i32, i64) -> (i32)`
2023/08/15 23:29:17 [error] 10266#10266: *1 lua entry thread aborted: runtime error: content_by_lua(nginx.conf:96):3: failed to load wasm plugin
stack traceback:
coroutine 0:
	[C]: in function 'assert'
	content_by_lua(nginx.conf:96):3: in main chunk, client: 127.0.0.1, server: localhost, request: "GET /t HTTP/1.1", host: "localhost"

the CI should pass

diff --git a/t/testdata/metric/main.go b/t/testdata/metric/main.go
index 9424169..55b6575 100644
--- a/t/testdata/metric/main.go
+++ b/t/testdata/metric/main.go
@@ -60,6 +60,7 @@ func (ctx *httpContext) OnHttpRequestHeaders(numHeaders int, endOfStream bool) t

        ctx.metrics.incrementCounter("test")
        ctx.metrics.recordMetricHistogram("test")
+       ctx.metrics.getMetric("test")

        return types.ActionContinue
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant