From f11f37500c303df3e7c8e664d982b31a7e5c9453 Mon Sep 17 00:00:00 2001 From: An Tran Date: Thu, 16 Jan 2025 13:34:48 +1000 Subject: [PATCH 1/4] Remove opentracing from APIcast --- Brewfile | 2 -- Dockerfile | 2 +- Dockerfile.devel | 6 +--- Makefile | 3 -- doc/parameters.md | 31 ------------------- docker-compose.yml | 22 ------------- examples/configuration/standalone.yml | 1 - gateway/conf.d/opentracing/jaeger.conf.liquid | 12 ------- .../conf.d/opentracing/jaeger.example.json | 25 --------------- gateway/conf/nginx.conf.liquid | 11 +------ gateway/http.d/apicast.conf.liquid | 21 ------------- gateway/src/apicast/cli/environment.lua | 16 ---------- script/install/openresty.sh | 6 +--- 13 files changed, 4 insertions(+), 154 deletions(-) delete mode 100644 gateway/conf.d/opentracing/jaeger.conf.liquid delete mode 100644 gateway/conf.d/opentracing/jaeger.example.json diff --git a/Brewfile b/Brewfile index ade6c85c4..1e4c8e41b 100644 --- a/Brewfile +++ b/Brewfile @@ -1,5 +1,3 @@ tap "3scale/openresty" -tap "3scale/opentracing" -brew "3scale/opentracing/openresty", args: ["with-debug"], link: true brew "3scale/openresty/luarocks", link: true diff --git a/Dockerfile b/Dockerfile index 9719cb222..1537c7c5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN dnf install -y 'dnf-command(config-manager)' RUN yum config-manager --add-repo http://packages.dev.3sca.net/dev_packages_3sca_net.repo -RUN PKGS="openresty-resty-${OPENRESTY_RPM_VERSION} openresty-opentelemetry-${OPENRESTY_RPM_VERSION} openresty-opentracing-${OPENRESTY_RPM_VERSION} openresty-${OPENRESTY_RPM_VERSION} luarocks-${LUAROCKS_VERSION} opentracing-cpp-devel-1.3.0 libopentracing-cpp1-1.3.0 jaegertracing-cpp-client-${JAEGERTRACING_CPP_CLIENT_RPM_VERSION}" && \ +RUN PKGS="openresty-resty-${OPENRESTY_RPM_VERSION} openresty-opentelemetry-${OPENRESTY_RPM_VERSION} openresty-${OPENRESTY_RPM_VERSION} luarocks-${LUAROCKS_VERSION}" && \ mkdir -p "$HOME" && \ yum -y --setopt=tsflags=nodocs install $PKGS && \ rpm -V $PKGS && \ diff --git a/Dockerfile.devel b/Dockerfile.devel index 198197afa..08ed8fb8f 100644 --- a/Dockerfile.devel +++ b/Dockerfile.devel @@ -31,11 +31,7 @@ RUN yum config-manager --add-repo http://packages.dev.3sca.net/dev_packages_3sca RUN yum install -y \ openresty-${OPENRESTY_RPM_VERSION} \ openresty-resty-${OPENRESTY_RPM_VERSION} \ - openresty-opentelemetry-${OPENRESTY_RPM_VERSION} \ - openresty-opentracing-${OPENRESTY_RPM_VERSION} \ - opentracing-cpp-devel-1.3.0 \ - libopentracing-cpp1-1.3.0 \ - jaegertracing-cpp-client-${JAEGERTRACING_CPP_CLIENT_RPM_VERSION} + openresty-opentelemetry-${OPENRESTY_RPM_VERSION} RUN ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log \ && ln -sf /dev/stderr /usr/local/openresty/nginx/logs/error.log \ diff --git a/Makefile b/Makefile index 7e0625d71..b77767fe0 100644 --- a/Makefile +++ b/Makefile @@ -165,9 +165,6 @@ gateway-logs: export IMAGE_NAME = does-not-matter gateway-logs: $(DOCKER) compose logs gateway -opentracing-gateway: ## run gateway instrumented with opentracing - $(DOCKER) compose run opentracing-instrumented-gateway - test-runtime-image: export IMAGE_NAME ?= $(RUNTIME_IMAGE) test-runtime-image: clean-containers ## Smoke test the runtime image. Pass any docker image in IMAGE_NAME parameter. $(DOCKER) compose --version diff --git a/doc/parameters.md b/doc/parameters.md index ab1e0f4fe..1a7e82314 100644 --- a/doc/parameters.md +++ b/doc/parameters.md @@ -345,37 +345,6 @@ When `THREESCALE_PORTAL_ENDPOINT` environment variable is provided, the gateway It is **required** to provide either `THREESCALE_PORTAL_ENDPOINT` or `THREESCALE_CONFIG_FILE` (takes precedence) for the gateway to run successfully. - -### `OPENTRACING_TRACER` - -**Deprecated:** Check out [OPENTELEMETRY](#opentelemetry) configuration instead. -**Example:** `jaeger` - -This environment variable controls which tracing library will be loaded, right now, there's only one opentracing tracer available, `jaeger`. - -If empty, opentracing support will be disabled. - - -### `OPENTRACING_CONFIG` - -**Deprecated:** Check out [OPENTELEMETRY](#opentelemetry) configuration instead. - -This environment variable is used to determine the config file for the opentracing tracer, if `OPENTRACING_TRACER` is not set, this variable will be ignored. - -Each tracer has a default configuration file: - * `jaeger`: `conf.d/opentracing/jaeger.example.json` - -You can choose to mount a different configuration than the provided by default by setting the file path using this variable. - -**Example:** `/tmp/jaeger/jaeger.json` - -### `OPENTRACING_FORWARD_HEADER` - -**Deprecated:** Check out [OPENTELEMETRY](#opentelemetry) configuration instead. -**Default:** `uber-trace-id` - -This environment variable controls the HTTP header used for forwarding opentracing information, this HTTP header will be forwarded to upstream servers. - ### `APICAST_HTTPS_PORT` **Default:** no value diff --git a/docker-compose.yml b/docker-compose.yml index 53b55a537..4a553c412 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,25 +54,3 @@ services: KEYCLOAK_LOGLEVEL: INFO ports: - "8080" - opentracing-instrumented-gateway: - image: ${IMAGE_NAME:-apicast-test} - depends_on: - - jaeger - environment: - THREESCALE_CONFIG_FILE: /tmp/config.json - THREESCALE_DEPLOYMENT_ENV: staging - APICAST_CONFIGURATION_LOADER: lazy - APICAST_LOG_LEVEL: debug - APICAST_CONFIGURATION_CACHE: "0" - OPENTRACING_TRACER: jaeger - OPENTRACING_CONFIG: /opt/app-root/src/tracing-configs/tracing-config-jaeger-jaeger-config.json - volumes: - - ./examples/opentracing/apicast-config.json:/tmp/config.json - - ./examples/opentracing/jaeger-config.json:/opt/app-root/src/tracing-configs/tracing-config-jaeger-jaeger-config.json - jaeger: - image: quay.io/ducna/jaegertracing/all-in-one:1.60 - environment: - JAEGER_DISABLED: "false" - COLLECTOR_OTLP_ENABLED: "true" - ports: - - 16686:16686 diff --git a/examples/configuration/standalone.yml b/examples/configuration/standalone.yml index 5961a20c4..4dc284245 100644 --- a/examples/configuration/standalone.yml +++ b/examples/configuration/standalone.yml @@ -2,7 +2,6 @@ global: log_level: debug error_log: stderr access_log: stdout - opentracing_tracer: jaeger upstream: load_balancer: least_conn retry: 5xx diff --git a/gateway/conf.d/opentracing/jaeger.conf.liquid b/gateway/conf.d/opentracing/jaeger.conf.liquid deleted file mode 100644 index 351e0d404..000000000 --- a/gateway/conf.d/opentracing/jaeger.conf.liquid +++ /dev/null @@ -1,12 +0,0 @@ -opentracing on; - -{% if opentracing_config == nil or opentracing_config == empty %} - {% assign opentracing_config = "conf.d/opentracing/jaeger.example.json" | filesystem | first%} -{% endif %} - -{% if platform == "OSX" %} - opentracing_load_tracer libjaegertracing.dylib {{ opentracing_config }}; -{% else %} - opentracing_load_tracer libjaegertracing.so {{ opentracing_config }}; -{% endif %} - diff --git a/gateway/conf.d/opentracing/jaeger.example.json b/gateway/conf.d/opentracing/jaeger.example.json deleted file mode 100644 index 3b4efc724..000000000 --- a/gateway/conf.d/opentracing/jaeger.example.json +++ /dev/null @@ -1,25 +0,0 @@ - { - "service_name": "apicast", - "disabled": false, - "sampler": { - "type": "const", - "param": 1 - }, - "reporter": { - "queueSize": 100, - "bufferFlushInterval": 10, - "logSpans": false, - "localAgentHostPort": "127.0.0.1:6831" - }, - "headers": { - "jaegerDebugHeader": "debug-id", - "jaegerBaggageHeader": "baggage", - "TraceContextHeaderName": "uber-trace-id", - "traceBaggageHeaderPrefix": "testctx-" - }, - "baggage_restrictions": { - "denyBaggageOnInitializationFailure": false, - "hostPort": "127.0.0.1:5778", - "refreshInterval": 60 - } - } diff --git a/gateway/conf/nginx.conf.liquid b/gateway/conf/nginx.conf.liquid index 87fda8569..2ad5bcf9a 100644 --- a/gateway/conf/nginx.conf.liquid +++ b/gateway/conf/nginx.conf.liquid @@ -5,11 +5,7 @@ env RESOLVER; env BACKEND_ENDPOINT_OVERRIDE; env OPENSSL_VERIFY; -{% if opentracing_tracer != empty %} - {% for file in "modules/ngx_http_opentracing_module.so" | filesystem %} -load_module {{file}}; - {% endfor %} -{% elsif opentelemetry != empty %} +{% if opentelemetry != empty %} {% for file in "modules/otel_ngx_module.so" | filesystem %} load_module {{file}}; {% endfor %} @@ -80,11 +76,6 @@ http { ## end {{ file }} {% endfor %} - {% if opentracing_tracer != empty %} - {%- capture tracer_conf %}conf.d/opentracing/{{ opentracing_tracer }}.conf.liquid{%- endcapture -%} - {% include tracer_conf %} - {% endif %} - {% if opentelemetry != empty %} {%- capture otel_conf %}conf.d/opentelemetry/otel.conf.liquid{%- endcapture -%} {% include otel_conf %} diff --git a/gateway/http.d/apicast.conf.liquid b/gateway/http.d/apicast.conf.liquid index 3a76f9c09..e22832821 100644 --- a/gateway/http.d/apicast.conf.liquid +++ b/gateway/http.d/apicast.conf.liquid @@ -28,11 +28,6 @@ server { listen {{ port.management | default: 8090 }}; server_name {{ server_name.management | default: 'management _' }}; - {% if opentracing_tracer != empty %} - opentracing_operation_name "apicast_management"; - opentracing_trace_locations off; - {% endif %} - {% if opentelemetry != empty %} opentelemetry_operation_name apicast_management; {% endif %} @@ -44,11 +39,6 @@ server { listen {{ port.backend | default: 8081 }}; server_name backend; - {% if opentracing_tracer != empty %} - opentracing_operation_name "apicast_mockbackend"; - opentracing_trace_locations off; - {% endif %} - {% if opentelemetry != empty %} opentelemetry_operation_name apicast_mockbackend; {% endif %} @@ -65,11 +55,6 @@ server { listen {{ port.echo | default: 8081 }} default_server; server_name echo _; - {% if opentracing_tracer != empty %} - opentracing_operation_name "apicast_echo"; - opentracing_trace_locations off; - {% endif %} - {% if opentelemetry != empty %} opentelemetry_operation_name apicast_echo; {% endif %} @@ -121,12 +106,6 @@ server { keepalive_timeout {{ http_keepalive_timeout}}; {% endif %} - {% if opentracing_tracer != empty %} - opentracing_operation_name "apicast"; - opentracing_trace_locations on; - opentracing_tag original_request_uri $original_request_uri; - {% endif %} - {% if opentelemetry != empty %} opentelemetry_operation_name apicast; opentelemetry_attribute original_request_uri $original_request_uri; diff --git a/gateway/src/apicast/cli/environment.lua b/gateway/src/apicast/cli/environment.lua index 4b201f28a..95de38cb4 100644 --- a/gateway/src/apicast/cli/environment.lua +++ b/gateway/src/apicast/cli/environment.lua @@ -100,16 +100,6 @@ local function env_value_ref(name) return setmetatable({ name = name }, env_value_mt) end -local function read_opentracing_tracer(varname) - local opentracing_tracer = env_value_ref(varname) - - if tostring(opentracing_tracer) ~= nil then - ngx.log(ngx.WARN, 'opentracing use is DEPRECATED. Use Opentelemetry instead with OPENTELEMETRY env var') - end - - return opentracing_tracer -end - local _M = {} --- -- @field default_environment Default environment name. @@ -122,9 +112,6 @@ _M.default_environment = 'production' -- @tfield ?string proxy_ssl_certificate_key path to SSL certificate key -- @tfield ?string proxy_ssl_session_reuse whether SSL sessions can be reused -- @tfield ?string proxy_ssl_password_file path to a file with passphrases for the certificate keys --- @tfield ?string opentracing_tracer loads an opentracing tracer library, for example: jaeger --- @tfield ?string opentracing_config opentracing config file to load --- @tfield ?string opentracing_forward_header opentracing http header to forward upstream -- @tfield ?string opentelemetry enables server instrumentation using opentelemetry SDKs -- @tfield ?string opentelemetry_config_file opentelemetry config file to load -- @tfield ?string upstream_retry_cases error cases where the call to the upstream should be retried @@ -142,9 +129,6 @@ _M.default_config = { proxy_ssl_session_reuse = env_value_ref('APICAST_PROXY_HTTPS_SESSION_REUSE'), proxy_ssl_password_file = env_value_ref('APICAST_PROXY_HTTPS_PASSWORD_FILE'), proxy_ssl_verify = resty_env.enabled('OPENSSL_VERIFY'), - opentracing_tracer = read_opentracing_tracer('OPENTRACING_TRACER'), - opentracing_config = env_value_ref('OPENTRACING_CONFIG'), - opentracing_forward_header = env_value_ref('OPENTRACING_FORWARD_HEADER'), opentelemetry = env_value_ref('OPENTELEMETRY'), opentelemetry_config_file = env_value_ref('OPENTELEMETRY_CONFIG'), upstream_retry_cases = env_value_ref('APICAST_UPSTREAM_RETRY_CASES'), diff --git a/script/install/openresty.sh b/script/install/openresty.sh index 79681c032..4b43651c7 100755 --- a/script/install/openresty.sh +++ b/script/install/openresty.sh @@ -18,11 +18,7 @@ yum -y install \ openresty-resty-${OPENRESTY_RPM_VERSION} \ openresty-debuginfo-${OPENRESTY_RPM_VERSION} \ openresty-debugsource-${OPENRESTY_RPM_VERSION} \ - openresty-opentelemetry-${OPENRESTY_RPM_VERSION} \ - openresty-opentracing-${OPENRESTY_RPM_VERSION} \ - opentracing-cpp-devel-1.3.0 \ - libopentracing-cpp1-1.3.0 \ - jaegertracing-cpp-client-${JAEGERTRACING_CPP_CLIENT_RPM_VERSION}\ + openresty-opentelemetry-${OPENRESTY_RPM_VERSION} export PATH="./lua_modules/bin:/usr/local/openresty/luajit/bin/:${PATH}" export LUA_PATH="./lua_modules/share/lua/5.1/?.lua;./lua_modules/share/lua/5.1/?/init.lua;/usr/lib64/lua/5.1/?.lua;/usr/share/lua/5.1/?.lua;/opt/app-root/lua_modules/share/lua/5.1/?.lua;/opt/app-root/lua_modules/share/lua/5.1/?/?.lua" From 5989fe04f03c52ba4977072308912519a05e0822 Mon Sep 17 00:00:00 2001 From: An Tran Date: Thu, 16 Jan 2025 13:43:54 +1000 Subject: [PATCH 2/4] Remove opentracing from the build --- .gitmodules | 8 +- CHANGELOG.md | 1 + Containerfile | 40 +---- .../rpm-specs/openresty/openresty.spec | 40 ++--- .../opentracing-cpp/opentracing-cpp.spec | 152 ------------------ 5 files changed, 17 insertions(+), 224 deletions(-) delete mode 100644 dependencies/rpm-specs/opentracing-cpp/opentracing-cpp.spec diff --git a/.gitmodules b/.gitmodules index 2267c6ce9..e476b697c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "dependencies/git/opentracing-cpp"] - path = dependencies/git/opentracing-cpp - url = https://github.com/opentracing/opentracing-cpp [submodule "dependencies/git/zlib"] path = dependencies/git/zlib url = https://github.com/madler/zlib @@ -139,10 +136,7 @@ [submodule "dependencies/git/ngx_http_redis"] path = dependencies/git/ngx_http_redis url = https://github.com/osokin/ngx_http_redis -[submodule "dependencies/git/nginx-opentracing"] - path = dependencies/git/nginx-opentracing - url = https://github.com/opentracing-contrib/nginx-opentracing -[submodule "dependencies/git/apicast-nginx-module"] +[submodule "dependencies/git/apicas-nginx-module"] path = dependencies/git/apicast-nginx-module url = https://github.com/3scale/apicast-nginx-module [submodule "dependencies/git/grpc"] diff --git a/CHANGELOG.md b/CHANGELOG.md index cb441a759..2a66c8cdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Added the `APICAST_HTTPS_VERIFY_CLIENT` variable to allow configuration of the `ssl_verify_client` directive. [PR #1491](https://github.com/3scale/APIcast/pull/1491) [THREESCALE-10156](https://issues.redhat.com/browse/THREESCALE-10156) - Add `APICAST_LUA_SOCKET_KEEPALIVE_REQUESTS` to limit the number of requests a single keepalive socket can handle [PR #1496](https://github.com/3scale/APIcast/pull/1496) [THREESCALE-11321](https://issues.redhat.com/browse/THREESCALE-11321) - Replace internal OPENSSL module with lua-resty-openssl [PR #1502](https://github.com/3scale/APIcast/pull/1502) [THREESCALE-11412](https://issues.redhat.com/browse/THREESCALE-11412) +- Remove opentracing support [PR #1520](https://github.com/3scale/APIcast/pull/1520) [THREESCALE-11603](https://issues.redhat.com/browse/THREESCALE-11603) ## [3.15.0] 2024-04-04 diff --git a/Containerfile b/Containerfile index 351b5a33f..4b95442c0 100644 --- a/Containerfile +++ b/Containerfile @@ -29,22 +29,11 @@ RUN yum-builddep --assumeyes SPECS/openresty-zlib.spec COPY dependencies/git/zlib ${RPMBUILD_ROOT}/SOURCES/zlib-1.2.11 RUN rpmbuild -ba SPECS/openresty-zlib.spec - -FROM rpm-builder as opentracing-cpp - -COPY dependencies/rpm-specs/opentracing-cpp/opentracing-cpp.spec ${RPMBUILD_ROOT}/SPECS/opentracing-cpp.spec -RUN yum-builddep --assumeyes SPECS/opentracing-cpp.spec - -COPY dependencies/git/opentracing-cpp ${RPMBUILD_ROOT}/SOURCES/opentracing-cpp-1.3.0 -RUN rpmbuild -ba SPECS/opentracing-cpp.spec - - FROM rpm-builder as openresty # Copy *.rpm files from earlier stages to /tmp/ so we can install RPMs COPY --from=openresty-pcre /root/rpmbuild/RPMS /tmp/openresty-pcre/RPMS COPY --from=openresty-zlib /root/rpmbuild/RPMS /tmp/openresty-zlib/RPMS -COPY --from=opentracing-cpp /root/rpmbuild/RPMS /tmp/opentracing-cpp/RPMS # TODO: fix this later - uncomment for local build #COPY dependencies/rpm-specs/tmp/annobin-annocheck-10.67-3.el8.x86_64.rpm /tmp/annobin-annocheck-10.67-3.el8.x86_64.rpm @@ -55,9 +44,7 @@ RUN yum localinstall --assumeyes \ /tmp/openresty-pcre/RPMS/`arch`/openresty-pcre-8.44-126.el8.`arch`.rpm \ /tmp/openresty-pcre/RPMS/`arch`/openresty-pcre-devel-8.44-126.el8.`arch`.rpm \ /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-1.2.11-122.el8.`arch`.rpm \ - /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-devel-1.2.11-122.el8.`arch`.rpm \ - /tmp/opentracing-cpp/RPMS/`arch`/libopentracing-cpp1-1.3.0-132.el8.`arch`.rpm \ - /tmp/opentracing-cpp/RPMS/`arch`/opentracing-cpp-devel-1.3.0-132.el8.`arch`.rpm + /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-devel-1.2.11-122.el8.`arch`.rpm COPY dependencies/rpm-specs/openresty/openresty.spec ${RPMBUILD_ROOT}/SPECS/openresty.spec RUN yum-builddep --assumeyes SPECS/openresty.spec @@ -105,7 +92,6 @@ COPY dependencies/git/set-misc-nginx-module ${RPMBUILD_ROOT}/SOURCES/set-misc-ng COPY dependencies/git/srcache-nginx-module ${RPMBUILD_ROOT}/SOURCES/srcache-nginx-module-v0.32 COPY dependencies/git/stream-lua-nginx-module ${RPMBUILD_ROOT}/SOURCES/stream-lua-nginx-module-v0.0.9 COPY dependencies/git/xss-nginx-module ${RPMBUILD_ROOT}/SOURCES/xss-nginx-module-v0.06 -COPY dependencies/git/nginx-opentracing ${RPMBUILD_ROOT}/SOURCES/nginx-opentracing-v0.3.0 COPY dependencies/git/apicast-nginx-module ${RPMBUILD_ROOT}/SOURCES/apicast-nginx-module-v0.4 COPY dependencies/git/grpc ${RPMBUILD_ROOT}/SOURCES/grpc-v1.49.2 COPY dependencies/git/opentelemetry-proto ${RPMBUILD_ROOT}/SOURCES/opentelemetry-proto-v0.19.0 @@ -136,19 +122,15 @@ COPY dependencies/rpm-specs/luarocks/luarocks.spec ${RPMBUILD_ROOT}/SPECS/luaroc ARG OPENRESTY_RPM_VERSION="1.19.3-123.el8" COPY --from=openresty-pcre /root/rpmbuild/RPMS /tmp/openresty-pcre/RPMS COPY --from=openresty-zlib /root/rpmbuild/RPMS /tmp/openresty-zlib/RPMS -COPY --from=opentracing-cpp /root/rpmbuild/RPMS /tmp/opentracing-cpp/RPMS COPY --from=openresty /root/rpmbuild/RPMS /tmp/openresty/RPMS RUN yum localinstall --assumeyes \ /tmp/openresty-pcre/RPMS/`arch`/openresty-pcre-8.44-126.el8.`arch`.rpm \ /tmp/openresty-pcre/RPMS/`arch`/openresty-pcre-devel-8.44-126.el8.`arch`.rpm \ /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-1.2.11-122.el8.`arch`.rpm \ /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-devel-1.2.11-122.el8.`arch`.rpm \ - /tmp/opentracing-cpp/RPMS/`arch`/libopentracing-cpp1-1.3.0-132.el8.`arch`.rpm \ - /tmp/opentracing-cpp/RPMS/`arch`/opentracing-cpp-devel-1.3.0-132.el8.`arch`.rpm \ /tmp/openresty/RPMS/noarch/openresty-resty-${OPENRESTY_RPM_VERSION}.noarch.rpm \ /tmp/openresty/RPMS/noarch/openresty-opm-${OPENRESTY_RPM_VERSION}.noarch.rpm \ /tmp/openresty/RPMS/`arch`/openresty-opentelemetry-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ - /tmp/openresty/RPMS/`arch`/openresty-opentracing-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ /tmp/openresty/RPMS/`arch`/openresty-${OPENRESTY_RPM_VERSION}.`arch`.rpm RUN yum-builddep --assumeyes SPECS/luarocks.spec @@ -178,7 +160,6 @@ ARG LUAROCKS_VERSION="2.3.0-105.el8" ARG OPENRESTY_RPM_VERSION="1.19.3-123.el8" COPY --from=openresty-pcre /root/rpmbuild/RPMS /tmp/openresty-pcre/RPMS COPY --from=openresty-zlib /root/rpmbuild/RPMS /tmp/openresty-zlib/RPMS -COPY --from=opentracing-cpp /root/rpmbuild/RPMS /tmp/opentracing-cpp/RPMS COPY --from=openresty /root/rpmbuild/RPMS /tmp/openresty/RPMS COPY --from=luarocks /root/rpmbuild/RPMS /tmp/luarocks/RPMS @@ -187,12 +168,9 @@ RUN yum localinstall --assumeyes \ /tmp/openresty-pcre/RPMS/`arch`/openresty-pcre-devel-8.44-126.el8.`arch`.rpm \ /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-1.2.11-122.el8.`arch`.rpm \ /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-devel-1.2.11-122.el8.`arch`.rpm \ - /tmp/opentracing-cpp/RPMS/`arch`/libopentracing-cpp1-1.3.0-132.el8.`arch`.rpm \ - /tmp/opentracing-cpp/RPMS/`arch`/opentracing-cpp-devel-1.3.0-132.el8.`arch`.rpm \ /tmp/openresty/RPMS/noarch/openresty-resty-${OPENRESTY_RPM_VERSION}.noarch.rpm \ /tmp/openresty/RPMS/noarch/openresty-opm-${OPENRESTY_RPM_VERSION}.noarch.rpm \ /tmp/openresty/RPMS/`arch`/openresty-opentelemetry-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ - /tmp/openresty/RPMS/`arch`/openresty-opentracing-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ /tmp/openresty/RPMS/`arch`/openresty-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ /tmp/luarocks/RPMS/`arch`/luarocks-${LUAROCKS_VERSION}.`arch`.rpm @@ -219,7 +197,6 @@ ARG GATEWAY_ROCKSPECS_NATIVE_VERSION="1.0.0-123.el8" COPY --from=openresty-pcre /root/rpmbuild/RPMS /tmp/openresty-pcre/RPMS COPY --from=openresty-zlib /root/rpmbuild/RPMS /tmp/openresty-zlib/RPMS -COPY --from=opentracing-cpp /root/rpmbuild/RPMS /tmp/opentracing-cpp/RPMS COPY --from=openresty /root/rpmbuild/RPMS /tmp/openresty/RPMS COPY --from=luarocks /root/rpmbuild/RPMS /tmp/luarocks/RPMS COPY --from=gateway-rockspecs-native /root/rpmbuild/RPMS /tmp/gateway-rockspecs-native/RPMS @@ -229,12 +206,9 @@ RUN yum localinstall --assumeyes \ /tmp/openresty-pcre/RPMS/`arch`/openresty-pcre-devel-8.44-126.el8.`arch`.rpm \ /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-1.2.11-122.el8.`arch`.rpm \ /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-devel-1.2.11-122.el8.`arch`.rpm \ - /tmp/opentracing-cpp/RPMS/`arch`/libopentracing-cpp1-1.3.0-132.el8.`arch`.rpm \ - /tmp/opentracing-cpp/RPMS/`arch`/opentracing-cpp-devel-1.3.0-132.el8.`arch`.rpm \ /tmp/openresty/RPMS/noarch/openresty-resty-${OPENRESTY_RPM_VERSION}.noarch.rpm \ /tmp/openresty/RPMS/noarch/openresty-opm-${OPENRESTY_RPM_VERSION}.noarch.rpm \ /tmp/openresty/RPMS/`arch`/openresty-opentelemetry-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ - /tmp/openresty/RPMS/`arch`/openresty-opentracing-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ /tmp/openresty/RPMS/`arch`/openresty-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ /tmp/luarocks/RPMS/`arch`/luarocks-${LUAROCKS_VERSION}.`arch`.rpm \ /tmp/gateway-rockspecs-native/RPMS/`arch`/gateway-rockspecs-native-${GATEWAY_ROCKSPECS_NATIVE_VERSION}.`arch`.rpm @@ -274,7 +248,6 @@ ARG OPENRESTY_RPM_VERSION="1.19.3-123.el8" ARG LUAROCKS_VERSION="2.3.0-105.el8" ARG GATEWAY_ROCKSPECS_VERSION="2.10.0-102.el8" ARG GATEWAY_ROCKSPECS_NATIVE_VERSION="1.0.0-123.el8" -ARG JAEGERTRACING_CPP_CLIENT_RPM_VERSION="0.3.1-16.el8" # Copy the upstream sources from cachito integration COPY gateway /opt/app-root/src @@ -294,7 +267,6 @@ RUN yum install --assumeyes gcc-toolset-12-annobin-annocheck # Copy *.rpm files from earlier stages to /tmp/ so we can install RPMs COPY --from=openresty-pcre /root/rpmbuild/RPMS /tmp/openresty-pcre/RPMS COPY --from=openresty-zlib /root/rpmbuild/RPMS /tmp/openresty-zlib/RPMS -COPY --from=opentracing-cpp /root/rpmbuild/RPMS /tmp/opentracing-cpp/RPMS COPY --from=openresty /root/rpmbuild/RPMS /tmp/openresty/RPMS COPY --from=luarocks /root/rpmbuild/RPMS /tmp/luarocks/RPMS COPY --from=gateway-rockspecs-native /root/rpmbuild/RPMS /tmp/gateway-rockspecs-native/RPMS @@ -305,24 +277,14 @@ RUN yum localinstall --assumeyes \ /tmp/openresty-pcre/RPMS/`arch`/openresty-pcre-devel-8.44-126.el8.`arch`.rpm \ /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-1.2.11-122.el8.`arch`.rpm \ /tmp/openresty-zlib/RPMS/`arch`/openresty-zlib-devel-1.2.11-122.el8.`arch`.rpm \ - /tmp/opentracing-cpp/RPMS/`arch`/libopentracing-cpp1-1.3.0-132.el8.`arch`.rpm \ - /tmp/opentracing-cpp/RPMS/`arch`/opentracing-cpp-devel-1.3.0-132.el8.`arch`.rpm \ /tmp/openresty/RPMS/noarch/openresty-resty-${OPENRESTY_RPM_VERSION}.noarch.rpm \ /tmp/openresty/RPMS/noarch/openresty-opm-${OPENRESTY_RPM_VERSION}.noarch.rpm \ /tmp/openresty/RPMS/`arch`/openresty-opentelemetry-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ - /tmp/openresty/RPMS/`arch`/openresty-opentracing-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ /tmp/openresty/RPMS/`arch`/openresty-${OPENRESTY_RPM_VERSION}.`arch`.rpm \ /tmp/luarocks/RPMS/`arch`/luarocks-${LUAROCKS_VERSION}.`arch`.rpm \ /tmp/gateway-rockspecs-native/RPMS/`arch`/gateway-rockspecs-native-${GATEWAY_ROCKSPECS_NATIVE_VERSION}.`arch`.rpm \ /tmp/gateway-rockspecs/RPMS/noarch/gateway-rockspecs-${GATEWAY_ROCKSPECS_VERSION}.noarch.rpm -# FIXME/Yorgos: see if this is still required -#RUN PKGS="jaegertracing-cpp-client-${JAEGERTRACING_CPP_CLIENT_RPM_VERSION}" && \ -# mkdir -p "$HOME" && \ -# yum -y --setopt=tsflags=nodocs install $PKGS && \ -# rpm -V $PKGS && \ -# yum clean all -y - RUN mkdir -p /opt/app-root/src/logs && \ useradd -u 1001 -r -g 0 -d ${HOME} -s /sbin/nologin -c "Default Application User" default && \ rm -r /usr/local/openresty/nginx/logs && \ diff --git a/dependencies/rpm-specs/openresty/openresty.spec b/dependencies/rpm-specs/openresty/openresty.spec index 3b9f84c5b..b77cdf2fe 100644 --- a/dependencies/rpm-specs/openresty/openresty.spec +++ b/dependencies/rpm-specs/openresty/openresty.spec @@ -81,12 +81,11 @@ Source40: set-misc-nginx-module-v0.32.tar.gz Source41: srcache-nginx-module-v0.32.tar.gz Source42: stream-lua-nginx-module-v0.0.9.tar.gz Source43: xss-nginx-module-v0.06.tar.gz -Source44: nginx-opentracing-v0.3.0.tar.gz -Source45: %{apicastModule}.tar.gz -Source46: grpc-%{grpc_version}.tar.gz -Source47: opentelemetry-cpp-%{opentelemetry_cpp_version}.tar.gz -Source48: opentelemetry-cpp-contrib-%{opentelemetry_cpp_contrib_version}.tar.gz -Source49: opentelemetry-proto-%{opentelemetry_proto_version}.tar.gz +Source44: %{apicastModule}.tar.gz +Source45: grpc-%{grpc_version}.tar.gz +Source46: opentelemetry-cpp-%{opentelemetry_cpp_version}.tar.gz +Source47: opentelemetry-cpp-contrib-%{opentelemetry_cpp_contrib_version}.tar.gz +Source48: opentelemetry-proto-%{opentelemetry_proto_version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -96,7 +95,6 @@ BuildRequires: gcc, gcc-c++ BuildRequires: gcc-toolset-12-gcc, gcc-toolset-12-gcc-c++ BuildRequires: openresty-zlib-devel >= 1.2.11-3 BuildRequires: openresty-pcre-devel >= 8.42-1 -BuildRequires: opentracing-cpp-devel = 1.3.0 Requires: openresty-zlib >= 1.2.11-3 Requires: openresty-pcre >= 8.42-1 @@ -165,14 +163,6 @@ BuildArch: noarch %description opm This package provides the client side tool, opm, for OpenResty Pakcage Manager (OPM). -%package opentracing - -Summary: Opentracing module - - -%description opentracing -This package provides the opentracing module in Openresty. - %package opentelemetry Summary: Opentelemetry module @@ -183,10 +173,10 @@ This package provides the opentelemetry module in Openresty. %prep ls -la %{_sourcedir} %setup -q -n "openresty-%{commitid}" +%setup -q -D -T -b 45 -n "openresty-%{commitid}" %setup -q -D -T -b 46 -n "openresty-%{commitid}" -%setup -q -D -T -b 47 -n "openresty-%{commitid}" -%setup -q -D -T -a 48 -n "openresty-%{commitid}" -%setup -q -D -T -b 49 -n "openresty-%{commitid}" +%setup -q -D -T -a 47 -n "openresty-%{commitid}" +%setup -q -D -T -b 48 -n "openresty-%{commitid}" cp %{SOURCE0} . cp %{SOURCE1} . cp %{SOURCE2} . @@ -231,8 +221,7 @@ cp %{SOURCE40} . cp %{SOURCE41} . cp %{SOURCE42} . cp %{SOURCE43} . -tar xzf %{SOURCE44} -tar xzfv %{SOURCE45} +tar xzfv %{SOURCE44} %build ls -al %{_builddir} @@ -322,7 +311,6 @@ ls -lah bundle/ --with-http_gunzip_module \ --with-threads \ --add-module="../%{apicastModule}/" \ - --add-dynamic-module="../nginx-opentracing-v0.3.0/opentracing" \ --add-dynamic-module="../opentelemetry-cpp-contrib-%{opentelemetry_cpp_contrib_version}/instrumentation/nginx" \ --with-luajit-target-strip="Q='' CFLAGS='' TARGET_XCFLAGS='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' TARGET_FLAGS='%{optflags}' HOST_CC='%{__cc}' STATIC_CC='%{__cc}' DYNAMIC_CC='%{__cc} -fPIC' HOST_CFLAGS='%{optflags}' HOST_LDFLAGS='%{?__global_ldflags}'" @@ -395,11 +383,6 @@ rm -rf %{buildroot} %{orprefix}/site/manifest/ %{orprefix}/site/pod/ -%files opentracing -%defattr(-,root,root,-) - -%{orprefix}/nginx/modules/ngx_http_opentracing_module.so - %files opentelemetry %defattr(-,root,root,-) @@ -407,6 +390,11 @@ rm -rf %{buildroot} %{lib_path} %changelog +* Fri Nov 29 2024 An Tran - 1.21.4-1 +- Upgraded openresty to 1.21.4.3. +- Build openresty from local patches +- Remove opentracing + * Tue Oct 24 2023 Eguzki Astiz Lezaun - 1.19.3-123 - CVE-2023-44487 diff --git a/dependencies/rpm-specs/opentracing-cpp/opentracing-cpp.spec b/dependencies/rpm-specs/opentracing-cpp/opentracing-cpp.spec deleted file mode 100644 index 08b637e6d..000000000 --- a/dependencies/rpm-specs/opentracing-cpp/opentracing-cpp.spec +++ /dev/null @@ -1,152 +0,0 @@ -%global commitid f3c1f42601d13504c68e2bc81c60604f0de055dd -%global meadalpha %{nil} -%global meadrel %{nil} -%global version_major 1 -%global version_minor 3 -%global version_micro 0 - -# -# spec file for package opentracing-cpp -# -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via http://bugs.opensuse.org/ -# - - -Name: opentracing-cpp -Version: %{version_major}.%{version_minor}.%{version_micro} -Release: 132%{?dist} -Summary: OpenTracing C++ API -License: MIT -Group: Development/Languages/C and C++ -Url: http://opentracing.io/ -Source: opentracing-cpp-%{version} -# Patch for cmake to handle lib/lib64 properly -BuildRequires: gcc-c++ cmake3 -%description -C++ implementation of the OpenTracing API. - -%package -n libopentracing-cpp1 -Summary: OpenTracing C++ API -Group: System/Libraries - -%description -n libopentracing-cpp1 -C++ implementation of the OpenTracing API. - -%package devel -Summary: Development files for the OpenTracing C++ API -Group: Development/Languages/C and C++ -Requires: libopentracing-cpp1 = %{version}-%{release} - -%description devel -Development files for the C++ implementation of the OpenTracing API. - -%package devel-static -Summary: Static libraties for the OpenTracing C++ API -Group: Development/Languages/C and C++ -Requires: %{name}-devel = %{version} - -%description devel-static -Static libraries for the C++ implementation of the OpenTracing API. - -%global _libdir /usr/lib/ - -%prep -cp -R ../SOURCES/%{name}-%{version} %{name}-%{version} -%setup -q -T -D -n %{name}-%{version} - -%build -%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS=-fPIC -DBUILD_DYNAMIC_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_TESTING=OFF -DLIB_INSTALL_DIR=/usr/%{_lib} -#%%make_jobs -# (the above macro only exists on Suse) -make %{?_smp_mflags} - -%install -#%%cmake_install -# We dont have the above macro -%make_install -# FIXME: cmake_install.cmake does not seem to know about lib64 -# See Patch0 -#mv %{?buildroot}/usr/lib %{?buildroot}/usr/%{_lib} - -%post -n libopentracing-cpp1 -p /sbin/ldconfig - -%postun -n libopentracing-cpp1 -p /sbin/ldconfig - -%files -n libopentracing-cpp1 -%license LICENSE -%dir %{_libdir}/cmake/OpenTracing -%{_libdir}/cmake/OpenTracing/OpenTracingConfig.cmake -%{_libdir}/cmake/OpenTracing/OpenTracingConfigVersion.cmake -%{_libdir}/cmake/OpenTracing/OpenTracingTargets-relwithdebinfo.cmake -%{_libdir}/cmake/OpenTracing/OpenTracingTargets.cmake -%{_libdir}/libopentracing.so.1 -%{_libdir}/libopentracing.so.%{version_major}.%{version_minor}.%{version_micro} -%{_libdir}/libopentracing_mocktracer.so.%{version_major} -%{_libdir}/libopentracing_mocktracer.so.%{version_major}.%{version_minor}.%{version_micro} - -%files devel -%dir %{_includedir}/opentracing -%{_includedir}/opentracing/config.h -%{_includedir}/opentracing/dynamic_load.h -%{_includedir}/opentracing/noop.h -%{_includedir}/opentracing/propagation.h -%{_includedir}/opentracing/span.h -%{_includedir}/opentracing/string_view.h -%{_includedir}/opentracing/tracer.h -%{_includedir}/opentracing/tracer_factory.h -%{_includedir}/opentracing/util.h -%{_includedir}/opentracing/value.h -%{_includedir}/opentracing/version.h - -%dir %{_includedir}/opentracing/expected -%{_includedir}/opentracing/expected/expected.hpp - -# These are only available on 1.4.0 onwards -#%%dir %{_includedir}/opentracing/ext -#%%{_includedir}/opentracing/ext/tags.h - -%dir %{_includedir}/opentracing/mocktracer -%{_includedir}/opentracing/mocktracer/in_memory_recorder.h -%{_includedir}/opentracing/mocktracer/json.h -%{_includedir}/opentracing/mocktracer/json_recorder.h -%{_includedir}/opentracing/mocktracer/recorder.h -%{_includedir}/opentracing/mocktracer/tracer.h -%{_includedir}/opentracing/mocktracer/tracer_factory.h - -%dir %{_includedir}/opentracing/variant -%{_includedir}/opentracing/variant/recursive_wrapper.hpp -%{_includedir}/opentracing/variant/variant.hpp - -%{_libdir}/libopentracing.so -%{_libdir}/libopentracing_mocktracer.so - -%files devel-static -%{_libdir}/libopentracing.a -%{_libdir}/libopentracing_mocktracer.a - -%doc README.md COPYING - -%changelog - -* Wed Oct 17 2018 Fernando Nasser - 1.3.0 -- Build 1.3.0 - -* Sat Jul 28 2018 jengelh@inai.de -- Fix RPM groups, edit description for better grammar. -* Mon Jun 25 2018 mrostecki@suse.com -- Make use of %%license macro -* Tue Jun 19 2018 mrostecki@suse.com -- Fix ldconfig calls -* Wed May 2 2018 mrostecki@suse.com -- Initial commit From 661cce2105238f9ceca9ac1044901739b5044520 Mon Sep 17 00:00:00 2001 From: An Tran Date: Fri, 17 Jan 2025 14:05:25 +1000 Subject: [PATCH 3/4] Fix typo from previous commit --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index e476b697c..731bc4120 100644 --- a/.gitmodules +++ b/.gitmodules @@ -136,7 +136,7 @@ [submodule "dependencies/git/ngx_http_redis"] path = dependencies/git/ngx_http_redis url = https://github.com/osokin/ngx_http_redis -[submodule "dependencies/git/apicas-nginx-module"] +[submodule "dependencies/git/apicast-nginx-module"] path = dependencies/git/apicast-nginx-module url = https://github.com/3scale/apicast-nginx-module [submodule "dependencies/git/grpc"] From c1113ee7e518ebecb0f6f99e55a54b5709ad92c5 Mon Sep 17 00:00:00 2001 From: An Tran Date: Fri, 17 Jan 2025 16:16:57 +1000 Subject: [PATCH 4/4] Remove opentracing test --- t/opentracing.t | 141 ------------------------------------------------ 1 file changed, 141 deletions(-) delete mode 100644 t/opentracing.t diff --git a/t/opentracing.t b/t/opentracing.t deleted file mode 100644 index 9793c77e2..000000000 --- a/t/opentracing.t +++ /dev/null @@ -1,141 +0,0 @@ -use lib 't'; -use Test::APIcast::Blackbox 'no_plan'; - -$ENV{OPENTRACING_TRACER} ||= 'jaeger'; - -repeat_each(1); -run_tests(); - - -__DATA__ -=== TEST 1: OpenTracing -Request passing through APIcast should publish OpenTracing info. ---- configuration - { - "services": [ - { - "proxy": { - "policy_chain": [ - { "name": "apicast.policy.upstream", - "configuration": - { - "rules": [ { "regex": "/", "url": "http://echo" } ] - } - } - ] - } - } - ] - } ---- request -GET /a_path? ---- response_body eval -qr/uber-trace-id: / ---- error_code: 200 ---- no_error_log -[error] ---- udp_listen: 6831 ---- udp_reply ---- udp_query eval -qr/jaeger.version/ ---- wait: 10 - -=== TEST 2: OpenTracing forward header -Opentracing forward header is send to the upstream. ---- env eval -( - 'OPENTRACING_FORWARD_HEADER' => "foobar" -) ---- configuration -{ - "services": [ - { - "id": 42, - "system_name": "foo", - "proxy": { - "policy_chain": [ - { - "name": "apicast.policy.upstream", - "configuration": { - "rules": [ - { - "regex": "/", - "url": "http://test:$TEST_NGINX_SERVER_PORT" - } - ] - } - } - ] - } - } - ] -} ---- upstream - location / { - content_by_lua_block { - local headers = ngx.req.get_headers() - assert(headers["foobar"] == "value") - } - } ---- request -GET /a_path? ---- more_headers eval -"foobar: value" ---- error_code: 200 ---- no_error_log -[error] ---- udp_listen: 6831 ---- udp_reply ---- udp_query eval -qr/jaeger.version/ ---- wait: 10 - -=== TEST 3: original_request_uri tag -Opentracing custom tag fix for THREESCALE-5669 --- env eval -( - 'OPENTRACING_FORWARD_HEADER' => "foobar" -) ---- configuration -{ - "services": [ - { - "id": 42, - "system_name": "foo", - "proxy": { - "policy_chain": [ - { - "name": "apicast.policy.upstream", - "configuration": { - "rules": [ - { - "regex": "/", - "url": "http://test:$TEST_NGINX_SERVER_PORT" - } - ] - } - } - ] - } - } - ] -} ---- upstream - location / { - content_by_lua_block { - local headers = ngx.req.get_headers() - assert(headers["foobar"] == "value") - } - } ---- request -GET /a_path? ---- more_headers eval -"foobar: value" ---- error_code: 200 ---- no_error_log -[error] ---- udp_listen: 6831 ---- udp_reply ---- udp_query eval -qr/original_request_uri/ ---- wait: 10