-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Golang Getting started - based on roll dice service and Automatic Ins… #3244
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the substance of this documentation from manual instrumentation to automatic instrumentation. Automatic instrumentation deserves to live besides this not in-place of it.
thanks for raising this @pegasas. This still looks work-in-progress for me, so please put this into draft mode for now.
Right now I don't see how the documentation has been changed from manual to automatic instrumentation, as it seems incomplete. To comment on that nevertheless, as we have a discussion on the same ongoing over here: _ the assumption is that a Getting Started should give you something tangible as quick as possible in your preferred language_, so if the Golang SIG at some point comes to the conclustion that automatic instrumentation might be a better route to that, we can adopt it in the Getting Started, and have a similar structure as we have it for Java & JavaScript these days (Getting Started using mostly automation, have a "manual" and "automatic" documentation). |
The `Fibonacci()` function intentionally produces invalid results for | ||
sufficiently large values of `n`. This is addressed in | ||
[Error handling](#error-handling). | ||
This page will show you how to get started with OpenTelemetry in Golang. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The language is called "Go". Not "Golang" 😉
The following example uses a basic | ||
[Gin Web Framework](https://gin-gonic.com/docs/introduction/). If you are | ||
not using Gin, that's OK — you can use OpenTelemetry Golang with other web | ||
frameworks as well, such as Goframe and Beego. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simply use net/http
? You can mention that it works for Gin, Gorilla/Mux, Echo etc.
I would say that using HTTP frameworks is often NOT seen as idiomatic. Also the example is so simple that it does not need any "framework" features. At last, we thrive to have the best support for http/net
. We even consider dropping support for other libraries.
```go | ||
go mod init | ||
go get github.com/gin-gonic/gin | ||
go mod vendor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vendoring is not needed.
What do you mean? Right now, getting started should work with manual instrumentation. |
So I think we should change this eventually to use autoinstrumentation first, but the main issue is that the Go autoinstrumentation agent is still quite early. I don't know if we should endorse it as the right way to get started today. |
https://github.com/open-telemetry/opentelemetry-go-instrumentation |
Yes, for now it is. There may be more in the future though, since the technique could also apply for Rust and C++. But I don't know if there's any motivation on those SIGs to start an autoinstrumentation project. |
There is also https://github.com/open-telemetry/opentelemetry-ebpf |
@pegasas there is now an updated getting started for go using manual instrumentation. Do you still have interest in writing something about automatic instrumentation or can we close this PR? |
try to add an roll dice example with golang, solving #2623