elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.72k stars 8.13k forks source link

Elastic apm transaction page Maximum call stack size exceeded #177819

Closed Merlijnv closed 6 months ago

Merlijnv commented 6 months ago

Kibana version: 8.12.2

Elasticsearch version: 8.12.2

Server OS version: Kubernetes op Azure Linux nodes

Original install method (e.g. download page, yum, from source, etc.): ECK Operator

Describe the bug: We are using APM Server on the cluster, and in our .NET applications, we have an APM agent with withElasticApmCorrelationId. We expect the APM page of a transaction to show correlation between services. However, when it involves multiple services, it breaks, and we receive the following error:

elasticapmstacktrace.txt

Steps to reproduce:

run elastic apm agent on .net core using Elastic.Apm.AspNetCore and Elastic.Apm.Azure.Servicebus with withElasticApmCorrelationId run elastic apm server on kubernetes run elastic kibana on kubernetes run elastic elasticsearch on kubernetes send a message to servicebus and let it be processed by .net core application check the apm page in kibana

Expected behavior:

The APM page should show correlation between services

Screenshots: image

Errors in browser console:

view:286 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'report-sample' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.

bootstrap.js:42 ^ A single error about an inline script not firing due to content security policy is expected!
kbn-ui-shared-deps-npm.dll.js:1180 You are currently using minified code outside of NODE_ENV === "production". This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) to ensure you have the correct code for your production build.
(anonymous) @ kbn-ui-shared-deps-npm.dll.js:1180
6kbn-ui-shared-deps-npm.dll.js:351 EuiButtonIcon requires aria-label or aria-labelledby to be specified because icon-only
      buttons are screen-reader-inaccessible without them.
v @ kbn-ui-shared-deps-npm.dll.js:351
kbn-ui-shared-deps-npm.dll.js:425 RangeError: Maximum call stack size exceeded
    at t (apm.chunk.5.js:337:593)
    at apm.chunk.5.js:337:659
    at Array.forEach (<anonymous>)
    at t (apm.chunk.5.js:337:646)
    at apm.chunk.5.js:337:659
    at Array.forEach (<anonymous>)
    at t (apm.chunk.5.js:337:646)
    at apm.chunk.5.js:337:659
    at Array.forEach (<anonymous>)
    at t (apm.chunk.5.js:337:646)

Provide logs and/or server output:

apm server: apmserverlogs.txt

Any additional context:

Elastic.Apm.aspnetcore version: 1.26.0 It seems similar to GitHub issue: https://github.com/elastic/kibana/issues/160355

elasticmachine commented 6 months ago

Pinging @elastic/apm-ui (Team:APM)

elasticmachine commented 6 months ago

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

lufa12 commented 6 months ago

We have the same problem. When we capture a transaction that uses azureservicebus.

I rollback to a previous version of the nuget Elastic.Apm.NetCoreAll package (1.23.0) and it works fine.

cauemarcondes commented 6 months ago

Hi @Merlijnv , I wonder if you could send the HAR file?

I take a look at the APIs response and simulate it locally.

@lufa12 , same for you, if you can send me a HAR file.

Merlijnv commented 6 months ago

@cauemarcondes do you have instructions on how to?

cauemarcondes commented 6 months ago

Here are the instructions:

Firefox: To export a HAR (HTTP Archive) file in Firefox, you can follow these steps:

Open the Developer Tools:
    Press F12 on your keyboard or right-click on the webpage and select "Inspect Element".

Navigate to the Network tab:
    In the Developer Tools panel, locate the "Network" tab.

Enable network recording:
    Click on the "Network" tab to open it if it's not already open.
    Check the box labeled "Persist Logs" to make sure that network requests are recorded even after a page reload.

Record the network activity:
    Refresh the webpage or perform the actions you want to record.

Export the HAR file:
    Right-click anywhere within the network requests list.
    Select "Save All As HAR" or "Save All As HAR with Content" depending on whether you want to include content (like images, scripts, etc.) in the HAR file or not.
    Choose the location on your computer where you want to save the HAR file and provide a name for it.
    Click "Save".

Chrome: To export a HAR (HTTP Archive) file in Chrome, you can follow these steps:

Open Developer Tools:
    Press F12 on your keyboard or right-click on the webpage and select "Inspect" or "Inspect Element".

Navigate to the Network tab:
    In the Developer Tools panel, locate the "Network" tab.

Start recording:
    Ensure that the "Network" tab is selected.
    Click the "Record" button (a red circle) or press Ctrl + E to start recording network activity.

Perform the actions you want to record:
    Navigate through the website or perform any actions you want to capture in the HAR file.

Stop recording:
    Once you've captured the necessary network activity, click the "Stop" button (a red circle) in the Network tab or press Ctrl + E again to stop recording.

Export the HAR file:
    Right-click anywhere within the list of network requests.
    Select "Save as HAR with Content" or "Save all as HAR with Content" if you want to include content such as images, scripts, etc., in the HAR file.
    Choose the location on your computer where you want to save the HAR file and provide a name for it.
    Click "Save".
Merlijnv commented 6 months ago

@cauemarcondes you have an email I can send it to?

cauemarcondes commented 6 months ago

@Merlijnv would it be ok with you to join Elastic community Slack? We can have a private conversation there.

cauemarcondes commented 6 months ago

Hey @Merlijnv I was debugging your problem and I've already fixed it on this PR. I could simulate the problem on the version you are, and after running version 8.13 the problem was gone.

cauemarcondes commented 6 months ago

@lufa12 the same fix applies to your problem.

cauemarcondes commented 6 months ago

I'm closing this issue for now. A solution is already in place on version 8.13. If the problem persists after upgrading, please feel free to open it again.