Splunk AppDynamics

golang sdk

Tatiane_Nicchet
New Member

Hi,

I am new to the community and I am having a few problems to use appdynamics with golang. I followed the tutorial and succefully connected my GO application with the SDK, but I still have a few questions. First of all, do I need to manually insert a business transaction to every external call i wish to observe? For example:

func (c userRepository) getAll()  {
appd.AddBackend("backTest", "DB", map[string]string{"DATABASE": "mongodb",}, false)
btHandle := appd.StartBT("database 1", "")
ecHandle := appd.StartExitcall(btHandle, "backTest")

// calling database

if err != nil {
appd.AddBTError(btHandle, appd.ErrorLevel(2), "error message", true)
} appd.EndExitcall(ecHandle)
appd.EndBT(btHandle)

return ...
}

func (c userRepository) getById() {
appd.AddBackend("backTest", "DB", map[string]string{"DATABASE": "mongodb",}, false)
btHandle := appd.StartBT("database 1", "")
ecHandle := appd.StartExitcall(btHandle, "backTest")

// calling database again
if err != nil {
appd.AddBTError(btHandle, appd.ErrorLevel(2), "another error message", true)
} appd.EndExitcall(ecHandle)
appd.EndBT(btHandle)

return ...
}

 And should I do it manually for every external call that i make? (external API, Database, ....) I find it too time consuming  it and makes the code longer and more difficult to read. Can anyone tell me if I am using the SDK properly or if there is something that i am missing and could make it simpler?

0 Karma

zhouyaoji
Path Finder

Hi Tatiane,

I took a look at the latest docs https://docs.appdynamics.com/appd/23.x/latest/en/application-monitoring/install-app-server-agents/go... and didn't see any different between it and the 4.5.x version, so I'm going to follow up with the writer of the doc to contact the Go SDK engineers to take a look at your example and help answer your questions. Thanks for your post and hope to get you some answers soon.

0 Karma

iamryan
Community Manager
Community Manager

Hi @Tatiane.Nicchetti,

Can you share the link to the tutorial you followed? 

0 Karma

Tatiane_Nicchet
New Member

Hi,

I followed this tutorial to initialize the Agent and the Controller Configuration (https://docs.appdynamics.com/appd/4.5.x/en/application-monitoring/install-app-server-agents/go-langu...).

I have a question about configuring the BTs and Backends. Our company's other applications are already in the appdynamics environment (all in Node or Java) and we need to add this Golang api to monitor all of them together in the dashboard. If I initialize the agent and controllers, will we see all of them working together? Or do we need to set up all calls to backends like i did in the example even if those backends that are already being monitored in the dashboard?

0 Karma
Get Updates on the Splunk Community!

Uncovering Multi-Account Fraud with Splunk Banking Analytics

Last month, I met with a Senior Fraud Analyst at a nationally recognized bank to discuss their recent success ...

Secure Your Future: A Deep Dive into the Compliance and Security Enhancements for the ...

What has been announced?  In the blog, “Preparing your Splunk Environment for OpensSSL3,”we announced the ...

New This Month in Splunk Observability Cloud - Synthetic Monitoring updates, UI ...

This month, we’re delivering several platform, infrastructure, application and digital experience monitoring ...