Unit 1.34.0 released

Andrew Clayton ac at sigsegv.uk
Thu Dec 19 23:11:35 UTC 2024


Hi, NGINX Unit community,

Christmas has come early!

We are pleased to announce the release of NGINX Unit 1.34.0

This release is comprised of 59 non-merge commits from 8 people.

This release can be found at

<https://github.com/nginx/unit/releases/tag/1.34.0>

Packages can be found from the Unit website

<https://unit.nginx.org/installation/#official-packages>

Website announcement can be found at

<https://unit.nginx.org/news/2024/unit-1.34.0-released>

Unit 1.34.0 is a small end of year release, none the less it packs a
couple of big ticket features; JSON formatted access logs and initial
support for OpenTelemetry (OTEL). Last but not least a Perl language
module fix for parsing certain scripts.

JSON formatted access logs
==========================

This release introduces the ability to specify a JSON format for access
logs.

When defining an access log you can specify 'format' as an object
defining JSON field name/value pairs, e.g.

  {
      "access_log": {
          "path": "/tmp/access.log",
          "format": {
              "remote_addr": "$remote_addr",
              "time_local": "$time_local",
              "request_line": "$request_line",
              "status": "$status",
              "body_bytes_sent": "$body_bytes_sent",
              "header_referer": "$header_referer",
              "header_user_agent": "$header_user_agent"
          }
      }
  }

The JSON *values* support being strings, variables and JavaScript.

OpenTelemetry (OTEL)
====================

This release includes initial support for OpenTelemtry (OTEL)
<https://opentelemetry.io/>

This support has been added via the OpenTelemetry Rust SDK and as such
requires cargo/rust to build.

An example configuration looks like

  {
      "listeners": {
          "[::1]:8080": {
              "pass": "routes"
          }
      },

      "settings": {
          "telemetry": {
              "batch_size": 20,
              "endpoint": "http://example.com/v1/traces",
              "protocol": "http",
              "sampling_ratio": 1.0
          }
      },

      "routes": [
          {
              "match": {
                  "headers": {
                      "accept": "*text/html*"
                  }
              },
              "action": {
                  "share": "/usr/share/unit/welcome/welcome.html"
              }
          }, {
              "action": {
                  "share": "/usr/share/unit/welcome/welcome.md"
              }
          }
      ]
  }

  'endpoint'

  The endpoint for the OpenTelemetry (OTEL) Collector. This is required.

  It takes a URL to either a gRPC or HTTP endpoint.

  'protocol'

  Determines the protocol used to communicate with the endpoint. This is
  required.
   
  Can be either "http" or "grpc".

  'batch_size'

  Number of spans to cache before triggering a transaction with the
  configured endpoint. This is optional.

  This allows the user to cache up to N spans before the OpenTelemetry
  (OTEL) background thread sends spans over the network to the
  collector.

  Must be a positive integer.

  'sampling_ratio'

  Percentage of requests to trace. This is optional.

  This allows the user to only trace anywhere from 0% to 100% of
  requests that hit Unit. In high throughput environments this
  percentage should be lower. This allows the user to save space in
  storing span data, and to collect request metrics like time to decode
  headers and whatnot without storing massive amounts of duplicate
  superfluous data.
  
  Must be a positive floating point number.

This support is disabled by default but can be enabled by passing --otel
to ./configure.

Changes
=======

* The Perl language module no longer adds a 'new' constructor to parsed
  scripts. It's not required and could interfere with scripts that were
  trying to use 'new' themselves...

Developers
==========

* -funsigned-char

  We now compile Unit with -funsigned-char, this ensures we are using
  the same char type on all platforms (what you get by default varies by
  platform).

  This is also a first step in getting rid of (mostly at least) our
  usage of u_char and using char instead, which better aligns with libc
  interfaces etc.

========================================================================

Changes with Unit 1.34.0                                     19 Dec 2024

    *) Feature: initial OpenTelemetry (OTEL) support. (Disabled by
                default).

    *) Feature: support for JSON formatted access logs.

    *) Bugfix: tweak the Perl language module to avoid breaking scripts
               in some circumstances.

------------------------------------------------------------------------

Changes since 1.33.0 are as follows:

Alejandro Colomar (1):
      Use nxt_nitems() instead of sizeof() for strings (arrays)

Andrew Clayton (29):
      docs/unit-openapi.yaml: Update version for 1.33.0
      Version bump
      Compile with -funsigned-char
      Resolve unused assignment in nxt_term_parse()
      src/test: Add an extra test case to nxt_term_parse_test.c
      Re-work nxt_process_check_pid_status() slightly
      ci: Fix disabling of the mono-xsp4.service
      ci: Install pytest via apt(8)
      ci: Drop PHP 8.1 from our tests
      perl: Remove unused module constructor
      Some more variable constification
      src/test: Fix missing parameter to nxt_log_alert() in nxt_base64_test()
      ci: Add a clang-ast workflow
      auto: Remove unused pthread spinlock checks
      wasm-wc: Update to wasmtime v26.0.1
      Decast nxt_cpymem()
      ci: Build with --otel on dev distros
      otel: Disable static_mut_refs warning for nxt_otel_rs_span_tx()
      auto/otel: Remove pkg-config check
      wasm-wc: Update to wasmtime 27.0.0
      otel: Update crates
      tools/unitctl: Update crates
      wasm-wc: Update crates
      .mailmap: Add an entry for Igor
      tools/unitctl: Update for version 1.34.0
      docs/unit-openapi.yaml: Update version for 1.34.0
      pkg/docker: Update dockerfiles for 1.34.0
      docs/changes.xml: Add 1.34.0 changelog entries
      Add 1.34.0 CHANGES

Ava Hahn (7):
      tools/unitctl: use hyper-rustls instead of hyper-tls
      tools/unitctl: bump bollard and clarify docker client error
      otel: add opentelemetry rust crate code
      otel: add build tooling to include otel code
      otel: add header parsing and test call state
      otel: configuration items and their validation
      docs/openapi: update OpenAPI references

Gabor Javorszky (1):
      .editorconfig: fix bracket balance of editorconfig file

Igor Ippolitov (1):
      Docker: renamed branch to fetch from after successfull hg->git migration

Konstantin Pavlov (8):
      Docker: update Python and PHP versions
      Packages: support rpm 4.20+
      Packages: add Fedora 41 support
      contrib: update njs to 0.8.8
      contrib: update wasmtime to 27.0.0
      Packages: enable otel support
      Docker: enable otel and fix build with wasmtime 24+
      Docker: update Rust version

Sergey A. Osokin (3):
      java: Update third-party components to their recent versions
      wasm: Fix build with wasmtime 27.0.0
      java: update third-party components to their recent versions

Zhidao HONG (7):
      Add flag for newline control in access log entries
      Fix missing newlines in access logs for JS configuration
      Make nxt_tstr_is_js() macro public in header
      http: Refactor format field in nxt_router_access_log_conf_t
      http: Introduce nxt_router_access_log_format_t structure
      http: Support JSON format in access log
      tests: Add tests for JSON format access log

dependabot[bot] (2):
      wasm-wc: Bump the wasmtime crate from 24.0.0 to 24.0.1
      tools/unitctl: bump anstream from 0.6.5 to 0.6.15


More information about the unit mailing list