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

logModulesLoadedBeforeTrace should log a warning not an error, and should have a flag to disable the warning #1066

Closed
bag-man opened this issue Jul 5, 2019 · 14 comments · Fixed by #1068 or #1070
Assignees
Labels
api: cloudtrace Issues related to the googleapis/cloud-trace-nodejs API. help wanted We'd love to have community involvement on this issue. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@bag-man
Copy link

bag-man commented Jul 5, 2019

The function logModulesLoadedBeforeTrace will currently log an error, which is not appropriate for a warning to a developer.

It should be changed to log a warning, so as to not trigger error reports when a service is restarted. Ideally the module should also have an option to disable this warning.

I'm happy to make a PR to do this if considered a valid change.

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jul 6, 2019
@kjin kjin added help wanted We'd love to have community involvement on this issue. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Jul 8, 2019
@kjin kjin self-assigned this Jul 8, 2019
@kjin
Copy link
Contributor

kjin commented Jul 8, 2019

@bag-man I agree with this change, a PR would be great (ignore the labels/assignee). Thanks!

@bag-man
Copy link
Author

bag-man commented Jul 10, 2019

@kjin Is there a branch that I should work off of?

Master doesn't build:

cloud-trace-nodejs (master) λ npm run compile

> @google-cloud/trace-agent@4.0.1 compile /home/owg1/Projects/cloud-trace-nodejs
> npm run script get-plugin-types compile-auto compile-auto-strict


> @google-cloud/trace-agent@4.0.1 script /home/owg1/Projects/cloud-trace-nodejs
> ts-node -P ./scripts/tsconfig.json ./scripts "get-plugin-types" "compile-auto" "compile-auto-strict"

> Running step: get-plugin-types
> Running step: compile-auto
> Running: `node_modules/typescript/lib/tsc -p ./tsconfig.full.json --target es2017`
test/plugins/test-trace-mongoose-async-await.ts:34:29 - error TS2559: Type '{ f1: string; f2: boolean; f3: number; }' has no properties in common with type 'Partial<Document>'.

34     const data = new Simple(doc);
                               ~~~


Found 1 error.

Error: Process 18783 exited with code 2.
    at ChildProcess.childProcess.on (/home/owg1/Projects/cloud-trace-nodejs/scripts/utils.ts:41:14)
    at ChildProcess.emit (events.js:198:13)
    at ChildProcess.EventEmitter.emit (domain.js:448:20)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)

@kjin
Copy link
Contributor

kjin commented Jul 10, 2019

Should be master, but seems like a type definition changed under our feet. Let me fix that!

@bag-man bag-man closed this as completed Jul 15, 2019
@bag-man bag-man reopened this Jul 15, 2019
@kjin
Copy link
Contributor

kjin commented Jul 15, 2019

@bag-man Sorry -- should have mentioned that I fixed the build issue in #1067.

Let me know if you want me to do this change instead.

@bag-man
Copy link
Author

bag-man commented Jul 15, 2019

@kjin If you could make the fix, you could probably get it up quicker than I could, and it would be greatly appreciated!

@bag-man
Copy link
Author

bag-man commented Jul 15, 2019

Nice one thanks! :D I might make a PR to add an option to disable the warning for production if that would be accepted?

@kjin
Copy link
Contributor

kjin commented Jul 15, 2019

Sure, let me know if you want me to add it in as well. A note though, if you are proposing using NODE_ENV to detect whether whether we are running in production, I'm not sure if this can be uniliterally accepted by all of our users, so I'd suggest maybe using a different environment variable (like GCLOUD_TRACE_DISABLE_UNTRACED_MODULES_WARNING -- it's a mouthful, but the shortest descriptive env var name I could think of).

@bag-man
Copy link
Author

bag-man commented Jul 15, 2019

I wasn't thinking of using a env var, rather just another option in the configuration object, so those who want to disable it can

disableUntracedModulesWarning: true

@kjin kjin reopened this Jul 16, 2019
@kjin
Copy link
Contributor

kjin commented Jul 16, 2019

Sure, that works!

@bag-man
Copy link
Author

bag-man commented Jul 17, 2019

When would these changes get published?

@kjin
Copy link
Contributor

kjin commented Jul 17, 2019

Ah, I was waiting on your PR. If it's something you need now let me go ahead and make the config option change + release.

@bag-man
Copy link
Author

bag-man commented Jul 17, 2019

I started on a PR today, but Google's setup had me a bit stumped unfortunately. If it's a quick change for you before release it would be super helpful and greatly appreciated!

@kjin
Copy link
Contributor

kjin commented Jul 17, 2019

Yup: #1070

@kjin
Copy link
Contributor

kjin commented Jul 18, 2019

Hi @bag-man, this has been released in 4.1.0.

@google-cloud-label-sync google-cloud-label-sync bot added the api: cloudtrace Issues related to the googleapis/cloud-trace-nodejs API. label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: cloudtrace Issues related to the googleapis/cloud-trace-nodejs API. help wanted We'd love to have community involvement on this issue. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
3 participants