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

[Hapi Plugin] Hapi instrumentation plugins wrapping issue #218

Closed
jk1z opened this issue Oct 12, 2020 · 2 comments
Closed

[Hapi Plugin] Hapi instrumentation plugins wrapping issue #218

jk1z opened this issue Oct 12, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@jk1z
Copy link
Contributor

jk1z commented Oct 12, 2020

What version of OpenTelemetry are you using?

"@opentelemetry/core": "^0.11.0",
"@opentelemetry/exporter-jaeger": "^0.11.0",
"@opentelemetry/hapi-instrumentation": "^0.10.0",
"@opentelemetry/node": "^0.11.0",
"@opentelemetry/plugin-http": "^0.11.0",
"@opentelemetry/plugin-https": "^0.11.0",
"@opentelemetry/plugin-mongodb": "^0.10.0",
"@opentelemetry/plugin-redis": "^0.10.0",
"@opentelemetry/tracing": "^0.11.0",

What version of Node are you using?

v14.2.0

What did you do?

In @Hapi version 19.1.1, when I'm trying to use server.register([{plugin: require("./plugin-a")}, require("./plugin-b")}]) while hapi-instrumentation is on. I'm getting Cannot read property 'name' of undefined from the hapi-instrumentation package.
image

This is because the hapi-instrumentation package only supports one of the plugin declaration format. The other declaration format are as follows:

plugin-a.js
exports.plugin = {
name: "test plugin",
....
}

What did you expect to see?

The plugin should wrap the plugins normally

What did you see instead?

It throws an error

Additional context

Hapi allows two ways of making a plugin.
image

@jk1z jk1z added the bug Something isn't working label Oct 12, 2020
@jk1z jk1z changed the title [Hapi Plugin] Hapi plugin getting [Hapi Plugin] Hapi plugin getting name undefined error when registering plugins Oct 12, 2020
@jk1z
Copy link
Contributor Author

jk1z commented Oct 12, 2020

@carolinee21 I have raise a PR to fix this issue. Also, thanks for the hard work you put in to make this plugin.

@jk1z jk1z changed the title [Hapi Plugin] Hapi plugin getting name undefined error when registering plugins [Hapi Plugin] Hapi instrumentation plugin wrapping issue Oct 12, 2020
@jk1z jk1z changed the title [Hapi Plugin] Hapi instrumentation plugin wrapping issue [Hapi instrumentation Plugin] Hapi plugin wrapping issue Oct 12, 2020
@jk1z jk1z changed the title [Hapi instrumentation Plugin] Hapi plugin wrapping issue [Hapi Plugin] Hapi instrumentation plugin wrapping issue Oct 12, 2020
@jk1z jk1z changed the title [Hapi Plugin] Hapi instrumentation plugin wrapping issue [Hapi Plugin] Hapi instrumentation plugins wrapping issue Oct 12, 2020
@carolinee21
Copy link
Contributor

This seems like a good add to support this other declaration format - I support adding this fix

@jk1z jk1z closed this as completed Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants