telemetry

package
v3.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

* Copyright 2023 Caio Matheus Marcatti Calimério * * 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 2023 Caio Matheus Marcatti Calimério * * 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITelemetry

type ITelemetry interface {
	CreateRootSpan(name string, optionalAttrs ...interface{}) oteltrace.Span
	StartChildSpan(name string, optionalAttrs ...interface{}) oteltrace.Span
	EndSpan(span oteltrace.Span, err error)
	GetTraceID(span oteltrace.Span) oteltrace.TraceID
	Shutdown()
}

TelemetryInterface defines the methods that the Telemetry struct must implement.

func Factory

func Factory(env env.IEnv, log log.ILog) ITelemetry

type Telemetry

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

func NewOpenTelemetry

func NewOpenTelemetry(env env.IEnv, logger log.ILog) *Telemetry

func (*Telemetry) CreateRootSpan

func (t *Telemetry) CreateRootSpan(name string, optionalAttrs ...interface{}) oteltrace.Span

CreateRootSpan creates a new root span and stores it internally.

func (*Telemetry) EndSpan

func (t *Telemetry) EndSpan(span oteltrace.Span, err error)

EndSpan ends the given span and removes the latest context from the stack.

func (*Telemetry) GetTraceID

func (t *Telemetry) GetTraceID(span oteltrace.Span) oteltrace.TraceID

func (*Telemetry) Shutdown

func (t *Telemetry) Shutdown()

Shutdown shuts down the TracerProvider and ends all spans.

func (*Telemetry) StartChildSpan

func (t *Telemetry) StartChildSpan(name string, optionalAttrs ...interface{}) oteltrace.Span

StartChildSpan starts a new child span using the stored root span context.

Jump to

Keyboard shortcuts

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