Skip to content

Setting up elastic apm with nextjs #4348

@sagartalla

Description

@sagartalla

Im trying to integrate elastic APM (https://www.elastic.co/solutions/apm).
When I import elastic-apm-node (https://github.com/elastic/apm-agent-nodejs) package inside my pages/index.js it throws following error.

These dependencies were not found:
* async_hooks in ./node_modules/elastic-apm-node/lib/instrumentation/async-hooks.js
* child_process in ./node_modules/elastic-apm-node/lib/instrumentation/patch-async.js
* dns in ./node_modules/elastic-apm-node/lib/instrumentation/patch-async.js
* module in ./node_modules/require-in-the-middle/index.js
* net in ./node_modules/elastic-apm-node/lib/instrumentation/patch-async.js

When I import elastic-apm-js-base (https://github.com/elastic/apm-agent-js-base) It works but it tracks only on the browser and doesn't track anything running on serverside.

Example Code : https://github.com/sagartalla/elastic-apm-nextjs

  • I have searched the issues of this repository and believe that this is not a duplicate.

Your Environment

Tech Version
next 6.0.1
node 10.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions