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

Warning when calling trackDependency passing data that is not a URL: "The URL object is failed to create" #1171

Open
michaellperry opened this issue Jul 13, 2023 · 1 comment

Comments

@michaellperry
Copy link

When I call trackDependency and pass in a data string value but no target, an extra warning is logged. 'The URL object is failed to create.' The following stack trace is included:

  TypeError [ERR_INVALID_URL]: Invalid URL
      at __node_internal_captureLargerStackTrace (node:internal/errors:478:5)
      at new NodeError (node:internal/errors:387:5)
      at URL.onParseError (node:internal/url:565:9)
      at new URL (node:internal/url:641:5)
      at NodeClient.TelemetryClient.trackDependency (/home/site/wwwroot/node_modules/applicationinsights/Library/TelemetryClient.ts:135:36)

The message is unhelpful. If target is required, then the message should tell me to populate it. I can only infer the meaning of the message after analyzing this code:

https://github.com/microsoft/ApplicationInsights-node.js/blob/a79885cfe51e8900d98cfda7b99442353f9d3c80/Library/TelemetryClient.ts#L134C61-L134C61

@harleyz
Copy link

harleyz commented Nov 25, 2023

this saved me some time. thanks @michaellperry

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

No branches or pull requests

2 participants