open-telemetry / open-telemetry/opentelemetry-cpp-contrib

How to build module ngx_http_opentelemetry_module for version nginx 1.20.1

Open
#525 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Webserver
Dominant language
Python
Stars
153
Forks
184
Avg merge
2d 9h
Merged PRs (30d)
26

Description

I'm trying to figure out how to build ngx_http_opentelemetry_module for version nginx 1.20.1 in Centos 7 and is it possible?

From a container with Centos 7 in the downloaded archive nginx-1.20.1,
I execute:

  1. [root@200e088735f3 nginx-1.20.1]#
    ./configure --add-module=/opt/src/1.0.1/opentelemetry-cpp-contrib-webserver-v1.0.1/instrumentation/otel-webserver-module/src/nginx/
    where /opt/src/1.0.1/opentelemetry-cpp-contrib-webserver-v1.0.1/instrumentation/otel-webserver-module/src/nginx/
    webserver/v1.0.1 and contains files,
    Makefile
    config
    ngx_http_opentelemetry_log.c
    ngx_http_opentelemetry_log.h
    ngx_http_opentelemetry_module.c
    ngx_http_opentelemetry_module.h

  2. Configure works fine, but at the make stage I get errors:
    /opt/src/1.0.2/opentelemetry-cpp-contrib-webserver-v1.0.2/instrumentation/otel-webserver-module/src/nginx//ngx_http_opentelemetry_module.c:1511:12: note: expected 'const char *' but argument is of type 'u_char *'
    /opt/src/1.0.2/opentelemetry-cpp-contrib-webserver-v1.0.2/instrumentation/otel-webserver-module/src/nginx//ngx_http_opentelemetry_module.c:1512:51: error: assignment discards 'const' qualifier from pointer target type [-Werror]
    req_payload->headers[count].value = (const char)(h->value).data;
    ^
    cc1: all warnings being treated as errors
    make[1]: *** [objs/addon/nginx/ngx_http_opentelemetry_module.o] Error 1
    make[1]: Leaving directory `/nginx-1.20.1'
    make: *** [build] Error 2
    [root@200e088735f3 nginx-1.20.1]#

How can I build ngx_http_opentelemetry_module for the required version of nginx server?

err.log

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with nginx-1.20.1's module build configuration and the listed ngx_http_opentelemetry_module.c, ngx_http_opentelemetry_log.c, and config files. Reproduce the configure and make commands in CentOS 7, then inspect the compiler diagnostics around lines 1511-1512 and the attached err.log. Done means establishing and recording whether this module version can build against nginx 1.20.1.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, centos, nginx
Domain
backend, build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.