Callback - APMPlus

Eino encapsulates APMPlus’s trace and metrics capabilities based on Eino: Callback Manual capabilities (see DocumentConsole).

An example usage is as follows:

package main

import (
    "context"
    "log"
    
    "github.com/cloudwego/eino-ext/callbacks/apmplus"
    "github.com/cloudwego/eino/callbacks"
)

func main() {
    ctx := context.Background()
    // Create apmplus handler
    cbh, showdown, err := apmplus.NewApmplusHandler(&apmplus.Config{
       Host: "apmplus-cn-beijing.volces.com:4317",
       AppKey:      "appkey-xxx",
       ServiceName: "eino-app",
       Release:     "release/v0.0.1",
    })
    if err != nil {
       log.Fatal(err)
    }

    // Set apmplus as a global callback
    callbacks.InitCallbackHandlers([]callbacks.Handler{cbh})
    
    g := NewGraph[string,string]()
    /*
     * compose and run graph
     */
    
    // Exit after all trace and metrics reporting is complete
    showdown(ctx)
}

You can view the trace and metrics in the APMPlus:


Last modified March 28, 2025 : docs: eino graph update (#1293) (aea58cb)