Skip to content

Commit

Permalink
Update go libraries page with new intro (#3826)
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm authored Jan 26, 2024
1 parent dfb6880 commit 06263ac
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
25 changes: 16 additions & 9 deletions content/en/docs/languages/go/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ aliases:
weight: 40
---

Go does not support truly automatic instrumentation like other languages today.
Instead, you'll need to depend on
{{% docs/languages/libraries-intro Go %}}

## Use instrumentation libraries

If a library does not come with OpenTelemetry out of the box, you can use
[instrumentation libraries](/docs/specs/otel/glossary/#instrumentation-library)
that generate telemetry data for a particular instrumented library. For example,
the instrumentation library for `net/http` will automatically create spans that
track inbound and outbound requests once you configure it in your code.
to generate telemetry data for a library or framework.

For example, the
[instrumentation library for `net/http`](https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp)
automatically creates [spans](/docs/concepts/signals/traces/#spans) and
[metrics](/docs/concepts/signals/metrics/) based on the HTTP requests.

## Setup

Expand All @@ -29,7 +35,7 @@ go get go.opentelemetry.io/contrib/instrumentation/{import-path}/otel{package-na
Then configure it in your code based on what the library requires to be
activated.

[Getting Started](../instrumentation/) provides an example showing how to set up
[Getting Started](../getting-started/) provides an example showing how to set up
instrumentation for a `net/http` server.

## Available packages
Expand All @@ -42,6 +48,7 @@ A full list of instrumentation libraries available can be found in the
Instrumentation libraries can do things like generate telemetry data for inbound
and outbound HTTP requests, but they don't instrument your actual application.

To get richer telemetry data, use [manual instrumentation](../instrumentation/)
to enrich your telemetry data from instrumentation libraries with
instrumentation from your running application.
Enrich your telemetry data by integrating
[custom instrumentation](../instrumentation/) into your code. This supplements
the standard library telemetry, and can offer deeper insights into your running
application.
4 changes: 4 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -6095,6 +6095,10 @@
"StatusCode": 200,
"LastSeen": "2024-01-18T19:07:49.734386-05:00"
},
"https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp": {
"StatusCode": 200,
"LastSeen": "2024-01-19T15:36:28.468246594Z"
},
"https://pkg.go.dev/go.opentelemetry.io/otel": {
"StatusCode": 200,
"LastSeen": "2023-09-11T14:33:25.55139188Z"
Expand Down

0 comments on commit 06263ac

Please sign in to comment.