Skip to content

Commit

Permalink
feat(access-logging): Remove otel logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ldebruijn committed Jun 4, 2024
1 parent ad81929 commit dbd7937
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions docs/protections/access_logging.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Access Logging

In some cases you want to keep a record of what operations were performed against your landscape. The access logging protection can provide that for you.
Access logging is done to STDOUT.

<!-- TOC -->

Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/prometheus/client_golang v1.19.1
github.com/stretchr/testify v1.9.0
github.com/vektah/gqlparser/v2 v2.5.12
go.opentelemetry.io/contrib/bridges/otelslog v0.2.0
go.opentelemetry.io/contrib/exporters/autoexport v0.52.0
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.52.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0
Expand Down Expand Up @@ -62,7 +61,6 @@ require (
go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0 // indirect
go.opentelemetry.io/otel/log v0.3.0 // indirect
go.opentelemetry.io/otel/metric v1.27.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.27.0 // indirect
go.opentelemetry.io/otel/trace v1.27.0 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/collector/pdata v1.7.0 h1:/WNsBbE6KM3TTPUb9v/5B7IDqnDkgf8GyFhVJJqu7II=
go.opentelemetry.io/collector/pdata v1.7.0/go.mod h1:ehCBBA5GoFrMZkwyZAKGY/lAVSgZf6rzUt3p9mddmPU=
go.opentelemetry.io/contrib/bridges/otelslog v0.2.0 h1:8wisJ9dZUU1YZGJDsQgfCkexQ/zsZF1SZB6Z86j4WJA=
go.opentelemetry.io/contrib/bridges/otelslog v0.2.0/go.mod h1:/fUobpnNkWPrkMb7HKL80Ewfkqzyko1KUUX0h7aNtxo=
go.opentelemetry.io/contrib/bridges/prometheus v0.52.0 h1:NNkEjNcUXeNcxDTNLyyAmFHefByhj8YU1AojgcPqbfs=
go.opentelemetry.io/contrib/bridges/prometheus v0.52.0/go.mod h1:Dv7d2yUvusfblvi9qMQby+youF09GiUVWRWkdogrDtE=
go.opentelemetry.io/contrib/exporters/autoexport v0.52.0 h1:G/AGl5O78ZKHs63Rl65P1HyZfDnTyxjv8r7dbdZ9fB0=
Expand Down Expand Up @@ -169,8 +167,6 @@ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0 h1:/jlt1Y8gXWiHG9
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.27.0/go.mod h1:bmToOGOBZ4hA9ghphIc1PAf66VA8KOtsuy3+ScStG20=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0 h1:/0YaXu3755A/cFbtXp+21lkXgI0QE5avTWA2HjU9/WE=
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.27.0/go.mod h1:m7SFxp0/7IxmJPLIY3JhOcU9CoFzDaCPL6xxQIxhA+o=
go.opentelemetry.io/otel/log v0.3.0 h1:kJRFkpUFYtny37NQzL386WbznUByZx186DpEMKhEGZs=
go.opentelemetry.io/otel/log v0.3.0/go.mod h1:ziCwqZr9soYDwGNbIL+6kAvQC+ANvjgG367HVcyR/ys=
go.opentelemetry.io/otel/metric v1.27.0 h1:hvj3vdEKyeCi4YaYfNjv2NUje8FqKqUY8IlF0FxV/ik=
go.opentelemetry.io/otel/metric v1.27.0/go.mod h1:mVFgmRlhljgBiuk/MP/oKylr4hs85GZAylncepAX/ak=
go.opentelemetry.io/otel/sdk v1.27.0 h1:mlk+/Y1gLPLn84U4tI8d3GNJmGT/eXe3ZuOXN9kTWmI=
Expand Down
2 changes: 1 addition & 1 deletion internal/business/protect/protect.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewGraphQLProtect(log *slog.Logger, cfg *config.Config, po *persistedoperat
aliases.NewMaxAliasesRule(cfg.MaxAliases)
max_depth.NewMaxDepthRule(cfg.MaxDepth)
maxBatch, err := batch.NewMaxBatch(cfg.MaxBatch)
accessLogging := accesslogging.NewAccessLogging(cfg.AccessLogging)
accessLogging := accesslogging.NewAccessLogging(cfg.AccessLogging, log)
if err != nil {
log.Warn("Error initializing maximum batch protection", err)
}
Expand Down
6 changes: 2 additions & 4 deletions internal/business/rules/accesslogging/accesslogging.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package accesslogging

import (
"github.com/ldebruijn/graphql-protect/internal/business/gql"
"go.opentelemetry.io/contrib/bridges/otelslog"
"log/slog"
"net/http"
"slices"
Expand All @@ -21,10 +20,9 @@ type AccessLogging struct {
cfg Config
}

func NewAccessLogging(cfg Config) *AccessLogging {
func NewAccessLogging(cfg Config, log *slog.Logger) *AccessLogging {
return &AccessLogging{
// otelslog bridge for pushing otellogs directly to connector
log: otelslog.NewLogger("access-logging"),
log: log.WithGroup("access-logging"),
cfg: cfg,
}
}
Expand Down

0 comments on commit dbd7937

Please sign in to comment.