Skip to content

Commit 83d5da8

Browse files
authored
Merge pull request #50 from arugal/patch
[Plugin-SkyWalking] Report pod name and namespace
2 parents 798fc07 + c513fa5 commit 83d5da8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

plugin/skywalking/plugin-skywalking.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ func (k klogWrapper) Errorf(format string, args ...interface{}) {
5757

5858
func initGo2sky(ofCtx ofctx.RuntimeContext, p *PluginSkywalking) {
5959
initGo2skyOnce.Do(func() {
60-
r, err := reporter.NewGRPCReporter(ofCtx.GetPluginsTracingCfg().ProviderOapServer(), reporter.WithFAASLayer(), reporter.WithLog(&klogWrapper{}))
60+
instanceProps := make(map[string]string)
61+
instanceProps["pod"] = ofCtx.GetPodName()
62+
instanceProps["namespace"] = ofCtx.GetPodNamespace()
63+
r, err := reporter.NewGRPCReporter(ofCtx.GetPluginsTracingCfg().ProviderOapServer(), reporter.WithFAASLayer(), reporter.WithInstanceProps(instanceProps), reporter.WithLog(&klogWrapper{}))
6164
if err != nil {
6265
klog.Errorf("new go2sky grpc reporter error\n", err)
6366
return

0 commit comments

Comments
 (0)