mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 08:27:26 +02:00
add metrics aggregation (#3452)
This commit is contained in:
parent
86625a4ddb
commit
f67b33484b
7 changed files with 229 additions and 77 deletions
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/pomerium/pomerium/internal/fileutil"
|
||||
"github.com/pomerium/pomerium/internal/log"
|
||||
"github.com/pomerium/pomerium/internal/telemetry/metrics"
|
||||
"github.com/pomerium/pomerium/pkg/netutil"
|
||||
)
|
||||
|
||||
// A ChangeListener is called when configuration changes.
|
||||
|
@ -115,10 +116,13 @@ func NewFileOrEnvironmentSource(
|
|||
EnvoyVersion: envoyVersion,
|
||||
}
|
||||
|
||||
if err = cfg.AllocatePorts(); err != nil {
|
||||
ports, err := netutil.AllocatePorts(5)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("allocating ports: %w", err)
|
||||
}
|
||||
|
||||
cfg.AllocatePorts(*(*[5]string)(ports))
|
||||
|
||||
metrics.SetConfigInfo(ctx, cfg.Options.Services, "local", cfg.Checksum(), true)
|
||||
|
||||
src := &FileOrEnvironmentSource{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue