trace

package
v0.0.0-...-be1e383 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2021 Layotto Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 Layotto Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 Layotto Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 Layotto Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	LAYOTTO_REQUEST_RESULT = 30 + iota
	LAYOTTO_METHOD_NAME
	LAYOTTO_APP_NAME
	LAYOTTO_GENERATOR_TYPE
	LAYOTTO_ATTRS_CONTENT
	LAYOTTO_COMPONENT_DETAIL
)

Variables

This section is empty.

Functions

func RegisterExporter

func RegisterExporter(name string, e Exporter)

func RegisterGenerator

func RegisterGenerator(name string, ge Generator)

func SetActiveExporters

func SetActiveExporters(exporter []string)

func SetExtraComponentInfo

func SetExtraComponentInfo(ctx context.Context, info string)

func UnregisterExporter

func UnregisterExporter(name string)

Types

type Exporter

type Exporter interface {
	ExportSpan(s *Span)
}

Exporter is used to export Span

func GetExporter

func GetExporter(name string) Exporter

type Generator

type Generator interface {
	GetTraceId(ctx context.Context) string
	GetSpanId(ctx context.Context) string
	GenerateNewContext(ctx context.Context, span api.Span) context.Context
	GetParentSpanId(ctx context.Context) string
}

Generator is used to get or generate traceId/spanId/context

func GetGenerator

func GetGenerator(name string) Generator

type Span

type Span struct {
	StartTime time.Time
	EndTime   time.Time
	// contains filtered or unexported fields
}

func (*Span) FinishSpan

func (span *Span) FinishSpan()

func (*Span) InjectContext

func (span *Span) InjectContext(requestHeaders types.HeaderMap, requestInfo types.RequestInfo)

func (*Span) ParentSpanId

func (span *Span) ParentSpanId() string

func (*Span) SetOperation

func (span *Span) SetOperation(operation string)

func (*Span) SetParentSpanId

func (span *Span) SetParentSpanId(id string)

func (*Span) SetRequestInfo

func (span *Span) SetRequestInfo(reqInfo types.RequestInfo)

func (*Span) SetSpanId

func (span *Span) SetSpanId(id string)

func (*Span) SetTag

func (span *Span) SetTag(key uint64, value string)

func (*Span) SetTraceId

func (span *Span) SetTraceId(id string)

func (*Span) SpanId

func (span *Span) SpanId() string

func (*Span) SpawnChild

func (span *Span) SpawnChild(operationName string, startTime time.Time) api.Span

func (*Span) Tag

func (span *Span) Tag(key uint64) string

func (*Span) TraceId

func (span *Span) TraceId() string

Jump to

Keyboard shortcuts

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