feat 编译时插桩
This commit is contained in:
3
deploy/Jenkinsfile
vendored
3
deploy/Jenkinsfile
vendored
@@ -58,12 +58,13 @@ pipeline {
|
|||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
sh """
|
sh """
|
||||||
|
go install github.com/DataDog/orchestrion@latest
|
||||||
export GOPROXY=https://goproxy.cn,direct
|
export GOPROXY=https://goproxy.cn,direct
|
||||||
export CGO_ENABLED=0
|
export CGO_ENABLED=0
|
||||||
export GOOS=linux
|
export GOOS=linux
|
||||||
export GOARCH=amd64
|
export GOARCH=amd64
|
||||||
|
|
||||||
go build -o ${env.APP_NAME} .
|
orchestrion go build -o ${env.APP_NAME} .
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ type TopicQuestionAnswer struct {
|
|||||||
|
|
||||||
func startConsumer() {
|
func startConsumer() {
|
||||||
kafka.NewConsumer().Consume("qgdzs.question.answer", func(ctx context.Context, msg *sarama.ConsumerMessage) error {
|
kafka.NewConsumer().Consume("qgdzs.question.answer", func(ctx context.Context, msg *sarama.ConsumerMessage) error {
|
||||||
log.Infof("qgdzs.question.answer: %s", string(msg.Value))
|
log.Infof("Kafka topic: qgdzs.question.answer: %s", string(msg.Value))
|
||||||
data := &TopicQuestionAnswer{}
|
data := &TopicQuestionAnswer{}
|
||||||
if err := json.Unmarshal(msg.Value, &data); err != nil {
|
if err := json.Unmarshal(msg.Value, &data); err != nil {
|
||||||
return utils.ErrorsWrap(err)
|
return utils.ErrorsWrap(err)
|
||||||
|
|||||||
23
orchestrion.tool.go
Normal file
23
orchestrion.tool.go
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// This file was created by `orchestrion pin`, and is used to ensure the
|
||||||
|
// `go.mod` file contains the necessary entries to ensure repeatable builds when
|
||||||
|
// using `orchestrion`. It is also used to set up which integrations are enabled.
|
||||||
|
|
||||||
|
//go:build tools
|
||||||
|
|
||||||
|
//go:generate go run github.com/DataDog/orchestrion pin -generate
|
||||||
|
|
||||||
|
package tools
|
||||||
|
|
||||||
|
// Imports in this file determine which tracer integrations are enabled in
|
||||||
|
// orchestrion. New integrations can be automatically discovered by running
|
||||||
|
// `orchestrion pin` again. You can also manually add new imports here to
|
||||||
|
// enable additional integrations. When doing so, you can run `orchestrion pin`
|
||||||
|
// to make sure manually added integrations are valid (i.e, the imported package
|
||||||
|
// includes a valid `orchestrion.yml` file).
|
||||||
|
import (
|
||||||
|
// Ensures `orchestrion` is present in `go.mod` so that builds are repeatable.
|
||||||
|
// Do not remove.
|
||||||
|
_ "github.com/DataDog/orchestrion" // integration
|
||||||
|
|
||||||
|
_ "github.com/DataDog/dd-trace-go/orchestrion/all/v2" // integration
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user