appinsights

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallNewPipeline

func InstallNewPipeline(opts ...Option) (func(context.Context) error, error)

InstallNewPipeline instantiates a NewExportPipeline with the recommended configuration and registers it globally.

func NewExportPipeline

func NewExportPipeline(opts ...Option) (trace.TracerProvider, func(context.Context) error, error)

NewExportPipeline sets up a complete export pipeline with the recommended setup for trace provider

Types

type Data

type Data struct {
	BaseType string      `json:"baseType"`
	BaseData interface{} `json:"baseData"`
}

Data represesent span data in transmittion

type Envelope

type Envelope struct {
	Ver        int               `json:"ver"`
	Name       string            `json:"name"`
	Time       string            `json:"time"`
	SampleRate float64           `json:"sampleRate,omitempty"`
	Seq        string            `json:"seq,omitempty"`
	IKey       string            `json:"iKey"`
	Tags       map[string]string `json:"tags,omitempty"`
	Data       *Data             `json:"data"`
}

Envelope represents system variables for a telemetry item.

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter is an implementation of an OTel SpanSyncer that uploads spans to Azure Monitor

func NewExporter

func NewExporter(opts ...Option) (*Exporter, error)

NewExporter returns an OTel Exporter implementation that exports the collected spans to Azure Monitor.

func (*Exporter) ExportSpans

func (e *Exporter) ExportSpans(ctx context.Context, spans []*export.SpanSnapshot) error

ExportSpans exports span data to Azure Monitor

func (*Exporter) Shutdown

func (e *Exporter) Shutdown(ctx context.Context) error

Shutdown stops the exporter flushing any pending exports.

type Option

type Option func(*Exporter)

Option is type definion for WithXxx functions

func WithConnectionString

func WithConnectionString(cs string) Option

WithConnectionString sets the connection string for exporter

func WithConnectionStringFromEnv

func WithConnectionStringFromEnv() Option

WithConnectionStringFromEnv sets the connection from environment variable

func WithEndpoint

func WithEndpoint(url string) Option

WithEndpoint sets the ingestion endpoint for the exporter

func WithInstrumentationKey

func WithInstrumentationKey(key string) Option

WithInstrumentationKey set the instrumentation key for ingestion endpoint

func WithInstrumentationKeyFromEnv

func WithInstrumentationKeyFromEnv() Option

WithInstrumentationKeyFromEnv sets the instrumentation key from environment variable

func WithProcess

func WithProcess(process Process) Option

WithProcess sets the process with the information about the exporting process.

func WithSDK

func WithSDK(config sdktrace.Config) Option

WithSDK sets the SDK config for the exporter pipeline.

type Process

type Process struct {
	ServiceName string
	Tags        []attribute.KeyValue
}

Process contains the information exported to Azure Monitor about the source of the trace data.

type RemoteDependencyData

type RemoteDependencyData struct {
	Ver          int                 `json:"ver"`
	Name         string              `json:"name"`
	ID           string              `json:"id"`
	ResultCode   string              `json:"resultCode"`
	Duration     string              `json:"duration"`
	Success      bool                `json:"success"`
	Data         string              `json:"data"`
	Target       string              `json:"target"`
	Type         string              `json:"type"`
	Properties   *map[string]string  `json:"properties"`
	Measurements *map[string]float64 `json:"measurements"`
}

RemoteDependencyData represents internal/client span

type RequestData

type RequestData struct {
	Ver          int                 `json:"ver"`
	ID           string              `json:"id"`
	Source       string              `json:"source"`
	Name         string              `json:"name"`
	Duration     string              `json:"duration"`
	ResponseCode string              `json:"responseCode"`
	Success      bool                `json:"success"`
	URL          string              `json:"url"`
	Properties   *map[string]string  `json:"properties,omitempty"`
	Measurements *map[string]float64 `json:"measurements,omitempty"`
}

RequestData represents consumer/server span

Jump to

Keyboard shortcuts

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