Hi all,
I have upgraded to the latest Java agent version 1.24.0 today and I wanted to try the log_ecs_reformatting
feature in our testsystem. It kinda works but it seems to ignore the logback over Slf4j logs:
I have a tomcat container running with different applications which create a total of 14 logfiles(3 Log4j logs, 11 logback over slf4j). The log4j logfiles are perfectly created in my log_ecs_reformatting_dir
directory but the logback logfiles seem to be ignored. The applications are running and transactions are visible in Kibana so it seems the applications are instrumented correctly. Am I missing something or is this a bug in the implementation?
Things that I found interesting in the startup logs(full log and config below):
- ByteBuddy fails to instrument a Spring enhanced class because it seems a pre Java 4 class file but I cannot believe that as we use Spring 4
co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener -[redacted]$$EnhancerBySpringCGLIB$$24f9ad03 uses an unsupported class file version (pre Java 4}) and can't be instrumented. Consider updating to a newer version of that library.
- the circuit breaker always writes out that it "is 12th consecutive measurement that is below the configured relief threshold"
Latest system CPU load value measured is 0.07498741821841973. This is 12th consecutive measurement that is below the configured relief threshold - 0.8
Kibana version: 7.12.1
Elasticsearch version: 7.12.1
APM Server version: 7.12.1
APM Agent language and version: Java 1.24.0
Browser version: Chrome 91
Original install method (e.g. download page, yum, deb, from source, etc.) and version: download page
Fresh install or upgraded from other version? upgraded
**Is there anything special in your setup?
A special case might be that we have both Log4j and Logback within the same tomcat container.
Here is our agent config:
active=true
instrument=true
environment=quality
transaction_sample_rate=1.0
transaction_max_spans=1000
disable_instrumentations=
disable_metrics=
metrics_interval=30s
capture_body=off
capture_headers=true
log_ecs_reformatting_dir=/home/tomcat/tomcat-1.3/tomcat-axis2/logs/elastic
log_ecs_reformatting=SHADE
log_file_size=50MB
log_level=INFO
log_file=_AGENT_HOME_/elastic-apm.log
enable_log_correlation=true
secret_token=[redacted]
server_urls=https://[redacted]:8200
verify_server_cert=true
flush_interval=1s
max_queue_size=1024
application_packages=[redacted]
stack_trace_limit=50
trace_methods=
span_frames_min_duration=5ms
trace_methods_duration_threshold=5ms
use_path_as_transaction_name=true
global_labels=team=[redacted]
circuit_breaker_enabled=true
capture_jmx_metrics=object_name[Catalina:type=ThreadPool,name=*] attribute[connectionCount] attribute[currentThreadCount] attribute[currentThreadsBusy] attribute[maxConnections] attribute[maxThreads] attribute[poolSize], object_name[Catalina:type=Executor,name=*] attribute[activeCount] attribute[maxThreads] attribute[poolSize], object_name[Catalina:type=GlobalRequestProcessor,name=*] attribute[bytesSent] attribute[bytesReceived] attribute[errorCount] attribute[maxTime] attribute[requestCount] object_name[Catalina:type=Manager,context=*,host=*] attribute[activeSessions] attribute[sessionCounter] attribute[expiredSessions]
Errors in browser console (if relevant): n/a
Provide logs and/or server output (if relevant):
2021-06-21 13:10:36,582 [main] INFO co.elastic.apm.agent.util.JmxUtils - Found JVM-specific OperatingSystemMXBean interface: com.sun.management.OperatingSystemMXBean
2021-06-21 13:10:36,584 [main] WARN co.elastic.apm.agent.metrics.builtin.CGroupMetrics - No /proc/self/cgroup file line matched the tested patterns. Cgroup metrics will not be reported.
2021-06-21 13:10:36,630 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.24.0 as tomcat-application on Java 11.0.4 Runtime version: 11.0.4+11-LTS VM version: 11.0.4+11-LTS (Amazon.com Inc.) Linux 2.6.32-754.39.1.el6.x86_64
2021-06-21 13:10:36,631 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - environment: 'quality' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,631 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - transaction_sample_rate: '1' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,631 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - transaction_max_spans: '1000' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,631 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - disable_instrumentations: '' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,632 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - capture_body: 'OFF' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,632 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - global_labels: 'team= [redacted]' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,632 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - trace_methods_duration_threshold: '5ms' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,632 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - secret_token: 'XXXX' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,632 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - server_urls: 'https://[redacted]:8200' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,632 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - max_queue_size: '1024' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,633 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - application_packages: '[redacted]' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,633 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - log_file: '_AGENT_HOME_/elastic-apm.log' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,633 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - enable_log_correlation: 'true' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,633 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - log_ecs_reformatting: 'SHADE' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,633 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - log_ecs_reformatting_dir: '/home/tomcat/tomcat-1.3/tomcat-axis2/logs/elastic' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,633 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - log_file_size: '50mb' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,633 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - use_path_as_transaction_name: 'true' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,634 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - circuit_breaker_enabled: 'true' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:36,634 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - capture_jmx_metrics: 'object_name[Catalina:type=ThreadPool,name=*] attribute[connectionCount] attribute[currentThreadCount] attribute[currentThreadsBusy] attribute[maxConnections] attribute[maxThreads] attribute[poolSize], object_name[Catalina:type=Executor,name=*] attribute[activeCount] attribute[maxThreads] attribute[poolSize], object_name[Catalina:type=GlobalRequestProcessor,name=*] attribute[bytesSent] attribute[bytesReceived] attribute[errorCount] attribute[maxTime] attribute[requestCount] attribute[activeSessions] attribute[sessionCounter] attribute[expiredSessions]' (source: /home/tomcat/apm-agent/elasticapm.properties)
2021-06-21 13:10:37,935 [main] INFO co.elastic.apm.agent.impl.ElasticApmTracer - Tracer switched to RUNNING state
2021-06-21 13:10:38,587 [elastic-apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server is available: { "build_date": "2021-04-20T19:55:39Z", "build_sha": "32f34ed4298d648bf9476790f2a8a54d72805bb6", "version": "7.12.1"}
2021-06-21 13:10:38,837 [elastic-apm-remote-config-poller] INFO co.elastic.apm.agent.configuration.ApmServerConfigurationSource - Received new configuration from APM Server: {}
2021-06-21 13:10:52,041 [localhost-startStop-1] INFO co.elastic.apm.agent.servlet.ServletVersionInstrumentation - Servlet container info = tomcat
2021-06-21 13:11:31,747 [localhost-startStop-4] WARN co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener -[redacted]$$EnhancerBySpringCGLIB$$24f9ad03 uses an unsupported class file version (pre Java 4}) and can't be instrumented. Consider updating to a newer version of that library.
2021-06-21 13:12:42,799 [elastic-apm-circuit-breaker] INFO co.elastic.apm.agent.impl.circuitbreaker.SystemCpuStressMonitor - Latest system CPU load value measured is 0.07498741821841973. This is 12th consecutive measurement that is below the configured relief threshold - 0.8
2021-06-21 13:14:07,804 [elastic-apm-circuit-breaker] INFO co.elastic.apm.agent.impl.circuitbreaker.SystemCpuStressMonitor - Latest system CPU load value measured is 0.6666666666666666. This is 12th consecutive measurement that is below the configured relief threshold - 0.8
2021-06-21 13:16:37,814 [elastic-apm-circuit-breaker] INFO co.elastic.apm.agent.impl.circuitbreaker.SystemCpuStressMonitor - Latest system CPU load value measured is 0.14285714285714285. This is 12th consecutive measurement that is below the configured relief threshold - 0.8
2021-06-21 13:20:37,830 [elastic-apm-circuit-breaker] INFO co.elastic.apm.agent.impl.circuitbreaker.SystemCpuStressMonitor - Latest system CPU load value measured is 0.08333333333333333. This is 12th consecutive measurement that is below the configured relief threshold - 0.8
Best regards
Wolfram