GithubHelp home page GithubHelp logo

eeliu / go-aop-agent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pinpoint-apm/go-aop-agent

0.0 0.0 0.0 627 KB

It is an agent written by C++, PHP, python languages. And we hope to support other languages by this agent. Until now, it supports [PHP],[C/C++], [GOLANG] and [PYTHON].

License: Apache License 2.0

C 71.89% Go 27.26% HTML 0.66% Shell 0.06% CMake 0.12%

go-aop-agent's Introduction

Build codecov

Getting Started

Requirement

Dependency Version More
GO go1.13+
cpu arch amd64(x86_64)
*nux

Pre-requirement

Quicklystart

  1. Add pinpoint.go under the root of your project. pinpoint.go

    package main
    
    // only import libs you cared
    
    import (
        "github.com/pinpoint-apm/go-aop-agent/common"
        _ "github.com/pinpoint-apm/go-aop-agent/libs/example"
        _ "github.com/pinpoint-apm/go-aop-agent/libs/httpClient"
        _ "github.com/pinpoint-apm/go-aop-agent/libs/mongo"
        _ "github.com/pinpoint-apm/go-aop-agent/libs/redisv8"
        _ "github.com/pinpoint-apm/go-aop-agent/libs/sql"
    )
    
    func init() {
        init_pinpoint()
    }
    
    func init_pinpoint() {
        common.Pinpoint_enable_debug_report(true) //open pinpoint debug log
        common.Pinpoint_set_collect_agent_host("tcp:127.0.0.1@9999") // set the collector agent(Installed in step of `Install Collector Agent`), it should be consistent with `PP_ADDRESS`
        common.Pinpoint_set_trace_limit(10) // set the sample rate: `-1`: not limit, all requests with be sampled. `0`: not sample, no requets will be sampled. `n`: n requests will be sampled every seconed.
        common.Appname = "go-agent1" // set Appname
        common.Appid = "Go-Agent1" // set Appid
    }
    
    
  2. Import pinpoint middleware into your project(mux framework for example):

    package main
    ...
    import (
    ...
    pinpoint "github.com/pinpoint-apm/go-aop-agent/middleware/mux"
    )
    
    router := mux.NewRouter()
    // add pinpoint middleware
    router.Use(pinpoint.PinpointMuxMiddleWare) // <-- add middleware
    ...
    
  3. At last, execute go mod download.

Build your project in build-env

If your project deploy as docker images, use golang-build-env-1.16 as your builder image.

There are some examples in testapps and CI-action, hopes these can help your ! ✨

echo framework

mux framework

ServerMap and callstack

pinpoint,supports distributed tracking

java-go-php-py-server-map

java-go-php-py-server-map

Callstack

Callstack

Framework, library supported

Library Version
[net/http] ~
[mongo-driver/mongo] v1.5.3
[coreos/etcd/clientv3] v3.3.25+incompatible
[go-redis/redis/v8] v8.11.0
[database/sql] ~
Framework (middleware) Version
mux ~
echo v3.3.10+incompatible
echo v4.3.0

More libraries and frameworks is coming soon. Welcome for contribution and suggestion.

TestApps

Example of mux and echo testapp

License

This project is licensed under the Apache License, Version 2.0. See LICENSE for full license text.

Copyright 2021-present NAVER Corp.

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.

go-aop-agent's People

Contributors

eeliu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.