Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/manager.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
server_endpoint: ws://127.0.0.1:4320/v1/opamp
org_id: 3135a17c-9f4a-441b-b726-e0c6174a3244
4 changes: 4 additions & 0 deletions opamp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
type AgentManagerConfig struct {
ServerEndpoint string `yaml:"server_endpoint"`
ID string `yaml:"id,omitempty"`
OrgID string `yaml:"org_id,omitempty"`
}

func ParseAgentManagerConfig(configLocation string) (*AgentManagerConfig, error) {
Expand All @@ -32,6 +33,9 @@ func ParseAgentManagerConfig(configLocation string) (*AgentManagerConfig, error)
// generate ulid if not provided
config.ID = ulid.MustNew(ulid.Now(), nil).String()
}
if config.OrgID == "" {
config.OrgID = "SIGNOZ##DEFAULT##ORG##ID"
}

return &config, nil
}
3 changes: 3 additions & 0 deletions opamp/server_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type serverClient struct {
configManager *agentConfigManager
managerConfig AgentManagerConfig
instanceId ulid.ULID
orgId string
receivedInitialConfig bool
mux sync.Mutex
}
Expand Down Expand Up @@ -65,6 +66,7 @@ func NewServerClient(args *NewServerClientOpts) (Client, error) {
configManager: configManager,
managerConfig: *args.Config,
mux: sync.Mutex{},
orgId: args.Config.OrgID,
}
svrClient.createInstanceId()

Expand Down Expand Up @@ -101,6 +103,7 @@ func (s *serverClient) createAgentDescription() *protobufs.AgentDescription {
IdentifyingAttributes: []*protobufs.KeyValue{
keyVal("service.name", "signoz-otel-collector"),
keyVal("service.version", constants.Version),
keyVal("orgId", s.orgId),
},
NonIdentifyingAttributes: []*protobufs.KeyValue{
keyVal("os.family", runtime.GOOS),
Expand Down
Loading