Skip to content

Latest commit

 

History

History
66 lines (49 loc) · 1.55 KB

README.md

File metadata and controls

66 lines (49 loc) · 1.55 KB

Telemetry

Common configuration and uses for logs, metrics, and traces.

Installation

require (
  github.com/orbservability/telemetry v0.0.2
)

Usage

Global

Global configuration is automatically provided via init() functions, provided that the package is imported.

import (
  _ "github.com/orbservability/telemetry/pkg/logs"
)

Server

Provides common tooling for the following use cases:

  • gRPC

    import (
      "github.com/orbservability/telemetry/pkg/logs"
      "github.com/orbservability/telemetry/pkg/metrics"
      "github.com/orbservability/telemetry/pkg/traces"
      "google.golang.org/grpc"
    )
    
    grpcServer := grpc.NewServer(
      grpc.ChainUnaryInterceptor(traces.UnaryServerInterceptor, logs.UnaryServerInterceptor, metrics.UnaryServerInterceptor),
      grpc.ChainStreamInterceptor(traces.StreamServerInterceptor, logs.StreamServerInterceptor, metrics.StreamServerInterceptor),
      // ...
    )

Client

Provides common tooling for the following use cases:

  • gRPC

    import (
      "github.com/orbservability/telemetry/pkg/logs"
      "github.com/orbservability/telemetry/pkg/metrics"
      "github.com/orbservability/telemetry/pkg/traces"
      "google.golang.org/grpc"
    )
    
    conn, err := grpc.Dial(
      "https://api.orbservability.com",
      grpc.WithChainUnaryInterceptor(traces.UnaryClientInterceptor, logs.UnaryClientInterceptor, metrics.UnaryClientInterceptor),
      grpc.WithChainStreamInterceptor(traces.StreamClientInterceptor, logs.StreamClientInterceptor, metrics.StreamClientInterceptor),
      // ...
    )