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

Agent not reporting HTTP operations from spring app #3426

Open
bradooles opened this issue Dec 4, 2023 · 7 comments
Open

Agent not reporting HTTP operations from spring app #3426

bradooles opened this issue Dec 4, 2023 · 7 comments
Assignees

Comments

@bradooles
Copy link

Expected behavior

Using the application agent, HTTP operations / transactions should appear in azure application insights

Actual behavior

HTTP Operations / transactions do not appear in application insights - other data does such as instance roles, utilisation, dependencies, trace logs etc so I don't believe it is a connection problem. Have tested with versions 3.4.16 and 3.4.18 and both have same issue. Interestingly in the debug logs I can see the http transactions being picked up by the agent (getTransaction and our health checks), they just don't appear in azure application insights.

I've attached some of the debug logs for the agent - let me know if there are specific logs you want us to try and find (or if you need TRACE logging)

System information

Please provide the following information:

  • SDK Version: 3.4.18, 3.4.16
  • OS type and version: Alpine Linux 3.18 on Kubernetes
  • Using spring-boot? Yes - 2.7.14
  • Additional relevant libraries (with version, if applicable): Java 17

Thanks for your time

agent_logs_debug.txt

@heyams heyams self-assigned this Dec 4, 2023
@heyams
Copy link
Contributor

heyams commented Dec 4, 2023

@bradooles I noticed the following:

read environment variable: APPLICATIONINSIGHTS_CONFIGURATION_FILE=**************\
2023-11-29 17:09:13.723+11:00 DEBUG c.m.a.a.i.c.ConfigurationBuilder - configuration: \{"connectionString":"InstrumentationKey=********\'94,\'94selfDiagnostics":\{"destination":"console","level":"DEBUG"\}\}\

can you make sure the connectionString in the log matches what you have in your APPLICATIONINSIGHTS_CONFIGURATION_FILE file?
Logs implied that data did flow to Application Insights. I believe it's a matter of whether you're looking at the right Application Insights resource.

@bradooles
Copy link
Author

Hi @heyams,

Thanks for responding.

I've double checked and we should be looking at the correct resource. I've attached some screens (with some masking) to show that the connection string is the same in the config file as the application insights we are viewing. I've also attached some screens which show our pods are indeed connecting and sending utilisation and dependency data.

There is an additional screen which shows the Operation screen which is empty - I can see the traffic in the logs when I send in a request (as well as regular health checks) but it is not reflected here.

app_insights_portal_main
azure_agent_config_file
dependencies
instance_roles
operations

@trask
Copy link
Member

trask commented Dec 5, 2023

hi @bradooles, I don't see any "Request" telemetry being sent in the debug log you attached. Is your Spring App handling HTTP requests? Does it use Servlets, Netty, or something else for handling HTTP requests? Thanks.

@bradooles
Copy link
Author

Hi @trask the service is setup to use servlet for handling HTTP requests - the 'getTransaction' in the logs is the HTTP GET request for the service. The rest controller is quite basic with just a single GET and POST mappings. You think it's not detecting the request events?
In the logs I could see it find a 'getTransaction' event, so is it a case of it not counting it towards request data?

Let me know if you need any other logging, I can run with TRACE if you need

@trask
Copy link
Member

trask commented Dec 6, 2023

Let me know if you need any other logging, I can run with TRACE if you need

yes this would be helpful, thx

@bradooles
Copy link
Author

TRACE logs attached.
I can see in the logs:
{"baseType":"MetricData","baseData":{"ver":2,"metrics":[{"name":"http_server_requests","value":1522.108629,"count":1,"max":1522.108629}],"properties":{"exception":"None","method":"GET","uri":"/getTransaction","outcome":"SUCCESS","status":"200"}}}}
which is the GET request.

agent_with_trace.txt

@trask
Copy link
Member

trask commented Dec 7, 2023

thanks @bradooles, I'm not seeing anything unusual in the logs (except for the Request telemetry being missing). can you create a repro that we can use to troubleshoot this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants