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
- func GetAttributesForDeployment(deployment *appsv1.Deployment) []attribute.KeyValue
- func GetAttributesForEnv(env *fv1.Environment) []attribute.KeyValue
- func GetAttributesForFunction(fn *fv1.Function) []attribute.KeyValue
- func GetAttributesForHPA(hpa *asv2.HorizontalPodAutoscaler) []attribute.KeyValue
- func GetAttributesForPackage(pkg *fv1.Package) []attribute.KeyValue
- func GetAttributesForPod(pod *apiv1.Pod) []attribute.KeyValue
- func GetAttributesForSvc(svc *apiv1.Service) []attribute.KeyValue
- func GetHandlerWithOTEL(h http.Handler, name string, filter ...otelhttp.Filter) http.Handler
- func InitProvider(ctx context.Context, logger *zap.Logger, serviceName string) (func(context.Context), error)
- func LoggerWithTraceID(ctx context.Context, logger *zap.Logger) *zap.Logger
- func MapToAttributes(m map[string]string) []attribute.KeyValue
- func OtelEnvForContainer() []apiv1.EnvVar
- func SpanTrackEvent(ctx context.Context, event string, attributes ...attribute.KeyValue)
- func UrlsToIgnore(ignoreEndpoints ...string) func(r *http.Request) bool
- type OtelConfig
Constants ¶
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 ¶
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 GetHandlerWithOTEL ¶
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 OtelEnvForContainer ¶
OtelEnvForContainer returns a list of environment variables for the container, which start with prefix OTEL_
func SpanTrackEvent ¶
Types ¶
type OtelConfig ¶
type OtelConfig struct {
// contains filtered or unexported fields
}