otel

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Copyright 2021 The Fission 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 (
	OtelEnvPrefix      = "OTEL_"
	OtelEndpointEnvVar = "OTEL_EXPORTER_OTLP_ENDPOINT"
	OtelInsecureEnvVar = "OTEL_EXPORTER_OTLP_INSECURE"
	OtelPropagaters    = "OTEL_PROPAGATORS"
)

Variables

This section is empty.

Functions

func GetAttributesForDeployment

func GetAttributesForDeployment(deployment *appsv1.Deployment) []attribute.KeyValue

func GetAttributesForEnv

func GetAttributesForEnv(env *fv1.Environment) []attribute.KeyValue

func GetAttributesForFunction

func GetAttributesForFunction(fn *fv1.Function) []attribute.KeyValue
GetAttributesForFunction returns a set of attributes for a function. Attributes returned:
   function-name
   function-namespace
   environment-name
   environment-namespace

These attributes are tags that can be used to filter traces.

func GetAttributesForHPA

func GetAttributesForHPA(hpa *asv2.HorizontalPodAutoscaler) []attribute.KeyValue

func GetAttributesForPackage

func GetAttributesForPackage(pkg *fv1.Package) []attribute.KeyValue

func GetAttributesForPod

func GetAttributesForPod(pod *apiv1.Pod) []attribute.KeyValue

func GetAttributesForSvc

func GetAttributesForSvc(svc *apiv1.Service) []attribute.KeyValue

func GetHandlerWithOTEL

func GetHandlerWithOTEL(h http.Handler, name string, filter ...otelhttp.Filter) http.Handler

func InitProvider

func InitProvider(ctx context.Context, logger *zap.Logger, serviceName string) (func(context.Context), error)

Initializes an OTLP exporter, and configures the corresponding trace and metric providers.

func LoggerWithTraceID

func LoggerWithTraceID(ctx context.Context, logger *zap.Logger) *zap.Logger

func MapToAttributes

func MapToAttributes(m map[string]string) []attribute.KeyValue

func OtelEnvForContainer

func OtelEnvForContainer() []apiv1.EnvVar

OtelEnvForContainer returns a list of environment variables for the container, which start with prefix OTEL_

func SpanTrackEvent

func SpanTrackEvent(ctx context.Context, event string, attributes ...attribute.KeyValue)

func UrlsToIgnore

func UrlsToIgnore(ignoreEndpoints ...string) func(r *http.Request) bool

Types

type OtelConfig

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

Jump to

Keyboard shortcuts

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