Log hapi log tags as the new dedicated tags
See original GitHub issueIs your feature request related to a problem? Please describe.
Right now it logs under context.custom.tags
while there is a dedicated context.tags
https://github.com/elastic/apm-agent-nodejs/blob/cbf39df9ebd68d29f136cfeb40cb5b6f8b099073/lib/instrumentation/modules/hapi.js#L91
Describe the solution you’d like
Log it to context.tags
so I can query on it 🎉
Describe alternatives you’ve considered in a filter do
if (item.exception && item.context.custom.tags) {
item.context.tags = { ...item.context.tags, ...item.context.custom.tags };
}
Additional context Add any other context or screenshots about the feature request here.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Logging - hapi.dev
tags : a string or an array of strings (e.g. ['error', 'database', 'read'] ) used to identify the event. Tags are used instead...
Read more >How to add a tag to all Hapi logs in server.ext('onRequest', ...)
I want to add a specific tag to all of the logs when this header is present. I would have though that there...
Read more >Changelog: 2022 - HAPI FHIR Documentation
In the JPA server, when a resource is being updated, the response will now include any tags or security labels which were not...
Read more >Hapi.creating+routes+for+login+and+register+user+hapi+ ...
The previous tutorial laid the foundation for API authentication with username and password. You created a dedicated API authentication plugin which registers ...
Read more >hapijs/hapi - Gitter
Error: c:/Dev/Test/DT/DefinitelyTyped/types/hapi/test/route/config.ts ERROR: ... server.register(require('vision')); console.log(server); server.views({ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Today the APM Server would reject the data if the tags contained a period (or a
*
or a"
). So the user would have to manually replace those. In that light it would make sense if the agent took care of it I guess. Let’s update the current code to useaddTags
instead and replace the illegal chars with_
.If I do apm.addTags now with a name containing a string, what does it do now? Throw? I don’t think it would be hard to call addTags myself but a user would quickly forget to check on the periods. For me personally maintaining it outweighs having the user do it. It is always awesome when “things just work”. I also checked our logging and afaik we never log with tags with a period (or a special character for that matter). I would find it odd if someone else did but you know 😄