Giter VIP home page Giter VIP logo

pinpoint-go-agent's People

Contributors

bestgopher avatar dependabot[bot] avatar dwkang avatar hoganedwardchu avatar hwwwi avatar kjh03160 avatar smallfish06 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pinpoint-go-agent's Issues

undefined: syscall.Getrusage

I can't run on windows.It send me a lot of errors.
go:51:9: undefined: syscall.Getrusage
undefined: syscall.RUSAGE_SELF
undefined: syscall.RUSAGE_SELF

How should I do?

support echo v4 version

can not build echo plugin with echo v4 version

Cannot use 'ppecho.WrapHandler(hello)' (type "github.com/labstack/echo".HandlerFunc) as the type "github.com/labstack/echo/v4".HandlerFunc

sarama consumergroup support

Event-based applications usually use a consumer group. Currently, it seems that the pinpoint only supports the consumer, but not the consumer group.

If there is a guide, it will be pleasure, and if not, is it okay if I create a PR about this?

grpc enhancement

  • monitor the infinite wait of stream write
  • asynchronous newAgent() function

configuration profiles

# Profiles
#  - -Dpinpoint.profiler.profiles.active=release or local
#  - Modify `pinpoint.profiler.profiles.active=release` in $PINPOINT_AGENT_DIR/pinpoint-root.config
# Custom Profile
#  - 1. Create a custom profile in $PINPOINT_HOME/profiles/MyProfile
#    - Add pinpoint.config & log4j2.xml
#  - 2. -Dpinpoint.profiler.profiles.active=MyProfile
# Support external property
#  - -Dpinpoint.config=$MY_CONFIG_PATH/pinpoint.config

grpc client can't get host

grpc client cannot obtain host, but method can be obtained
grpc client无法获取host,但是可以获取到method

grpc transporter injection interace

grpc transporter

  • create grpc client for agent, span, stat, cmd
  • define grpc client interface

Agent

  • SetTransporter(t Transporter)

grpc

  • append metadata

panic recover option

Now, the recovered panic is propagated.

support an option not to propagate recovered panic.

  • spanevent
  • web framework plugins

support go-redis v7, v9 version

build fails on goredis/v7

Cannot use 'ppgoredisv8.NewHook(redisOpts)' (type "github.com/go-redis/redis/v8".Hook) as the type "github.com/go-redis/redis/v7".Hook Type does not implement 'Hook' as some methods are missing: BeforeProcess(ctx context.Context, cmd Cmder) (context.Context, error)

http excluding option

from pinpoint.config

# URLs to exclude from tracing.
# Support ant style pattern. e.g. /aa/*.html, /??/exclude.html
profiler.tomcat.excludeurl=
# HTTP Request methods to exclude from tracing
#profiler.tomcat.excludemethod=POST,PUT

max call stack option

from pinpoint-root.config

## Call Stack
# Set max depth, if -1 is unlimited and min is 2.
profiler.callstack.max.depth=64

http header recording option

from pinpoint.config

# record HTTP request headers case-sensitive
# set to HEADERS-ALL to record all of the request headers including cookie.
# e.g. profiler.http.record.request.headers=X-AccessKey,X-Device-UUID
#profiler.http.record.request.headers=

# record HTTP request cookies(case-sensitive) in Cookie header
# e.g. profiler.http.record.request.cookies=userid,device-id,uuid
#profiler.http.record.request.cookies=

# record HTTP response headers case-sensitive
# set to HEADERS-ALL to record all of the headers.
# e.g. profiler.http.record.response.headers=Set-Cookie
#profiler.http.record.response.headers=

invalid handler name from echo plugins

Description

It returns the wrong handler name from echo and echov4 plugins.

How to reproduce

package main

import (
	"errors"
	"log"
	"os"

	"github.com/labstack/echo/v4"
	"github.com/pinpoint-apm/pinpoint-go-agent"
	"github.com/pinpoint-apm/pinpoint-go-agent/plugin/echov4"
)

func hello(c echo.Context) error {
	return c.String(200, "Hello World!!")
}

func hello2(c echo.Context) error {
	return c.String(200, "Hello World2!!")
}

func myError(c echo.Context) error {
	tracer := pinpoint.TracerFromRequestContext(c.Request())
	tracer.SpanEvent().SetError(errors.New("my error message"))

	return c.String(500, "Error!!")
}

func main() {
	opts := []pinpoint.ConfigOption{
		pinpoint.WithAppName("GoEchov4Test"),
		pinpoint.WithAgentId("GoEchov4TestAgent"),
		pinpoint.WithConfigFile(os.Getenv("HOME") + "/tmp/pinpoint-config.yaml"),
	}
	cfg, _ := pinpoint.NewConfig(opts...)
	agent, err := pinpoint.NewAgent(cfg)
	if err != nil {
		log.Fatalf("pinpoint agent start fail: %v", err)
	}
	defer agent.Shutdown()

	e := echo.New()

	e.Use(ppechov4.Middleware())
	e.GET("/hello", hello)
	e.POST("/hello", hello2)
	
	e.Start(":9000")
}

The handler GET /hello and POST /hello will show the same handler name. (either hello or hello2 depending on the order)

real ip header option

from pinpoint-root.config

# Original IP address header. e.g. X-Forwarded-For or X-Real-IP
# https://en.wikipedia.org/wiki/X-Forwarded-For
profiler.server.realipheader=X-Forwarded-For

segmentation violation when used in a goroutine scope

sometimes panic when used in a goroutine scope,

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xad8fe2]
goroutine 6372 [running]:
container/list.(*List).remove(...)
/usr/local/go/src/container/list/list.go:109
container/list.(*List).Remove(...)
/usr/local/go/src/container/list/list.go:141
github.com/pinpoint-apm/pinpoint-go-agent.(*span).EndSpanEvent(0xc00019a3c0)
github.com/pinpoint-apm/pinpoint-go-agent.(*PinpointSqlStmt).QueryContext(0xc001026048, 0x1178040, 0xc001c98ea0, 0xc0015604b0, 0x1, 0x1, 0x40fcb8, 0x10, 0xe785c0, 0x203001)
23
/go/pkg/mod/github.com/pinpoint-apm/[email protected]/sql_driver.go:218 +0x178

There is an error when implementing the type DBTX interface (SQLC code generator) with the pgsql driver pinpoint plugin

Code overview :
// load DB
import (
"database/sql"
"fmt"
"net/url"
"time"
_ "github.com/pinpoint-apm/pinpoint-go-agent/plugin/pgsql" // use wrapped postgres driver
)
func (conf DBConf) loadDB() *sql.DB {
newDB, err := sql.Open("pq-pinpoint", connectionString)
return newDB
}

`// Code generated by sqlc. DO NOT EDIT.

package postgres

import (
"context"
"database/sql"
)

type DBTX interface {
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
PrepareContext(context.Context, string) (*sql.Stmt, error)
QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

func New(db DBTX) *Queries {
return &Queries{db: db}
}

type Queries struct {
db DBTX
}

func (q *Queries) WithTx(tx *sql.Tx) *Queries {
return &Queries{
db: tx,
}
}

func (q *Queries) QueryGetTbGuestById(ctx context.Context, id string) (TbTransactionDelivery, error) {
row := q.db.QueryRowContext(ctx, queryGetTbGuestById, id)
var i TbTransactionDelivery
err := row.Scan(
&i.Id,
&i.Name,
)
return i, err
}
`

Error :
interface conversion: *pq.conn is not driver.NamedValueChecker: missing method CheckNamedValue"

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.