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
- func RegisterExporter(name string, e Exporter)
- func RegisterGenerator(name string, ge Generator)
- func SetActiveExporters(exporter []string)
- func SetExtraComponentInfo(ctx context.Context, info string)
- func UnregisterExporter(name string)
- type Exporter
- type Generator
- type Span
- func (span *Span) FinishSpan()
- func (span *Span) InjectContext(requestHeaders types.HeaderMap, requestInfo types.RequestInfo)
- func (span *Span) ParentSpanId() string
- func (span *Span) SetOperation(operation string)
- func (span *Span) SetParentSpanId(id string)
- func (span *Span) SetRequestInfo(reqInfo types.RequestInfo)
- func (span *Span) SetSpanId(id string)
- func (span *Span) SetTag(key uint64, value string)
- func (span *Span) SetTraceId(id string)
- func (span *Span) SpanId() string
- func (span *Span) SpawnChild(operationName string, startTime time.Time) api.Span
- func (span *Span) Tag(key uint64) string
- func (span *Span) TraceId() string
Constants ¶
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 RegisterGenerator ¶
func SetActiveExporters ¶
func SetActiveExporters(exporter []string)
func SetExtraComponentInfo ¶
func UnregisterExporter ¶
func UnregisterExporter(name string)
Types ¶
type Exporter ¶
type Exporter interface {
ExportSpan(s *Span)
}
Exporter is used to export Span
func GetExporter ¶
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 ¶
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) SetOperation ¶
func (*Span) SetParentSpanId ¶
func (*Span) SetRequestInfo ¶
func (span *Span) SetRequestInfo(reqInfo types.RequestInfo)