YuanSheng Wang <[email protected]> 于2020年2月26日周三 下午1:52写道:

> > Could you explain why we need native nginx LUA? What is the difference?
>
> Unlike Java, Golang, and other languages, Lua is an embedded language.
>
> It will have completely different API functions depending on the host
> program.
>
> In addition, Lua, like Python, has several different versions, such as Lua
> 5.1, Lua 5.3, and LuaJIT.
> Due to LuaJIT's high performance and better compatibility with the standard
> Lua 5.1 and Lua 5.2,
> currently, OpenResty only supports LuaJIT.
>
> And I found out that we are using `lua-resty-http` to send HTTP requests,
> it is already bound to the local Nginx Lua.
>

For that part, yes, it is bound to Nginx/Resty. But that is also not the
tracing core. Tracing core ends when `local status, segment = ngx.ctx.
tracingContext:drainAfterFinished()`.
The user could use gRPC, HTTP or several months later,
SkyWalking-forwarder(write in rust maybe).
My test cases and pure LUA concept are mostly related to the core part.

To Ming
I think at the performance perspective, it is easy to balance, you could
inject timestamp/split funcions as an util to help. In default with `nil`,
use the LUA lib's version.

Sheng Wu 吴晟
Twitter, wusheng1108


>
> I prefer to use native Nginx LUA ^_^.
>
>
>
> On Wed, Feb 26, 2020 at 11:58 AM Ming Wen <[email protected]> wrote:
>
> > I  cerated a small PR[1] for that.
> > for example, the nginx lua has `split`, `timestamp` APIs which not need
> to
> > implement by lua again,
> > and with better performance.
> >
> > I know what you mean. This library can not only be used by nginx Lua, but
> > also be reused by programs written by pure Lua.
> >
> > I will try to compatible with nginx lua and standard Lua in the code.
> >
> > [1] https://github.com/apache/skywalking-nginx-lua/pull/3
> >
> > Thanks,
> > Ming Wen, Apache APISIX
> > Twitter: _WenMing
> >
> >
> > Sheng Wu <[email protected]> 于2020年2月26日周三 上午11:44写道:
> >
> > > Ming Wen <[email protected]> 于2020年2月26日周三 上午11:37写道:
> > >
> > > > hello, skywalking dev team,
> > > >
> > > > I am adding CI and test cases for nginx lua to this project[1]. I
> found
> > > > that most of the code was implemented using Lua code instead of the
> > > native
> > > > nginx lua API.
> > > >
> > > > I am trying to refactor in the way of nginx lua, and now there are
> two
> > > > issues that need to be discussed with you:
> > > >
> > > > 1. Does this project is only for the nginx lua environment? This is
> the
> > > > case from the naming of the project, and I want to confirm it again
> > > > here. Because
> > > > I can use native nginx lua APIs for many optimizations if only for
> > nginx
> > > > lua.
> > > >
> > >
> > > I wrote these codes in pure LUA intentionally as they actually don't
> > > require any Nignx dependency.
> > > Today, I haven't the case we need the pure LUA use case, but I am
> > > thinking it is also harmless and better for the further.
> > > You could see this kind of design nearly in Java, go and will be in the
> > > next Rust agents.
> > > Tracing code could be lightweight and widely used, integration is a
> > plugin
> > > system, such as targeting any Java lib/ecosystem or Nginx.
> > > Like in java agent, there are three parts, instrumentation core,
> tracing
> > > core and plugin system.
> > >
> > > The only links between tracing core and Nginx are tracer.lua and
> > > client.lua.
> > >
> > > Ming,
> > > Could you explain why we need native nginx LUA? What is the difference?
> > >
> > > Sheng Wu 吴晟
> > > Twitter, wusheng1108
> > >
> > >
> > >
> > > >
> > > > 2. After I performed the above step, the test cases of the original
> > > luaunit
> > > > method will not works well. Of course, I will add test cases for
> nginx
> > > lua
> > > > to complete coverage.
> > > >
> > > > What do you think?
> > > >
> > > > To Apache APISIX dev:
> > > > I will upload this project to the package manager `luarocks` later,
> and
> > > add
> > > > the Apache APISIX plug-in, which requires the help of the Apache
> APISIX
> > > > community.
> > > >
> > > > [1] https://github.com/apache/skywalking-nginx-lua
> > > > Thanks,
> > > > Ming Wen, Apache APISIX
> > > > Twitter: _WenMing
> > > >
> > >
> >
>
>
> --
>
> *MembPhis*
> My github: https://github.com/membphis
> Apache APISIX: https://github.com/apache/incubator-apisix
>

Reply via email to