Skip to content

Instantly share code, notes, and snippets.

View xeioex's full-sized avatar

Dmitry Volyntsev xeioex

View GitHub Profile
commit d5fae2e1ccc37de58573e4961958e82cf8d6d6b2
Author: Dmitry Volyntsev <[email protected]>
Date: Fri Jan 30 17:43:17 2026 -0800
Attaching JS stack trace for exceptions thrown by C code.
This fixes #1019 issue on Github.
diff --git a/nginx/t/js_fetch_error_stack.t b/nginx/t/js_fetch_error_stack.t
new file mode 100644

SharedArrayBuffer Implementation Plan for nginx njs

Overview

Implementation of js_shared_array directive for nginx njs modules (HTTP and Stream) that creates shared memory zones accessible as SharedArrayBuffer objects via ngx.sharedArray.foo dynamic property lookup.

Scope: QuickJS engine only (wrapped in #if (NJS_HAVE_QUICKJS))

Architecture

diff --git a/auto/cc b/auto/cc
index 5b21e17e..d2ce8f89 100644
--- a/auto/cc
+++ b/auto/cc
@@ -169,6 +169,20 @@ case $NJS_CC_NAME in
esac
+njs_feature="-Wl,-E"
+njs_feature_name=
diff --git a/examples/async_request.rs b/examples/async_request.rs
index a616b7d3..507268a3 100644
--- a/examples/async_request.rs
+++ b/examples/async_request.rs
@@ -63,20 +63,12 @@ impl AsyncHandler for SampleAsyncHandler {
let request_ptr: *mut ngx_http_request_t = request.as_mut();
let fut = AsyncSubRequestBuilder::new("/proxy")
- //.args("arg1=val1&arg2=val2")
+ .args("arg1=val1&arg2=val2")
receivers:
otlp:
protocols:
grpc:
http:
connectors:
spanmetrics:
dimensions:
- name: mcp.name
load_module /home/xeioex/workspace/nginx/nginx/objs/ngx_otel_module.so;
error_log /dev/stdout info;
daemon off;
master_process off;
events {
}
http {
js_import main from mcp.js;
load_module /home/xeioex/workspace/nginx/nginx/objs/ngx_otel_module.so;
error_log /dev/stdout info;
daemon off;
master_process off;
events {
}
http {
js_engine qjs;
@xeioex
xeioex / out
Created January 15, 2026 02:39
# HELP traces_span_metrics_calls_total
# TYPE traces_span_metrics_calls_total counter
traces_span_metrics_calls_total{job="unknown_service:nginx",mcp_name="calculate_sum",mcp_status="error",otel_scope_name="spanmetricsconnector",otel_scope_schema_url="",otel_scope_version="",service_name="unknown_service:nginx",span_kind="SPAN_KIND_SERVER",span_name="/",status_code="STATUS_CODE_UNSET"} 0
traces_span_metrics_calls_total{job="unknown_service:nginx",mcp_name="calculate_sum",mcp_status="ok",otel_scope_name="spanmetricsconnector",otel_scope_schema_url="",otel_scope_version="",service_name="unknown_service:nginx",span_kind="SPAN_KIND_SERVER",span_name="/",status_code="STATUS_CODE_UNSET"} 0
traces_span_metrics_calls_total{job="unknown_service:nginx",mcp_name="get_forecast",mcp_status="error",otel_scope_name="spanmetricsconnector",otel_scope_schema_url="",otel_scope_version="",service_name="unknown_service:nginx",span_kind="SPAN_KIND_SERVER",span_name="/",status_code="STATUS_CODE_UNSET"} 0
traces_span_metrics_calls_
package main
import (
"crypto/rand"
"encoding/base64"
"encoding/json"
"flag"
"fmt"
"io"
"log"
package main
import (
"crypto/rand"
"encoding/base64"
"encoding/json"
"flag"
"fmt"
"io"
"log"