Giter VIP home page Giter VIP logo

Comments (12)

felixbarny avatar felixbarny commented on June 4, 2024

Hi and thanks for trying out the agent!

Please add logging.level.co.elastic.apm=DEBUG in application.properties and look out for logs of co.elastic.apm, wich may be truncated to c.e.a..

Could you also post your docker (compose) configuration?

from apm-agent-java.

seanlee10 avatar seanlee10 commented on June 4, 2024
2018-06-26 11:00:34,175 DEBUG [][Thread-5][][co.elastic.apm.bci.ElasticApmAgent] Type match for advice ServletInstrumentation: ((not(isInterface()) and name(contains(Servlet))) and hasSuperType(erasure(name(equals(javax.servlet.http.HttpServlet))))) matches class org.springframework.web.servlet.DispatcherServlet
2018-06-26 11:00:34,362 DEBUG [][Thread-5][][co.elastic.apm.bci.ElasticApmAgent] Type match for advice ServletInstrumentation: ((not(isInterface()) and name(contains(Servlet))) and hasSuperType(erasure(name(equals(javax.servlet.http.HttpServlet))))) matches class org.springframework.web.servlet.FrameworkServlet
2018-06-26 11:00:34,394 DEBUG [][Thread-5][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice ServletInstrumentation: ((name(equals(service)) and hasParameter(hasTypes(with(0 matches erasure(name(equals(javax.servlet.http.HttpServletRequest))))))) and hasParameter(hasTypes(with(1 matches erasure(name(equals(javax.servlet.http.HttpServletResponse))))))) matches protected void org.springframework.web.servlet.FrameworkServlet.service(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws javax.servlet.ServletException,java.io.IOException
2018-06-26 11:00:34,457 DEBUG [][Thread-5][][co.elastic.apm.bci.ElasticApmAgent] Type match for advice ServletInstrumentation: ((not(isInterface()) and name(contains(Servlet))) and hasSuperType(erasure(name(equals(javax.servlet.http.HttpServlet))))) matches class org.springframework.web.servlet.HttpServletBean
2018-06-26 11:00:34,465 DEBUG [][Thread-5][][co.elastic.apm.bci.ElasticApmAgent] Type match for advice ServletInstrumentation: ((not(isInterface()) and name(contains(Servlet))) and hasSuperType(erasure(name(equals(javax.servlet.http.HttpServlet))))) matches class javax.servlet.http.HttpServlet
2018-06-26 11:00:34,480 DEBUG [][Thread-5][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice ServletInstrumentation: ((name(equals(service)) and hasParameter(hasTypes(with(0 matches erasure(name(equals(javax.servlet.http.HttpServletRequest))))))) and hasParameter(hasTypes(with(1 matches erasure(name(equals(javax.servlet.http.HttpServletResponse))))))) matches protected void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws javax.servlet.ServletException,java.io.IOException
2018-06-26 11:00:35,394 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Type match for advice SpringTransactionNameInstrumentation: ((not(isInterface()) and name(startsWith(org.springframework.web.servlet))) and hasSuperType(erasure(name(equals(org.springframework.web.servlet.HandlerAdapter))))) matches class org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
2018-06-26 11:00:35,428 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Type match for advice SpringTransactionNameInstrumentation: ((not(isInterface()) and name(startsWith(org.springframework.web.servlet))) and hasSuperType(erasure(name(equals(org.springframework.web.servlet.HandlerAdapter))))) matches class org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter
2018-06-26 11:00:35,436 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice SpringTransactionNameInstrumentation: ((((name(equals(handle)) and returns(erasure(name(equals(org.springframework.web.servlet.ModelAndView))))) and hasParameter(hasTypes(with(0 matches erasure(name(equals(javax.servlet.http.HttpServletRequest))))))) and hasParameter(hasTypes(with(1 matches erasure(name(equals(javax.servlet.http.HttpServletResponse))))))) and hasParameter(hasTypes(with(2 matches erasure(is(class java.lang.Object)))))) matches public final org.springframework.web.servlet.ModelAndView org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Object) throws java.lang.Exception
2018-06-26 11:00:35,471 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Type match for advice SpringTransactionNameInstrumentation: ((not(isInterface()) and name(startsWith(org.springframework.web.servlet))) and hasSuperType(erasure(name(equals(org.springframework.web.servlet.HandlerAdapter))))) matches class org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter
2018-06-26 11:00:35,476 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice SpringTransactionNameInstrumentation: ((((name(equals(handle)) and returns(erasure(name(equals(org.springframework.web.servlet.ModelAndView))))) and hasParameter(hasTypes(with(0 matches erasure(name(equals(javax.servlet.http.HttpServletRequest))))))) and hasParameter(hasTypes(with(1 matches erasure(name(equals(javax.servlet.http.HttpServletResponse))))))) and hasParameter(hasTypes(with(2 matches erasure(is(class java.lang.Object)))))) matches public org.springframework.web.servlet.ModelAndView org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Object) throws java.lang.Exception
2018-06-26 11:00:35,478 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Type match for advice SpringTransactionNameInstrumentation: ((not(isInterface()) and name(startsWith(org.springframework.web.servlet))) and hasSuperType(erasure(name(equals(org.springframework.web.servlet.HandlerAdapter))))) matches class org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter
2018-06-26 11:00:35,482 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice SpringTransactionNameInstrumentation: ((((name(equals(handle)) and returns(erasure(name(equals(org.springframework.web.servlet.ModelAndView))))) and hasParameter(hasTypes(with(0 matches erasure(name(equals(javax.servlet.http.HttpServletRequest))))))) and hasParameter(hasTypes(with(1 matches erasure(name(equals(javax.servlet.http.HttpServletResponse))))))) and hasParameter(hasTypes(with(2 matches erasure(is(class java.lang.Object)))))) matches public org.springframework.web.servlet.ModelAndView org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Object) throws java.lang.Exception
2018-06-26 11:00:37,838 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Type match for advice ConnectionInstrumentation: ((not(isInterface()) and name(contains(Connection))) and isSubTypeOf(interface java.sql.Connection)) matches class com.microsoft.sqlserver.jdbc.SQLServerConnection
2018-06-26 11:00:37,875 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice ConnectionInstrumentation: (((name(startsWith(prepare)) and isPublic()) and returns(erasure(isSubTypeOf(interface java.sql.PreparedStatement)))) and hasParameter(hasTypes(with(0 matches erasure(is(class java.lang.String)))))) matches public java.sql.CallableStatement com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareCall(java.lang.String) throws com.microsoft.sqlserver.jdbc.SQLServerException
2018-06-26 11:00:37,876 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice ConnectionInstrumentation: (((name(startsWith(prepare)) and isPublic()) and returns(erasure(isSubTypeOf(interface java.sql.PreparedStatement)))) and hasParameter(hasTypes(with(0 matches erasure(is(class java.lang.String)))))) matches public java.sql.PreparedStatement com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(java.lang.String,int,int) throws com.microsoft.sqlserver.jdbc.SQLServerException
2018-06-26 11:00:37,878 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice ConnectionInstrumentation: (((name(startsWith(prepare)) and isPublic()) and returns(erasure(isSubTypeOf(interface java.sql.PreparedStatement)))) and hasParameter(hasTypes(with(0 matches erasure(is(class java.lang.String)))))) matches public java.sql.CallableStatement com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareCall(java.lang.String,int,int) throws com.microsoft.sqlserver.jdbc.SQLServerException
2018-06-26 11:00:37,879 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice ConnectionInstrumentation: (((name(startsWith(prepare)) and isPublic()) and returns(erasure(isSubTypeOf(interface java.sql.PreparedStatement)))) and hasParameter(hasTypes(with(0 matches erasure(is(class java.lang.String)))))) matches public java.sql.PreparedStatement com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(java.lang.String,int,int,int) throws com.microsoft.sqlserver.jdbc.SQLServerException
2018-06-26 11:00:37,881 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice ConnectionInstrumentation: (((name(startsWith(prepare)) and isPublic()) and returns(erasure(isSubTypeOf(interface java.sql.PreparedStatement)))) and hasParameter(hasTypes(with(0 matches erasure(is(class java.lang.String)))))) matches public java.sql.PreparedStatement com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(java.lang.String,int,int,int,com.microsoft.sqlserver.jdbc.SQLServerStatementColumnEncryptionSetting) throws com.microsoft.sqlserver.jdbc.SQLServerException
2018-06-26 11:00:37,882 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Method match for advice ConnectionInstrumentation: (((name(startsWith(prepare)) and isPublic()) and returns(erasure(isSubTypeOf(interface java.sql.PreparedStatement)))) and hasParameter(hasTypes(with(0 matches erasure(is(class java.lang.String)))))) matches public java.sql.CallableStatement com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareCall(java.lang.String,int,int,int) throws com.microsoft.sqlserver.jdbc.SQLServerException
2018-06-26 11:00:37,899 DEBUG [][main][][co.elastic.apm.bci.ElasticApmAgent] Type match for advice ConnectionInstrumentation: ((not(isInterface()) and name(contains(Connection))) and isSubTypeOf(interface java.sql.Connection)) matches class com.microsoft.sqlserver.jdbc.SQLServerConnection43
2018-06-26 11:00:37,905 WARN [][main][][co.elastic.apm.bci.bytebuddy.ErrorLoggingListener] ERROR on transformation com.microsoft.sqlserver.jdbc.SQLServerConnection43

Thank you @felixbarny, it definitely provides more useful insight.
and here's how I run this docker image.

docker run --name <app-name> \
  --link apm-server:apm-server \
  -d <image-name>:<image-tag> \
   java -javaagent:/elastic-apm-agent-0.5.1.jar \
  -Delastic.apm.service_name=<app-name> \
  -Delastic.apm.application_packages=<app-package> \
  -Delastic.apm.server_url=http://apm-server:8200 \
  -jar <app-name>.jar

from apm-agent-java.

felixbarny avatar felixbarny commented on June 4, 2024

This line is interesting, although probably not related to the problem that no data is sent:

2018-06-26 11:00:37,905 WARN [][main][][co.elastic.apm.bci.bytebuddy.ErrorLoggingListener] ERROR on transformation com.microsoft.sqlserver.jdbc.SQLServerConnection43

Which version of MS SQL Server and which JDBC driver and version are you using?

Can you see any logs related to elastic apm after you perform a request against your application?

from apm-agent-java.

seanlee10 avatar seanlee10 commented on June 4, 2024

Thank you @felixbarny for being patient. Here's the information I see in the log.

MS SQL Server Version: SQL Server 2012 with SP1 (version 11.0.3)
JDBC Driver & Version: sqljdbc42-6.0.8112.100.jar

2018-06-26 13:23:13,980 DEBUG [][http-nio-8080-exec-9][][co.elastic.apm.impl.ElasticApmTracer] startSpan '' 29e68495a71346a4e3579cece6b69a16:1
2018-06-26 13:23:13,981 DEBUG [][http-nio-8080-exec-9][][co.elastic.apm.impl.ElasticApmTracer] } endSpan 'SELECT' 29e68495a71346a4e3579cece6b69a16:1
2018-06-26 13:23:13,984 DEBUG [][http-nio-8080-exec-9][][co.elastic.apm.impl.ElasticApmTracer] startSpan '' 29e68495a71346a4e3579cece6b69a16:2
2018-06-26 13:23:13,988 DEBUG [][http-nio-8080-exec-9][][co.elastic.apm.impl.ElasticApmTracer] } endSpan 'INSERT' 29e68495a71346a4e3579cece6b69a16:2
2018-06-26 13:23:13,997 DEBUG [][http-nio-8080-exec-9][][co.elastic.apm.impl.ElasticApmTracer] } endTransaction '<controller-name1>#<method-name1>' 29e68495a71346a4e3579cece6b69a16
2018-06-26 13:23:14,024 DEBUG [][http-nio-8080-exec-3][][co.elastic.apm.impl.ElasticApmTracer] startTransaction '' ebb8bba96bc2450284bab5f93469f488
2018-06-26 13:23:14,037 DEBUG [][http-nio-8080-exec-3][][co.elastic.apm.impl.ElasticApmTracer] startSpan '' ebb8bba96bc2450284bab5f93469f488:1
2018-06-26 13:23:14,040 DEBUG [][http-nio-8080-exec-3][][co.elastic.apm.impl.ElasticApmTracer] } endSpan 'SELECT' ebb8bba96bc2450284bab5f93469f488:1
2018-06-26 13:23:14,058 DEBUG [][http-nio-8080-exec-3][][co.elastic.apm.impl.ElasticApmTracer] startSpan '' ebb8bba96bc2450284bab5f93469f488:2
2018-06-26 13:23:14,076 DEBUG [][http-nio-8080-exec-3][][co.elastic.apm.impl.ElasticApmTracer] } endSpan 'SELECT' ebb8bba96bc2450284bab5f93469f488:2
2018-06-26 13:23:14,216 DEBUG [][http-nio-8080-exec-3][][co.elastic.apm.impl.ElasticApmTracer] startSpan '' ebb8bba96bc2450284bab5f93469f488:3
2018-06-26 13:23:14,220 DEBUG [][http-nio-8080-exec-3][][co.elastic.apm.impl.ElasticApmTracer] } endSpan 'INSERT' ebb8bba96bc2450284bab5f93469f488:3
2018-06-26 13:23:14,268 DEBUG [][http-nio-8080-exec-3][][co.elastic.apm.impl.ElasticApmTracer] } endSpan 'SELECT' ebb8bba96bc2450284bab5f93469f488:4
2018-06-26 13:23:14,348 DEBUG [][http-nio-8080-exec-3][][co.elastic.apm.impl.ElasticApmTracer] } endTransaction '<controller-name2>#<method-name2>' ebb8bba96bc2450284bab5f93469f488
2018-06-26 13:23:14,690 DEBUG [][apm-reporter][][co.elastic.apm.report.ApmServerHttpPayloadSender] Sending payload with 2 elements to APM server http://apm-server:8200
	at co.elastic.apm.shaded.okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:240)
	at co.elastic.apm.shaded.okhttp3.internal.connection.RealConnection.connect(RealConnection.java:158)
2018-06-26 13:23:14,692 DEBUG [][apm-reporter][][co.elastic.apm.report.ApmServerHttpPayloadSender] Sending payload to APM server failed
	at co.elastic.apm.shaded.okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:113)
	at co.elastic.apm.shaded.okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
	at co.elastic.apm.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at co.elastic.apm.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at co.elastic.apm.shaded.okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:256)
	at co.elastic.apm.shaded.okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:134)
	at co.elastic.apm.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at co.elastic.apm.shaded.okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at co.elastic.apm.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at co.elastic.apm.shaded.okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
	at co.elastic.apm.shaded.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
	at co.elastic.apm.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at co.elastic.apm.report.ReportingEventHandler.flush(ReportingEventHandler.java:84)
	at co.elastic.apm.shaded.okhttp3.RealCall.execute(RealCall.java:77)
	at co.elastic.apm.shaded.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
	at co.elastic.apm.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at co.elastic.apm.shaded.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at co.elastic.apm.report.ApmServerHttpPayloadSender.sendPayload(ApmServerHttpPayloadSender.java:98)
	at co.elastic.apm.shaded.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:137)
	at co.elastic.apm.report.ReportingEventHandler.onEvent(ReportingEventHandler.java:55)
	at co.elastic.apm.report.ReportingEventHandler.onEvent(ReportingEventHandler.java:37)
	at co.elastic.apm.shaded.okhttp3.internal.platform.Platform.connectSocket(Platform.java:125)
	at co.elastic.apm.shaded.okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:238)

from apm-agent-java.

felixbarny avatar felixbarny commented on June 4, 2024

Seems like the agent ist working but the connection to the apm server is not.

It also seems there is at least one line missing after

Sending payload to APM server failed

There should be the exception class and message.

If your container supports it, can you try to curl the apm server from it?

How do you start the apm server? Do you expose the port 8200?

from apm-agent-java.

seanlee10 avatar seanlee10 commented on June 4, 2024

Hi @felixbarny, So I get this Exception from the log

Caused by: java.net.ConnectException: Connection refused (Connection refused)

And here's what I get when I curl from the container with apm-agent running in it.

/ # curl "http://127.0.0.1:8200"
curl: (7) Failed to connect to 127.0.0.1 port 8200: Connection refused
/ # curl "http://0.0.0.0:8200"
curl: (7) Failed to connect to 0.0.0.0 port 8200: Connection refused
/ # curl "http://localhost:8200"
curl: (7) Failed to connect to localhost port 8200: Connection refused
/ # curl "http://172.18.0.4:8200"
404 page not found

apm server is running on the same host as the apm agent and of course port 8200 is exposed.

These two containers share a same network.

#APM Server
docker run --name apm-server --network apm -p 8200:8200 -dt docker.elastic.co/apm/apm-server:6.3.0

#APM Agent
docker run --name apm-agent --network apm -p 8080:8080 -dt <app-image:tag> \
java -javaagent:/elastic-apm-agent-0.5.1.jar \
  -Delastic.apm.service_name=<app-name> \
  -Delastic.apm.application_packages=<app-package> \
  -Delastic.apm.server_url=http://apm-server:8200 \
  -jar <app-name>.jar

Lastly, here's what's in apm-server.yml, which is straight from the image and not modified by me

################### APM Server Configuration #########################

############################# APM Server ######################################

apm-server:

  # Defines the host and port the server is listening on
  host: "0.0.0.0:8200"

  # Please be aware that frontend support is an experimental feature at the moment!
  frontend:
    # To enable experimental frontend support set this to true.
    enabled: false

  # Authorization token to be checked. If a token is set here the agents must
  # send their token in the following format: Authorization: Bearer <secret-token>.
  # It is recommended to use an authorization token in combination with SSL enabled.
  #secret_token:
  #ssl.enabled: false
  #ssl.certificate : "path/to/cert"
  #ssl.key : "path/to/private_key"

  #ssl.enabled: false
  #ssl.certificate : "path/to/cert"
  #ssl.key : "path/to/private_key"

#==================== Elasticsearch template setting ==========================

# Elasticsearch template settings
setup.template.settings:

  # A dictionary of settings to place into the settings.index dictionary
  # of the Elasticsearch template. For more details, please check
  # https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html
  index:
    number_of_shards: 1
    codec: best_compression
    #number_of_routing_shards: 30

#============================== Dashboards =====================================
#
# These settings control loading the sample dashboards to the Kibana index. Loading
# the dashboards is disabled by default and can be enabled either by setting the
# options here, or by using the `-setup` CLI flag or the `setup` command.
#setup.dashboards.enabled: false

#============================== Kibana =====================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  #host: "localhost:5601"

#================================ Outputs =====================================

# Configure what output to use when sending the data collected by the beat.

#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  hosts: ["elasticsearch:9200"]

  # By using the configuration below, apm documents are stored to separate indices, 
  # depending on their `processor.event`:
  # - error
  # - transaction
  # - span
  # - sourcemap (experimental feature)
  #
  # The indices are all prefixed with `apm-%{[beat.version]}`.
  # To allow managing indices based on their age, all indices (except for sourcemaps) 
  # end with the information of the day they got indexed.
  # e.g. "apm-6.3.0-transaction-2018.03.20"
  #
  # Be aware that you can only specify one Elasticsearch template and one Kibana Index Pattern,
  # In case you modify the index patterns you must also update those configurations accordingly, 
  # as they need to be aligned:
  # * `setup.template.name`
  # * `setup.template.pattern`
  # * `setup.dashboards.index`
  indices:
    - index: "apm-%{[beat.version]}-sourcemap"
      when.contains:
        processor.event: "sourcemap"

    - index: "apm-%{[beat.version]}-error-%{+yyyy.MM.dd}"
      when.contains:
        processor.event: "error"

    - index: "apm-%{[beat.version]}-transaction-%{+yyyy.MM.dd}"
      when.contains:
        processor.event: "transaction"

    - index: "apm-%{[beat.version]}-span-%{+yyyy.MM.dd}"
      when.contains:
        processor.event: "span"

  # Optional protocol and basic auth credentials.
  #protocol: "https"
  #username: "elastic"
  #password: "changeme"

#================================ Logging =====================================

# Sets log level. The default log level is info.
# Available log levels are: error, warning, info, debug
#logging.level: debug

# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publish", "service".
#logging.selectors: ["*"]

from apm-agent-java.

felixbarny avatar felixbarny commented on June 4, 2024

Can you curl the apm server from your local machine?

It should look like:

$ curl localhost:8200                                                                                                                                                                                                                  
404 page not found

Can you look into the docker logs of the apm server?

from apm-agent-java.

seanlee10 avatar seanlee10 commented on June 4, 2024

I just learned that it was company firewall that blocked the connection to apm-server from apm-agent. so when a payload is being sent via http protocal, instead of hitting apm-server container within the same custom docker network directly, the agent tried to resolve the domain from the internet and that's where I got connection refused. I now see the apm data in kibana just fine. Thank you very much for identifying the source of the problem. @felixbarny you are a hero!

from apm-agent-java.

felixbarny avatar felixbarny commented on June 4, 2024

That's great to hear!

Did everything else work as expected? Anything in particular you like or dislike about the agent?

from apm-agent-java.

seanlee10 avatar seanlee10 commented on June 4, 2024

Once the network issue is gone, everything worked as expected. I really like the automatic span detection. I didn't have write anything in the application yet the agent picks up necessary information and delivers them nicely. Really helpful in "application performance monitoring"

I tried zipkin before but apm-server/apm-agent are way more user friendly. Just would like some improvements on the documentation though. For example, I had some hard time figuring out starting the agent because I followed the code in the getting started,

java -jar my-spring-boot-application.jar -javaagent:/path/to/elastic-apm-agent-<version>.jar

and later I found that you need to specify -javaagent:/path/to/elastic-apm-agent-<version>.jar part before -jar <my-app>.jar

So in my case, the agent runs correctly after switching the position of the -javaagent part.

java -javaagent:/path/to/elastic-apm-agent-<version>.jar -jar my-spring-boot-application.jar

so simple things like this can really improve the experience. Other than this, I am very happy with the product. real good job!

from apm-agent-java.

felixbarny avatar felixbarny commented on June 4, 2024

Thanks for spotting this silly error in the docs, it's fixed now.

Any more things that were unclear in the documentation?

from apm-agent-java.

seanlee10 avatar seanlee10 commented on June 4, 2024

I have nothing to add to the documentation.
the documentation is easy to read and follow as is.
And thank you for making changes in the docs.

from apm-agent-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.