<@U02ATR1C8LT> i did not put any version ahead of ...
# support
d
@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
update if you need help
🙌 1
d
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
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
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
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
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
yes i will try, thanks another time for help , its my first time dealing with metrics and traces.
a
no worries 🙂