https://signoz.io logo
#support
Title
# support
d

Davide Fastoso

10/20/2021, 8:50 AM
@User i did not put any version ahead of it but thank u for sharing, i will try to take advantage of the example to try if everything works fine
i

Itzik Lavon

10/20/2021, 8:50 AM
update if you need help
🙌 1
d

Davide Fastoso

10/20/2021, 12:57 PM
need a little bit of help setting up a gorilla mux handler with telemetry
Copy code
go
func myWonderfullHandler(h http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defer func() {
// SETTING UP initTRACE somehow 
}
Is it right
in general, this line should do the trick:
Copy code
r.Use(otelmux.Middleware("my-server"))
this is the import:
Copy code
"<http://go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux|go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux>"
💯 1
1️⃣ 1
Oh @User has correctly guided you already 👏
d

Davide Fastoso

10/20/2021, 6:01 PM
thank u everybody you are so great! it is the example that has been working on my machine but instead of letting it print on my console i want to let it print on a remote signoz instance on the kubernetes. As i understand i should try to reach it and assign it with the method
WithEndpoint()
but when i pass the references to it http://collector.telemetry.svc.cluster.local:4317/ doesnt work
a

Ankit Nayan

10/20/2021, 6:11 PM
How did you come up with the above url?
above url means svc name is
collector
and namespace is
telemetry
. Is it so? If you used the helm chart and deployed it on namespace
platform
the address would be
<http://otel-collector.platform.svc.cluster.local:4317>
d

Davide Fastoso

10/21/2021, 7:39 AM
somebody else in my comp must have deployed , i dont have history of it. Thank you very much for explanation, so for to reach my endpoint up should i put as a
serviceNameKey.String("collector")
And as
WithEndpoint("<http://collector.telemetry.svc.cluster.local:4317/>")
a

Ankit Nayan

10/21/2021, 7:43 AM
serviceNameKey
is the string that you want your application to be known by in UI...it has nothing to do with anything else
👍 1
the service that I was talking about in the url is a kubernetes resource
I don't think the other person would have changed that..so ideally the url would be
Copy code
<http://otel-collector>.<namespace>.svc.cluster.local:4317
also try removing the trailing slash
d

Davide Fastoso

10/21/2021, 7:56 AM
yes i will try, thanks another time for help , its my first time dealing with metrics and traces.
a

Ankit Nayan

10/21/2021, 7:57 AM
no worries 🙂
10 Views