Skip to content

Commit

Permalink
Merge pull request #362 from Permify/build-bugs
Browse files Browse the repository at this point in the history
fix: machine id error
  • Loading branch information
tolgaOzen authored Apr 3, 2023
2 parents 1d94fa0 + b1d5afd commit 911c625
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 20 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ RUN CGO_ENABLED=0 go build -v ./cmd/permify/

# Step 2: Final
FROM cgr.dev/chainguard/static:latest
EXPOSE 3476
EXPOSE 3478
COPY --from=ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.12 /ko-app/grpc-health-probe /usr/local/bin/grpc_health_probe
COPY --from=permify-builder /go/src/app/permify /usr/local/bin/permify
ENTRYPOINT ["permify"]
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
github.com/cenkalti/backoff/v4 v4.2.0
github.com/cespare/xxhash v1.1.0
github.com/denisbrodbeck/machineid v1.0.1
github.com/denisenkom/go-mssqldb v0.12.3
github.com/dgraph-io/ristretto v0.1.1
github.com/dustin/go-humanize v1.0.1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ github.com/dave/jennifer v1.4.1/go.mod h1:7jEdnm+qBcxl8PC0zyp7vxcpSRnzXSt9r39tpT
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMSRhl4D7AQ=
github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI=
github.com/denisenkom/go-mssqldb v0.12.3 h1:pBSGx9Tq67pBOTLmxNuirNTeB8Vjmf886Kx+8Y+8shw=
github.com/denisenkom/go-mssqldb v0.12.3/go.mod h1:k0mtMFOnU+AihqFxPMiF05rtiDrorD1Vrm1KEz5hxDo=
github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra"

`github.com/Permify/permify/internal`
"github.com/Permify/permify/internal"
)

// NewVersionCommand - Creates new Version command
Expand Down
9 changes: 2 additions & 7 deletions pkg/telemetry/meter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"runtime"
"time"

"github.com/denisbrodbeck/machineid"
"github.com/rs/xid"

"go.opentelemetry.io/contrib/instrumentation/host"
orn "go.opentelemetry.io/contrib/instrumentation/runtime"
Expand All @@ -31,17 +31,12 @@ func NewMeter(exporter metric.Exporter) (omt.Meter, error) {
return nil, err
}

id, err := machineid.ProtectedID("permify")
if err != nil {
return nil, err
}

mp := metric.NewMeterProvider(
metric.WithReader(metric.NewPeriodicReader(exporter)),
metric.WithResource(resource.NewWithAttributes(
semconv.SchemaURL,
semconv.ServiceNameKey.String("permify"),
attribute.String("id", id),
attribute.String("id", xid.New().String()),
attribute.String("version", internal.Version),
attribute.String("host_name", hostName),
attribute.String("os", runtime.GOOS),
Expand Down
9 changes: 2 additions & 7 deletions pkg/telemetry/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"runtime"

"github.com/denisbrodbeck/machineid"
"github.com/rs/xid"

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
Expand All @@ -23,17 +23,12 @@ func NewTracer(exporter trace.SpanExporter) func(context.Context) error {
return func(context.Context) error { return nil }
}

id, err := machineid.ProtectedID("permify")
if err != nil {
return func(context.Context) error { return nil }
}

tp := trace.NewTracerProvider(
trace.WithSpanProcessor(trace.NewBatchSpanProcessor(exporter)),
trace.WithResource(resource.NewWithAttributes(
semconv.SchemaURL,
semconv.ServiceNameKey.String("permify"),
attribute.String("id", id),
attribute.String("id", xid.New().String()),
attribute.String("version", internal.Version),
attribute.String("host_name", hostName),
attribute.String("os", runtime.GOOS),
Expand Down

0 comments on commit 911c625

Please sign in to comment.