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

Namespace defaultMeta with either labels or tags. #97

Closed
rdifrango opened this issue Aug 31, 2021 · 3 comments
Closed

Namespace defaultMeta with either labels or tags. #97

rdifrango opened this issue Aug 31, 2021 · 3 comments
Labels
agent-nodejs Make available for APM Agents project planning.

Comments

@rdifrango
Copy link

I noticed when I was working with the ECS NodeJS loggers that Metadata fields weren't name spaced.

I can see one of three scenario's:

  1. Make the default namespace be labels per [https://www.elastic.co/guide/en/ecs/current/ecs-base.html](Base Fields)
  2. Make the default namespace be tags per [https://www.elastic.co/guide/en/ecs/current/ecs-base.html](Base Fields)
  3. Allow for a customized namespace via a configuration parameter.

Here's an example configuration:

const logger = winston.createLogger({
   format: ecsFormat(),
   level: "debug",
   defaultMeta: {
      defaultMeta: {
         'environment': 'dev'
      }
   },
   transports: [
      new winston.transports.Console()
   ]
})

and a resulting output:

{
   "@timestamp": "2021-08-20T15:43:32.147Z",
   "log.level": "debug",
   "message": "Example with the default Meta Data fields.",
   "ecs": {
      "version": "1.6.0"
   },
   "environment": "dev"
}
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Aug 31, 2021
@trentm
Copy link
Member

trentm commented Aug 31, 2021

Yes, agreed. Would you mind moving to #68 -- which I believe is the same general issue?

@rdifrango
Copy link
Author

@trentm Moved my comment over there so feel free to close this.

@trentm
Copy link
Member

trentm commented Sep 1, 2021

Thanks.

@trentm trentm closed this as completed Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

No branches or pull requests

2 participants