Kibana version: 7.9.2
Elasticsearch version: 7.9.2
APM Server version: 7.9.2
APM Agent language and version: Golang 1.11.0
Original install method (e.g. download page, yum, deb, from source, etc.) and version: Docker image on Kubernetes
Fresh install or upgraded from other version?: Fresh install
Is there anything special in your setup?: APM Server --> Kafka --> Logstash --> Elasticsearch
Hi, everyone
I have been working with APM and Golang in order to monitor HTTP connections to Elasticsearch.
On the code, I have tried to manage output requests by using HTTP wrapped client. Also, sending the method request (GET, POST, and so on) by using golang.org/x/net/context/ctxhttp
library. Moreover, I have guaranteed of closing the response properly.
In despite of this configuration and even though the request is being properly processed, APM server does not show any information. In order to solve this issue I have had to open a specific transaction for every call
Here you are my code:
transaction := apm.DefaultTracer.StartTransaction("POST "+queryPath, "request")
defer transaction.End()
transaction.Result = "HTTP 2xx"
transaction.Context.SetLabel("type", "elastic POST")
transaction.Context.SetLabel("uri", config.ElasticsearchURL+queryPath)
ctx := apm.ContextWithTransaction(context.Background(), transaction)
apmRequest := request.WithContext(ctx)
response, err = ctxhttp.Do(ctx, HTTPClient, apmRequest)
Is it right ? Is there another way to configure it?
Thanks in advance,
Rodrigo