mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 01:09:36 +02:00
zero/telemetry: add hostname and version (#5146)
This commit is contained in:
parent
7eca911292
commit
a7dd30ad29
3 changed files with 98 additions and 65 deletions
|
@ -5,11 +5,13 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/version"
|
||||
"github.com/pomerium/pomerium/internal/zero/apierror"
|
||||
"github.com/pomerium/pomerium/pkg/fanout"
|
||||
"github.com/pomerium/pomerium/pkg/health"
|
||||
|
@ -69,7 +71,14 @@ func (svc *Mux) subscribeAndDispatch(ctx context.Context, onConnected func()) (e
|
|||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
stream, err := svc.client.Subscribe(ctx, &connect.SubscribeRequest{})
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
hostname = "__unknown__"
|
||||
}
|
||||
stream, err := svc.client.Subscribe(ctx, &connect.SubscribeRequest{
|
||||
Hostname: hostname,
|
||||
Version: version.FullVersion(),
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("subscribe: %w", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue