Skip to content
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

OpenTelemetry tracing using OTLP exporter #38

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.21.x' ]
go-version: [ '1.22.x' ]

env:
CGO_ENABLED: 0
Expand Down
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin/
etc/waas-auth.conf
etc/id_rsa
etc/id_rsa.pub
version.go
/bin/
/etc/waas-auth.conf
/etc/id_rsa
/etc/id_rsa.pub
/version.go
5 changes: 5 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Config struct {
KMS KMSConfig `toml:"kms"`
Database DatabaseConfig `toml:"database"`
Telemetry telemetry.Config `toml:"telemetry"`
Tracing TracingConfig `toml:"tracing"`
}

type AdminConfig struct {
Expand Down Expand Up @@ -49,6 +50,10 @@ type DatabaseConfig struct {
SessionsTable string `toml:"sessions_table"`
}

type TracingConfig struct {
Endpoint string `toml:"endpoint"`
}

func New() (*Config, error) {
fileName := os.Getenv("CONFIG")
var cfg Config
Expand Down
39 changes: 39 additions & 0 deletions etc/waas-auth.dev.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
region = "ca-central-1"

[service]
mode = "dev"
vsock = true
use_nsm = true
enclave_port = 5000
proxy_port = 8000
debug_profiler = true

[telemetry]
allow_any = true

[tracing]
endpoint = "0.0.0.0:4318"

[admin]
public_key = '''-----BEGIN RSA PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz+WUoYyHdSNN802C9q3Z
fn9U1/hGblhsaKmnDMW1TrNcIbjp+W1iAXBgaGlyKpPq6pO6AezWswBTBJfRlXaJ
Uqw6XfQxkv1JTJqoRRI3dRs7EopYr53eEM0xWx3q1EDCYr//z2XCG69XiIr3jD/4
ndaCARls5nSx7ffc94dnxZGnUMIlY/hoftNoaLu1G6yVLJmBxhIv4HkpqdOa0QON
P+cfxrocQl7dkdn31TKdrAfaZa0P7VIPiqE9dxN3vuhMFJoMWmWFlvpV8LXzLlm3
O/1N3VmFauveH6CaYZ1uiBvwsNUiKczJWlPloDRNO/HKsH1gF/EqfF9ObU1WGP3A
QwIDAQAB
-----END RSA PUBLIC KEY-----'''

[endpoints]
metadata_server = "http://169.254.169.254"
waas_api_server = "https://dev-api.sequence.app"

[database]
tenants_table = "dev_tenants"
accounts_table = "dev_accounts"
sessions_table = "dev_sessions"

[kms]
tenant_keys = ["arn:aws:kms:ca-central-1:767397863481:key/eea4d73b-f055-4941-9fc9-8ed3cff162be"]
default_session_keys = ["arn:aws:kms:ca-central-1:767397863481:key/eea4d73b-f055-4941-9fc9-8ed3cff162be"]
3 changes: 3 additions & 0 deletions etc/waas-auth.next.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ region = "us-east-2"
[telemetry]
allow_any = true

[tracing]
endpoint = "0.0.0.0:4318"

[admin]
public_key = '''-----BEGIN RSA PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz+WUoYyHdSNN802C9q3Z
Expand Down
3 changes: 3 additions & 0 deletions etc/waas-auth.prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ region = "ca-central-1"
[telemetry]
allow_any = true

[tracing]
endpoint = "0.0.0.0:4318"

[admin]
public_key = '''-----BEGIN RSA PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuHXPk+w9FDqjwV38kmFN
Expand Down
3 changes: 3 additions & 0 deletions etc/waas-auth.sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ region = "us-east-1"
[telemetry]
allow_any = true

[tracing]
endpoint = "0.0.0.0:4318"

[admin]
# Public key from the keypair used to generate admin JWTs
#
Expand Down
42 changes: 30 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ require (
github.com/0xsequence/go-sequence v0.29.4
github.com/0xsequence/nitrocontrol v0.3.0
github.com/BurntSushi/toml v1.3.2
github.com/aws/aws-sdk-go-v2 v1.25.2
github.com/aws/aws-sdk-go-v2 v1.26.1
github.com/aws/aws-sdk-go-v2/config v1.27.4
github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue v1.13.6
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.30.1
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.31.1
github.com/aws/aws-sdk-go-v2/service/kms v1.29.1
github.com/cenkalti/backoff/v4 v4.3.0
github.com/go-chi/chi/v5 v5.0.12
github.com/go-chi/httplog v0.3.2
github.com/go-chi/jwtauth/v5 v5.3.0
Expand All @@ -22,10 +23,19 @@ require (
github.com/goware/validation v0.1.2
github.com/lestrrat-go/jwx/v2 v2.0.20
github.com/mdlayher/vsock v1.2.1
github.com/riandyrn/otelchi v0.7.0
github.com/rs/zerolog v1.32.0
github.com/stretchr/testify v1.9.0
github.com/webrpc/webrpc v0.15.2
go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws v0.50.0
go.opentelemetry.io/contrib/propagators/aws v1.25.0
go.opentelemetry.io/otel v1.25.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.25.0
go.opentelemetry.io/otel/sdk v1.25.0
go.opentelemetry.io/otel/trace v1.25.0
go.opentelemetry.io/proto/otlp v1.1.0
golang.org/x/sync v0.6.0
google.golang.org/protobuf v1.33.0
)

require (
Expand All @@ -34,17 +44,18 @@ require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.4 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/dynamodbstreams v1.20.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.6 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sqs v1.31.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.20.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.28.1 // indirect
github.com/aws/smithy-go v1.20.1 // indirect
github.com/aws/smithy-go v1.20.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.24.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
Expand All @@ -56,10 +67,13 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fxamacker/cbor/v2 v2.5.0 // indirect
github.com/gibson042/canonicaljson-go v1.0.3 // indirect
github.com/gliderlabs/ssh v0.3.5 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang-cz/textcase v1.2.1 // indirect
Expand All @@ -75,6 +89,7 @@ require (
github.com/goware/logger v0.3.0 // indirect
github.com/goware/singleflight v0.2.0 // indirect
github.com/goware/superr v0.0.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
Expand Down Expand Up @@ -111,16 +126,19 @@ require (
github.com/uber-go/tally/v4 v4.1.11 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.opentelemetry.io/otel/metric v1.25.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.18.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/grpc v1.63.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
Expand Down
Loading
Loading