easeagent-sdk-go
A lightweight & opening Go SDK for Cloud-Native and APM system
Overview
- EaseAgent SDK can collect distributed application tracing, which could be used in the APM system and improve the observability of a distributed system. for the tracing, EaseAgent SDK follows the Google Dapper paper and use zipkin-go core library.
- EaseAgent SDK also can work with Cloud-Native architecture. For example, it can help Service Mesh (especially for EaseMesh ) to do some control panel work.
- EaseAgent SDK also can work with MegaEase Cloud. For example, it can monitor for service by Go Docker APP.
Principles
- Safe to Go application/service.
- Lightweight and very low CPU, memory, and I/O resource usage.
- Highly extensible, users can easily do extensions through the api
- Design for Micro-Service architecture, collecting the data from a service perspective.
Features
QuickStart
Init Agent
1. Get SDK
go get github.com/megaease/easeagent-sdk-go
2. Import package
import (
"github.com/megaease/easeagent-sdk-go/agent"
"github.com/megaease/easeagent-sdk-go/plugins/zipkin"
)
3. New Agent
// new tracing agent from yaml file and sets host and port of Span.localEndpoint
// By default, use yamlFile="" is use easemesh.DefaultSpec() and Console Reporter for tracing.
// By default, use localHostPort="" is not set host and port of Span.localEndpoint.
var easeagent, _ = agent.NewWithOptions(agent.WithYAML(os.Getenv("EASEAGENT_CONFIG"), ":8090"))
Wrapping HTTP Server
func main() {
// initialize router
router := http.NewServeMux()
http.ListenAndServe(":8090", easeagent.WrapUserHandler(router))
}
Documentation
About Config
Example
-
HTTP example
-
mesh example
About MegaEase Cloud
- Use SDK in MegaEase Cloud
- Get MegaEase Cloud Config. About MegaEase Cloud Config
- Decorate the Span. please use api:
zipkin.Tracing.StartMWSpan
and zipkin.Tracing.StartMWSpanFromCtx
for decorate Span.
If you have any questions, welcome to discuss them in our community. Welcome to join!
Licenses
EaseAgent Go SDK is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.