lm-telemetry-sdk-go

module
v0.0.0-...-f06bd48 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MPL-2.0

README

LM-telemetry-sdk-go, a go sdk for OpenTelemetry by LogicMonitor

codecov build_and_test Go Reference Go Report Card

NOTE: This is in private beta.

LM-telemetry-sdk-go
  1. Aims to minimize adding initialization code for opentelemetry tracing, assumes default values
  2. It has implementation for cloud specific resource detectors
Installation
go get github.com/logicmonitor/lm-telemetry-sdk-go
Usage
Resource detection for cloud environments
AWS
EC2

import github.com/logicmonitor/lm-telemetry-sdk-go/resource/detectors/aws/ec2
...
lmEc2Detector := ec2.NewResourceDetector()
ctx := context.Background()
resource,err := lmEc2Detector.Detect(ctx)

ECS

import github.com/logicmonitor/lm-telemetry-sdk-go/resource/detectors/aws/ecs
...
lmEcsDetector := ecs.NewResourceDetector()
ctx := context.Background()
resource,err := lmEcsDetector.Detect(ctx)

EKS

import github.com/logicmonitor/lm-telemetry-sdk-go/resource/detectors/aws/eks
...
lmEksDetector := eks.NewResourceDetector()
ctx := context.Background()
resource,err := lmEksDetector.Detect(ctx)

Lambda

import github.com/logicmonitor/lm-telemetry-sdk-go/resource/detectors/aws/lambda
...
lmLambdaDetector := lambda.NewResourceDetector()
ctx := context.Background()
resource,err := lmLambdaDetector.Detect(ctx)

Resource Detector env config

Environment variable LM_RESOURCE_DETECTOR must be set to one of the following values, to set appropriate resource detector

Value Description
aws_ec2 AWS Elastic Compute Cloud
aws_ecs AWS Elastic Container Service
aws_eks AWS Elastic Kubernetes Service
aws_lambda AWS Lambda
gcp_compute_engine Google Cloud Compute Engine (GCE)
gcp_kubernetes_engine Google Cloud Kubernetes Engine (GKE)
gcp_cloud_functions Google Cloud Functions (GCF)

Jump to

Keyboard shortcuts

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