Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx auto instrumentation don't specify a correct log4cxx.xml #2978

Open
erenming opened this issue May 21, 2024 · 1 comment
Open

Nginx auto instrumentation don't specify a correct log4cxx.xml #2978

erenming opened this issue May 21, 2024 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@erenming
Copy link

Component(s)

auto-instrumentation

What happened?

Description

I want to use NginxAutoInstrumentation, but found it couldn't work with the default configuration. Even i use the official assert in instrumentation-nginx

Steps to Reproduce

  1. install latest opentelemetry-operator follow on README
  2. apply instrumentation: kubectl apply -f 00-install-instrumentation.yam
  3. add instrumentation annotations to 01-install-app.yaml:
    image
  4. apply 01-install-app.yaml: kubectl apply -f 01-install-app.yaml
  5. access the uri http://localhost:8765

Expected Result

should not print error log

Actual Result

error when initAgent, and couldn't generate spans

...
Error: virtual OTEL_SDK_STATUS_CODE otel::core::ApiUtils::init_boilerplate(): Invalid logging config file: "/opt/opentelemetry-webserver/agent/conf/opentelemetry_sdk_log4cxx.xml"
Error: OTEL_SDK_STATUS_CODE otel::core::WSAgent::init(OTEL_SDK_ENV_RECORD*, unsigned int): Error Code: 8
...

Kubernetes Version

1.27.3

Operator version

0.100.1

Collector version

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

Log output

Defaulted container "myapp" out of: myapp, otel-agent-source-container-clone (init), otel-agent-attach-nginx (init)
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/05/21 13:58:03 [error] 1#1: mod_opentelemetry: ngx_http_opentelemetry_init: Starting Opentelemetry Module init
nginx: [error] mod_opentelemetry: ngx_http_opentelemetry_init: Starting Opentelemetry Module init
2024/05/21 13:58:03 [error] 1#1: mod_opentelemetry: ngx_http_opentelemetry_init: Registering handlers for modules in different phases
nginx: [error] mod_opentelemetry: ngx_http_opentelemetry_init: Registering handlers for modules in different phases
2024/05/21 13:58:03 [error] 1#1: mod_opentelemetry: ngx_http_opentelemetry_init: Opentelemetry Module init completed!
nginx: [error] mod_opentelemetry: ngx_http_opentelemetry_init: Opentelemetry Module init completed!
2024/05/21 13:58:03 [error] 34#34: mod_opentelemetry: ngx_http_opentelemetry_init_worker: Initializing Nginx Worker for process with PID: 34
Error: virtual OTEL_SDK_STATUS_CODE otel::core::ApiUtils::init_boilerplate(): Invalid logging config file: "/opt/opentelemetry-webserver/agent/conf/opentelemetry_sdk_log4cxx.xml"
Error: OTEL_SDK_STATUS_CODE otel::core::WSAgent::init(OTEL_SDK_ENV_RECORD*, unsigned int): Error Code: 8
2024/05/21 14:04:40 [error] 34#34: *2 mod_opentelemetry: ngx_initialize_opentelemetry: Agent Core Init failed, result code is 8, client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:8765", referrer: "http://localhost:8765/"
2024/05/21 14:04:40 [error] 34#34: *2 mod_opentelemetry: startMonitoringRequest: Opentelemetry Agent Core did not get initialized, client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:8765", referrer: "http://localhost:8765/"
2024/05/21 14:04:40 [error] 34#34: *2 mod_opentelemetry: traceConfig:  Config { :(Enabled="1")(OtelExporterEndpoint="http://localhost:4317")(OtelExporterOtlpHeader="")(OtelSslEnabled="0")(OtelSslCertificatePath="")(OtelSpanExporter="otlp")(OtelSpanProcessor="")(OtelSampler="")(ServiceNamespace="default")(ServiceName="my-nginx")(ServiceInstanceId="my-nginx-8667d88689-9s4xb")(OtelMaxQueueSize="4096")(OtelScheduledDelayMillis="5000")(OtelExportTimeoutMillis="30000")(OtelMaxExportBatchSize="512")(ResolveBackends="1")(TraceAsError="1")(ReportAllInstrumentedModules="0")(MaskCookie="0")(MaskSmUser="0")(SegmentType="First")(SegmentParameter="2") }, client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:8765", referrer: "http://localhost:8765/"
Error: virtual OTEL_SDK_STATUS_CODE otel::core::ApiUtils::init_boilerplate(): Invalid logging config file: "/opt/opentelemetry-webserver/agent/conf/opentelemetry_sdk_log4cxx.xml"
Error: OTEL_SDK_STATUS_CODE otel::core::WSAgent::init(OTEL_SDK_ENV_RECORD*, unsigned int): Error Code: 8
2024/05/21 14:04:40 [error] 34#34: *2 mod_opentelemetry: ngx_initialize_opentelemetry: Agent Core Init failed, result code is 8, client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:8765", referrer: "http://localhost:8765/"
2024/05/21 14:04:40 [error] 34#34: *2 mod_opentelemetry: startMonitoringRequest: Opentelemetry Agent Core did not get initialized, client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:8765", referrer: "http://localhost:8765/"
2024/05/21 14:04:40 [error] 34#34: *2 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:8765", referrer: "http://localhost:8765/"
127.0.0.1 - - [21/May/2024:14:04:40 +0000] "GET /favicon.ico HTTP/1.1" 404 555 "http://localhost:8765/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"

Additional context

the default log4cxx xml file should be opentelemetry_sdk_log4cxx.xml instead of appdynamics_sdk_log4cxx.xml

@NicoL49
Copy link
Contributor

NicoL49 commented Jun 18, 2024

Hello,

we have the same problem with apache httpd. I have create a PR for fixing : #3047

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants