mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-09-18 12:04:41 -04:00
Add node name to early boot logging (#323)
Signed-off-by: Fabian Kammel <fk@edgeless.systems>
This commit is contained in:
parent
050e8fdc4a
commit
19b731b5f7
1 changed files with 8 additions and 1 deletions
|
@ -39,9 +39,16 @@ func NewLogger(ctx context.Context, metadata *Metadata) (*Logger, error) {
|
||||||
if resp.Properties == nil || resp.Properties.InstrumentationKey == nil {
|
if resp.Properties == nil || resp.Properties.InstrumentationKey == nil {
|
||||||
return nil, errors.New("unable to get instrumentation key")
|
return nil, errors.New("unable to get instrumentation key")
|
||||||
}
|
}
|
||||||
|
client := appinsights.NewTelemetryClient(*resp.Properties.InstrumentationKey)
|
||||||
|
|
||||||
|
instance, err := metadata.GetInstance(ctx, providerID)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
client.Context().CommonProperties["instance-name"] = instance.Name
|
||||||
|
|
||||||
return &Logger{
|
return &Logger{
|
||||||
client: appinsights.NewTelemetryClient(*resp.Properties.InstrumentationKey),
|
client: client,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue