elastic / apm

Elastic Application Performance Monitoring - resources and general issue tracking for Elastic APM.
https://www.elastic.co/apm
Apache License 2.0
374 stars 111 forks source link

Source maps uploaded successfully, but not used in stacktrace. #866

Open ivanushkaPr opened 3 months ago

ivanushkaPr commented 3 months ago

Describe the bug Source maps uploaded successfully, but not applied to observed project stacktrace.

To Reproduce

  1. Install "@elastic/apm-rum-vue": "^2.1.2".
  2. Configure vue.cli.config. const serviceVersion = require("./package.json").version; const TerserPlugin = require("terser-webpack-plugin");
    module.exports = {
    configureWebpack: {
        devtool: 'source-map',
        devServer: {
            host: YourHostName,
        },
        optimization: {
            chunkIds: 'named',
            minimize: true,
            minimizer: [new TerserPlugin(
                {
                    sourceMap: true,
                },
            )],
        },
    },
    chainWebpack: config => {
        config.plugin('define').tap(args => {
            args[0].serviceVersion = JSON.stringify(serviceVersion);
            return args
        })
    },
    }
  3. Add plugin to vue project and add configuration.
import { ApmVuePlugin } from "@elastic/apm-rum-vue";
import apmRumDefaultConfig from "@/config/apm-rum-default-config";

Vue.use(ApmVuePlugin, {
    router,
    config: {
        active: true,
        serviceName: 'your-service-name',
        serviceVersion: '1.0.0',
        serverUrl: 'https://youServerUrl.com',
        serverUrlPrefix: '',
        environment: 'test',
    },
});
  1. Upload source maps and check their availability.
  2. Execute error in project.
  3. As result, no source maps available in stack trace and error showed in minified format.

Debug logs Attach your debug logs. See the documentation about how to enable debug logging.

I read documentation, but i dont find any clue, about how can i check that my sourcemaps are used for my project? Is there any api, that can help me with this? Or is there any api call in network tab, there i can found any clue about why uploaded maps doesnt used in stacktrace? It looks like all is perfectly fine at first glance, because webpack not throwing any errors. And all source map are successfully uploaded to endpoint. Plz help me, because i dont know how to solve this problem, without a debug log. There i can find any clues about what happening in the kibana, then i open up stacktrace and how sourcemaps being used by it?
simitt commented 3 months ago

Hi @ivanushkaPr, sorry to hear that you are experiencing issues with sourcemaps. We like to keep the github repos for confirmed bugs and enhancements and discuss problems and feedback on missing documentation etc in the elastic apm discuss forum. Would you please open an issue there, best to tag it with rum and server, and also include the apm-server version and share any helpful indicators from the apm-server logs if available.