elastic / apm-agent-go

https://www.elastic.co/guide/en/apm/agent/go/current/index.html
Apache License 2.0
413 stars 190 forks source link

opentracing logKV only logs values on error #818

Open igorwwwwwwwwwwwwwwwwwwww opened 3 years ago

igorwwwwwwwwwwwwwwwwwwww commented 3 years ago

The APM agent ships with an adapter for opentracing. Opentracing supports a Span.LogKV operation that is similar to a multi-SetTag.

And indeed, that is how it being used in at least one project, thanos.

However, it appears that the APM agent is only using this mechanism for logging error messages:

https://github.com/elastic/apm-agent-go/blob/2aef45b9cf4b326b84bdee36c844efd3622d6b00/module/apmot/log.go#L85-L88

It would be great if custom, non-standard key-value entries were stored by the agent.

axw commented 3 years ago

Thanks for opening the issue! I agree, this would be nice to have.

Right now the protocol between agents and server does not support sending arbitrary logs, which is why things are the way they are. We are looking into extending the protocol (https://github.com/elastic/apm-server/issues/3723); if/when that happens, then I think it would make sense to come back and add full support for LogKV.