Skip to content

Commit f45e8d0

Browse files
authored
Merge 676d765 into 262ebbb
2 parents 262ebbb + 676d765 commit f45e8d0

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

cmd/server/handler.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/ory/x/corsx"
1818
"github.com/ory/x/httprouterx"
1919

20-
analytics "github.com/ory/analytics-go/v5"
20+
"github.com/ory/analytics-go/v5"
2121
"github.com/ory/x/configx"
2222

2323
"github.com/ory/x/reqlog"
@@ -223,11 +223,8 @@ func setup(ctx context.Context, d driver.Registry, cmd *cobra.Command) (admin *h
223223
d.Logger(),
224224
d.Config().Source(ctx),
225225
&metricsx.Options{
226-
Service: "ory-hydra",
227-
DeploymentId: metricsx.Hash(fmt.Sprintf("%s|%s",
228-
d.Config().IssuerURL(ctx).String(),
229-
d.Config().DSN(),
230-
)),
226+
Service: "hydra",
227+
DeploymentId: metricsx.Hash(d.Persister().NetworkID(ctx).String()),
231228
IsDevelopment: d.Config().DSN() == "memory" ||
232229
d.Config().IssuerURL(ctx).String() == "" ||
233230
strings.Contains(d.Config().IssuerURL(ctx).String(), "localhost"),

persistence/definitions.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ package persistence
66
import (
77
"context"
88

9+
"github.com/gofrs/uuid"
10+
11+
"github.com/ory/x/networkx"
12+
913
"github.com/gobuffalo/pop/v6"
1014

1115
"github.com/ory/hydra/v2/client"
@@ -30,8 +34,14 @@ type (
3034
PrepareMigration(context.Context) error
3135
Connection(context.Context) *pop.Connection
3236
Ping() error
37+
Networker
3338
}
3439
Provider interface {
3540
Persister() Persister
3641
}
42+
43+
Networker interface {
44+
NetworkID(ctx context.Context) uuid.UUID
45+
DetermineNetwork(ctx context.Context) (*networkx.Network, error)
46+
}
3747
)

0 commit comments

Comments
 (0)