tracing_sentry

package module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 19 Imported by: 0

README

caddy sentry

https://docs.sentry.io/platforms/go/migration/

sentry.CaptureException(err)

func() {
	defer sentry.Recover()
	// do all of the scary things here
}()

SDK中的环境变量

  • SENTRY_DSN 必填

  • SENTRY_ENVIRONMENT

  • SENTRYGODEBUG 如:httptrace=1,httpdump=1

  • caddy sentry中的环境变量

  • SENTRY_DEBUG 默认false

  • SENTRY_SAMPLE_RATE 默认1.0, 范围(0.0,1.0], 如果全不采集那么DSN为空

  • SENTRY_SERVICE_NAME 默认hostname

caddy tracing

docker-compose.yaml

version: '3.7'

services:
  caddy:
    image: caddy:latest
    ports:
      - "80:80"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
    environment:
      - OTEL_SERVICE_NAME=caddy-app
      - OTEL_EXPORTER_OTLP_ENDPOINT=http://<jaeger-ip>:4317
      - OTEL_EXPORTER_OTLP_INSECURE=true
      - OTEL_EXPORTER_OTLP_PROTOCOL=grpc
      - GRPC_GO_LOG_VERBOSITY_LEVEL=99
      - GRPC_GO_LOG_SEVERITY_LEVEL=info

OTLP Exporter Configuration

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracing

type Tracing struct {
	// SpanName is a span name. It should follow the naming guidelines here:
	// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span
	SpanName string `json:"span"`
	// contains filtered or unexported fields
}

Tracing implements an HTTP handler that adds support for distributed tracing, using OpenTelemetry. This module is responsible for the injection and propagation of the trace context. Configure this module via environment variables (see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md). Some values can be overwritten in the configuration file.

func (Tracing) CaddyModule

func (Tracing) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Tracing) Cleanup

func (ot *Tracing) Cleanup() error

Cleanup implements caddy.CleanerUpper and closes any idle connections. It calls Shutdown method for a trace provider https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#shutdown.

func (*Tracing) Provision

func (ot *Tracing) Provision(ctx caddy.Context) error

Provision implements caddy.Provisioner.

func (*Tracing) ServeHTTP

func (ot *Tracing) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP implements caddyhttp.MiddlewareHandler.

func (*Tracing) UnmarshalCaddyfile

func (ot *Tracing) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile sets up the module from Caddyfile tokens. Syntax:

tracing {
    [span <span_name>]
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL