gocloud.dev: gocloud.dev/server/sdserver Index | Files

package sdserver

import "gocloud.dev/server/sdserver"

Package sdserver provides the diagnostic hooks for a server using Stackdriver.

Index

Package Files

server.go

Variables

var Set = wire.NewSet(
    server.Set,
    NewExporter,
    monitoredresource.Autodetect,
    wire.Bind((*trace.Exporter)(nil), (*stackdriver.Exporter)(nil)),
    NewRequestLogger,
    wire.Bind((*requestlog.Logger)(nil), (*requestlog.StackdriverLogger)(nil)),
)

Set is a Wire provider set that provides the diagnostic hooks for *server.Server given a GCP token source and a GCP project ID.

func NewExporter Uses

func NewExporter(id gcp.ProjectID, ts gcp.TokenSource, mr monitoredresource.Interface) (*stackdriver.Exporter, func(), error)

NewExporter returns a new OpenCensus Stackdriver exporter.

The second return value is a Wire cleanup function that calls Flush on the exporter.

func NewRequestLogger Uses

func NewRequestLogger() *requestlog.StackdriverLogger

NewRequestLogger returns a request logger that sends entries to stdout.

Package sdserver imports 12 packages (graph) and is imported by 5 packages. Updated 2019-01-28. Refresh now. Tools for package owners.