EMF as Map - #12
Conversation
* Adds Build() to expose the EMF structure externally * bumped go version to 1.20
* Update pipeline actions * go 1.20 update
* Update pipeline actions * go 1.20 update
|
Hey @prozz! We're having a log implementation with a fluent interface where we added a Something in the lines of: It is just an enabler for us to use this library in multiple ways. |
|
Hi! I work with @gaeste and just came across this. I'm working on our internal log package and I was looking at dependencies, which is how I ended up here. Our use case is that we have, as mentioned, our own package for logging. It's due for some overhaul, and one new feature is proper JSON support, which we need for EMF. EMF in general is new to me, so I'm still getting my bearings on it. Our log package has a (mildly edited for brevity) func WithMetrics(emf map[string]any)Logger {
metrics := emf["_aws"]
if metrics == nil {
return log.With("emf_error", "no EMF structure available")
}
logger := log.With("_aws", metrics)
for k, v := range emf {
if k != "_aws" {
logger = logger.With(k, v)
}
}
return logger
}However, just slinging bare maps around can leave room for mistakes when you want a specific structure to it, and you need to actually check the logs for that ...so that was a long-winded way of saying that we're not using the logger part of this package, but we didn't want to reinvent the wheel for the EMF format. |
Hey @gaeste!
I noticed you had the need to introduce EMF datastructure exposure, instead of logging.
Could you please share your requirements for it and how is it used in practice?
Regards :)