I have several cases where I need to ingest logs into Dynatrace from scripts that I control, in servers where OneAgent is running.
Now, I try to ingest them directly through the OneAgent log ingest API: https://www.dynatrace.com/support/help/extend-dynatrace/extend-logs/oneagent-log-ingest-api
I do this for several reasons:
- Don’t need to write them to file, where OneAgent could get them also. Don’t use disk space.
- I believe it’s faster, but have not really measured it.
- I can add meta-data to the logs ingested in a more controlled way.
I sometimes have doubts if there are disadvantages in this approach. For instance, it’s way easier to dump into a file, and you don’t have to code so much. You also have to be careful not committing errors. Are there other point of views, or how are you doing it yourself?