MCPcopy Index your code
hub / github.com/aws-observability/aws-otel-go

github.com/aws-observability/aws-otel-go @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
211 symbols 673 edges 28 files 145 documented · 69%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

AWS Distro for OpenTelemetry Go Language

Introduction

This repo hosts documentation and sample apps for the ADOT Go library which provides the AWS service integrations for traces and metrics for the OpenTelemetry Go library. The library can be configured to support trace applications with the AWS X-Ray service.

Please note all source code for the Go library is upstream on the OpenTelemetry project in the OpenTelemetry Go library repo. All features of the OpenTelemetry library are available along with its components beinbg configured to create traces which can be viewed in the AWS X-Ray console and to allow propagation of those contexts across multiple downstream AWS services.

Once traces have been generated, they can be sent to a tracing service, like AWS X-Ray, to visualize and understand exactly what happened during the traced calls. For more information about the AWS X-Ray service, see the AWS X-Ray Developer Guide.

To send traces to AWS X-Ray, you can use the AWS Distro for OpenTelemetry (ADOT) Collector. OpenTelemetry Go exports traces from the application to the ADOT Collector. The ADOT Collector is configured with AWS credentials for the CLI, an AWS region, and which trace attributes to index so that it can send the traces to the AWS X-Ray console. Read more about the AWS X-Ray Tracing Exporter for OpenTelemetry Collector.

ADOT is in preview for Go metrics.

Getting Started

Check out the getting started documentation

Sample Application (DEPRECATED)

WARNING: This sample app is deprecated and is no longer maintained. Please use the new standardized sample apps.

See the example sample application for setup steps.

The OpenTelemetry Go SDK provides entry points for configuration through its API. This is can be used to configure the id_generator needed to support the X-Ray trace ID format. In addition, it also allows the use of a custom propagator, passed into the tracer provider, to generate and propagate the AWS X-Ray trace header.

Useful Links

Security issue notifications

If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our vulnerability reporting page. Please do not create a public github issue.

License

This project is licensed under the Apache-2.0 License.

Extension points exported contracts — how you extend this code

Option (Interface)
Option sets configuration on the sampler.
samplers/aws/xray/remote_sampler_config.go
Option (Interface)
Option sets configuration on the OTLP UDP Client.
exporters/xrayudp/config.go
OtlpTraceClient (Interface)
(no doc) [2 implementers]
exporters/xrayudp/client.go
Conn (Interface)
(no doc) [1 implementers]
exporters/xrayudp/udp_exporter.go

Core symbols most depended-on inside this repo

now
called by 30
samplers/aws/xray/internal/clock.go
take
called by 24
samplers/aws/xray/internal/reservoir.go
newConfig
called by 9
samplers/aws/xray/remote_sampler_config.go
appliesTo
called by 9
samplers/aws/xray/internal/rule.go
wildcardMatch
called by 9
samplers/aws/xray/internal/match.go
Sample
called by 8
samplers/aws/xray/internal/rule.go
MatchAgainstManifestRules
called by 7
samplers/aws/xray/internal/manifest.go
RefreshManifestRules
called by 7
samplers/aws/xray/internal/manifest.go

Shape

Function 126
Method 53
Struct 25
Interface 5
FuncType 2

Languages

Go100%

Modules by API surface

samplers/aws/xray/internal/manifest_test.go37 symbols
samplers/aws/xray/internal/rule_test.go22 symbols
samplers/aws/xray/internal/manifest.go15 symbols
samplers/aws/xray/internal/client.go12 symbols
samplers/aws/xray/internal/client_test.go11 symbols
samplers/aws/xray/internal/reservoir_test.go10 symbols
samplers/aws/xray/remote_sampler_config.go9 symbols
exporters/xrayudp/config.go9 symbols
samplers/aws/xray/remote_sampler_config_test.go8 symbols
samplers/aws/xray/remote_sampler.go8 symbols
exporters/xrayudp/udp_exporter.go8 symbols
exporters/xrayudp/client.go8 symbols

For agents

$ claude mcp add aws-otel-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact