Skip to content

Commit

Permalink
chore: bump dskit dependency (#2873)
Browse files Browse the repository at this point in the history
* chore: move spanprofiler to dskit

* chore: compatibility fix

* chore: go mod

* chore: fix tests
  • Loading branch information
kolesnikovae committed Dec 21, 2023
1 parent 35d4dc6 commit c054c6b
Show file tree
Hide file tree
Showing 20 changed files with 173 additions and 495 deletions.
113 changes: 113 additions & 0 deletions api/gen/proto/go/settings/v1/setting_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion cmd/pyroscope/help-all.txt.tmpl
Expand Up @@ -771,6 +771,8 @@ Usage of ./pyroscope:
Duration after which a keepalive probe is sent in case of no activity over the connection., Default: 2h (default 2h0m0s)
-server.grpc.keepalive.timeout duration
After having pinged for keepalive check, the duration after which an idle connection should be closed, Default: 20s (default 20s)
-server.grpc.num-workers int
If non-zero, configures the amount of GRPC server workers used to serve the requests.
-server.http-conn-limit int
Maximum number of simultaneous http connections, <=0 to disable
-server.http-idle-timeout duration
Expand All @@ -781,8 +783,12 @@ Usage of ./pyroscope:
HTTP server listen network, default tcp (default "tcp")
-server.http-listen-port int
HTTP server listen port. (default 4040)
-server.http-log-closed-connections-without-response-enabled
Log closed connections that did not receive any response, most likely because client didn't send any request within timeout.
-server.http-read-header-timeout duration
Read timeout for HTTP request headers. If set to 0, value of -server.http-read-timeout is used.
-server.http-read-timeout duration
Read timeout for HTTP server (default 30s)
Read timeout for entire HTTP request, including headers and body. (default 30s)
-server.http-tls-ca-path string
HTTP TLS Client CA path.
-server.http-tls-cert-path string
Expand All @@ -809,6 +815,8 @@ Usage of ./pyroscope:
Base path to serve all API routes from (e.g. /v1/)
-server.register-instrumentation
Register the intrumentation handlers (/metrics etc). (default true)
-server.report-grpc-codes-in-instrumentation-label-enabled
If set to true, gRPC statuses will be reported in instrumentation labels with their string representations. Otherwise, they will be reported as "error".
-server.tls-cipher-suites string
Comma-separated list of cipher suites to use. If blank, the default Go cipher suites is used.
-server.tls-min-version string
Expand Down
10 changes: 9 additions & 1 deletion cmd/pyroscope/help.txt.tmpl
Expand Up @@ -219,6 +219,8 @@ Usage of ./pyroscope:
Duration after which a keepalive probe is sent in case of no activity over the connection., Default: 2h (default 2h0m0s)
-server.grpc.keepalive.timeout duration
After having pinged for keepalive check, the duration after which an idle connection should be closed, Default: 20s (default 20s)
-server.grpc.num-workers int
If non-zero, configures the amount of GRPC server workers used to serve the requests.
-server.http-conn-limit int
Maximum number of simultaneous http connections, <=0 to disable
-server.http-idle-timeout duration
Expand All @@ -229,8 +231,12 @@ Usage of ./pyroscope:
HTTP server listen network, default tcp (default "tcp")
-server.http-listen-port int
HTTP server listen port. (default 4040)
-server.http-log-closed-connections-without-response-enabled
Log closed connections that did not receive any response, most likely because client didn't send any request within timeout.
-server.http-read-header-timeout duration
Read timeout for HTTP request headers. If set to 0, value of -server.http-read-timeout is used.
-server.http-read-timeout duration
Read timeout for HTTP server (default 30s)
Read timeout for entire HTTP request, including headers and body. (default 30s)
-server.http-tls-ca-path string
HTTP TLS Client CA path.
-server.http-tls-cert-path string
Expand All @@ -257,6 +263,8 @@ Usage of ./pyroscope:
Base path to serve all API routes from (e.g. /v1/)
-server.register-instrumentation
Register the intrumentation handlers (/metrics etc). (default true)
-server.report-grpc-codes-in-instrumentation-label-enabled
If set to true, gRPC statuses will be reported in instrumentation labels with their string representations. Otherwise, they will be reported as "error".
-server.tls-cipher-suites string
Comma-separated list of cipher suites to use. If blank, the default Go cipher suites is used.
-server.tls-min-version string
Expand Down
Expand Up @@ -371,14 +371,24 @@ grpc_tls_config:
# CLI flag: -server.register-instrumentation
[register_instrumentation: <boolean> | default = true]

# If set to true, gRPC statuses will be reported in instrumentation labels with
# their string representations. Otherwise, they will be reported as "error".
# CLI flag: -server.report-grpc-codes-in-instrumentation-label-enabled
[report_grpc_codes_in_instrumentation_label_enabled: <boolean> | default = false]

# Timeout for graceful shutdowns
# CLI flag: -server.graceful-shutdown-timeout
[graceful_shutdown_timeout: <duration> | default = 30s]

# Read timeout for HTTP server
# Read timeout for entire HTTP request, including headers and body.
# CLI flag: -server.http-read-timeout
[http_server_read_timeout: <duration> | default = 30s]

# Read timeout for HTTP request headers. If set to 0, value of
# -server.http-read-timeout is used.
# CLI flag: -server.http-read-header-timeout
[http_server_read_header_timeout: <duration> | default = 0s]

# Write timeout for HTTP server
# CLI flag: -server.http-write-timeout
[http_server_write_timeout: <duration> | default = 30s]
Expand All @@ -387,6 +397,11 @@ grpc_tls_config:
# CLI flag: -server.http-idle-timeout
[http_server_idle_timeout: <duration> | default = 2m]

# Log closed connections that did not receive any response, most likely because
# client didn't send any request within timeout.
# CLI flag: -server.http-log-closed-connections-without-response-enabled
[http_log_closed_connections_without_response_enabled: <boolean> | default = false]

# Limit on the size of a gRPC message this server can receive (bytes).
# CLI flag: -server.grpc-max-recv-msg-size-bytes
[grpc_server_max_recv_msg_size: <int> | default = 4194304]
Expand Down Expand Up @@ -437,6 +452,11 @@ grpc_tls_config:
# CLI flag: -server.grpc.keepalive.ping-without-stream-allowed
[grpc_server_ping_without_stream_allowed: <boolean> | default = false]

# If non-zero, configures the amount of GRPC server workers used to serve the
# requests.
# CLI flag: -server.grpc.num-workers
[grpc_server_num_workers: <int> | default = 0]

# Output log messages in the given format. Valid formats: [logfmt, json]
# CLI flag: -log.format
[log_format: <string> | default = "logfmt"]
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Expand Up @@ -26,10 +26,10 @@ require (
github.com/google/uuid v1.3.1
github.com/gorilla/mux v1.8.0
github.com/grafana/agent v0.35.4
github.com/grafana/dskit v0.0.0-20231003142331-80423d8864b9
github.com/grafana/dskit v0.0.0-20231221015914-de83901bf4d6
github.com/grafana/jfr-parser v0.7.2-0.20230831140626-08fa3a941bf8
github.com/grafana/pyroscope-go v1.0.3
github.com/grafana/pyroscope-go/godeltaprof v0.1.6-0.20231130084046-2eb5d49453c0
github.com/grafana/pyroscope-go/godeltaprof v0.1.6
github.com/grafana/pyroscope/api v0.2.0
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Expand Up @@ -383,8 +383,8 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/grafana/agent v0.35.4 h1:5MBSSZIB8qwDJRfeMndSTJpeHAFnz68O2DeTT/AZN2A=
github.com/grafana/agent v0.35.4/go.mod h1:/NHq7TBP8AcX5ucJCgtbM7s5CyTnn7JDAsXKXvPsetQ=
github.com/grafana/dskit v0.0.0-20231003142331-80423d8864b9 h1:0AW7GXOOSE5XFQhDHTPT1c6XdlHuGxFNGpLfyi1xg1U=
github.com/grafana/dskit v0.0.0-20231003142331-80423d8864b9/go.mod h1:byPCvaG/pqi33Kq+Wvkp7WhLfmrlyy0RAoYG4yRh01I=
github.com/grafana/dskit v0.0.0-20231221015914-de83901bf4d6 h1:Z78JZ7pa6InQ5BcMB27M+NMTZ7LV+MXgOd3dZPfEdG4=
github.com/grafana/dskit v0.0.0-20231221015914-de83901bf4d6/go.mod h1:kkWM4WUV230bNG3urVRWPBnSJHs64y/0RmWjftnnn0c=
github.com/grafana/jfr-parser v0.7.2-0.20230831140626-08fa3a941bf8 h1:Cod+QZWJXGLoCfKfuH66J3iSQ/WWw+R03R6QCwm8IB8=
github.com/grafana/jfr-parser v0.7.2-0.20230831140626-08fa3a941bf8/go.mod h1:M5u1ux34Qo47ZBWksbMYVk40s7dvU3WMVYpxweEu4R0=
github.com/grafana/memberlist v0.3.1-0.20220708130638-bd88e10a3d91 h1:/NipyHnOmvRsVzj81j2qE0VxsvsqhOB0f4vJIhk2qCQ=
Expand All @@ -393,8 +393,8 @@ github.com/grafana/objstore v0.0.0-20231121154247-84f91ea90e72 h1:o22hsDMQ3kv/0N
github.com/grafana/objstore v0.0.0-20231121154247-84f91ea90e72/go.mod h1:JauBAcJ61tRSv9widgISVmA6akQXDeUMXBrVmWW4xog=
github.com/grafana/pyroscope-go v1.0.3 h1:8WWmItzLfg4m8G+j//ElSjMeMr88Y6Lvblar6qeTyKk=
github.com/grafana/pyroscope-go v1.0.3/go.mod h1:0d7ftwSMBV/Awm7CCiYmHQEG8Y44Ma3YSjt+nWcWztY=
github.com/grafana/pyroscope-go/godeltaprof v0.1.6-0.20231130084046-2eb5d49453c0 h1:vOsbaT8Up18kaEI+/bVF38ukptKSPOXVARUCTs2bzTA=
github.com/grafana/pyroscope-go/godeltaprof v0.1.6-0.20231130084046-2eb5d49453c0/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE=
github.com/grafana/pyroscope-go/godeltaprof v0.1.6 h1:nEdZ8louGAplSvIJi1HVp7kWvFvdiiYg3COLlTwJiFo=
github.com/grafana/pyroscope-go/godeltaprof v0.1.6/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE=
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db h1:7aN5cccjIqCLTzedH7MZzRZt5/lsAHch6Z3L2ZGn5FA=
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=
Expand Down
4 changes: 4 additions & 0 deletions go.work.sum
Expand Up @@ -879,6 +879,8 @@ github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/cristalhq/hedgedhttp v0.7.0 h1:C2XPDC+AQH4QJt6vZI4jB5WNyF86QbSJD4C4fW3H3ro=
github.com/cristalhq/hedgedhttp v0.7.0/go.mod h1:XkqWU6qVMutbhW68NnzjWrGtH8NUx1UfYqGYtHVKIsI=
github.com/cristalhq/hedgedhttp v0.9.1 h1:g68L9cf8uUyQKQJwciD0A1Vgbsz+QgCjuB1I8FAsCDs=
github.com/cristalhq/hedgedhttp v0.9.1/go.mod h1:XkqWU6qVMutbhW68NnzjWrGtH8NUx1UfYqGYtHVKIsI=
github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI=
github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE=
Expand Down Expand Up @@ -1370,6 +1372,8 @@ github.com/grafana/gomemcache v0.0.0-20230316202710-a081dae0aba9 h1:WB3bGH2f1UN6
github.com/grafana/gomemcache v0.0.0-20230316202710-a081dae0aba9/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU=
github.com/grafana/gomemcache v0.0.0-20230914135007-70d78eaabfe1 h1:MLYY2R60/74hfYl5vRRmC2VDo0Yuql1QQ1ig8hnvgSI=
github.com/grafana/gomemcache v0.0.0-20230914135007-70d78eaabfe1/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU=
github.com/grafana/gomemcache v0.0.0-20231023152154-6947259a0586 h1:/of8Z8taCPftShATouOrBVy6GaTTjgQd/VfNiZp/VXQ=
github.com/grafana/gomemcache v0.0.0-20231023152154-6947259a0586/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU=
github.com/grafana/loki v1.6.2-0.20230414223651-220cbdd4f172 h1:/zfw3KeHb5W7FIRI1nA4fti8Q4rDBZdzzk+FyNdas/A=
github.com/grafana/loki v1.6.2-0.20230414223651-220cbdd4f172/go.mod h1:gMEIqi1Gc7wJBK7p70LU0fFGXHLYD/m7qK5Jo3cZmRc=
github.com/grafana/loki/pkg/push v0.0.0-20230127102416-571f88bc5765 h1:VXitROTlmZtLzvokNe8ZbUKpmwldM4Hy1zdNRO32jKU=
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/api_test.go
Expand Up @@ -46,7 +46,7 @@ func getServerConfig(t *testing.T) server.Config {
GRPCListenAddress: grpcHost,
GRPCListenPort: grpcPortNum,

GPRCServerMaxRecvMsgSize: 1024,
GRPCServerMaxRecvMsgSize: 1024,
}
require.NoError(t, cfg.LogLevel.Set("debug"))
return cfg
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/version/version_test.go
Expand Up @@ -39,7 +39,7 @@ func createMemberlist(t *testing.T, port, memberID int) *memberlist.KV {
var cfg memberlist.KVConfig
flagext.DefaultValues(&cfg)
cfg.TCPTransport = memberlist.TCPTransportConfig{
BindAddrs: []string{"localhost"},
BindAddrs: []string{"127.0.0.1"},
BindPort: 0,
}
cfg.GossipInterval = 10 * time.Millisecond
Expand Down
2 changes: 1 addition & 1 deletion pkg/phlare/modules.go
Expand Up @@ -120,7 +120,7 @@ func (f *Phlare) initRuntimeConfig() (services.Service, error) {
// make sure to set default limits before we start loading configuration into memory
validation.SetDefaultLimitsForYAMLUnmarshalling(f.Cfg.LimitsConfig)

serv, err := runtimeconfig.New(f.Cfg.RuntimeConfig, prometheus.WrapRegistererWithPrefix("pyroscope_", f.reg), log.With(f.logger, "component", "runtime-config"))
serv, err := runtimeconfig.New(f.Cfg.RuntimeConfig, "pyroscope", prometheus.WrapRegistererWithPrefix("pyroscope_", f.reg), log.With(f.logger, "component", "runtime-config"))
if err == nil {
// TenantLimits just delegates to RuntimeConfig and doesn't have any state or need to do
// anything in the start/stopping phase. Thus we can create it as part of runtime config
Expand Down
2 changes: 1 addition & 1 deletion pkg/phlare/phlare.go
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/grafana/dskit/server"
"github.com/grafana/dskit/services"
"github.com/grafana/dskit/signals"
"github.com/grafana/dskit/spanprofiler"
wwtracing "github.com/grafana/dskit/tracing"
"github.com/grafana/pyroscope-go"
grpcgw "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
Expand Down Expand Up @@ -57,7 +58,6 @@ import (
"github.com/grafana/pyroscope/pkg/usagestats"
"github.com/grafana/pyroscope/pkg/util"
"github.com/grafana/pyroscope/pkg/util/cli"
"github.com/grafana/pyroscope/pkg/util/spanprofiler"
"github.com/grafana/pyroscope/pkg/validation"
"github.com/grafana/pyroscope/pkg/validation/exporter"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/replication.go
Expand Up @@ -65,7 +65,7 @@ func forGivenReplicationSet[Result any, Querier any](ctx context.Context, client
ring.DoUntilQuorumConfig{
MinimizeRequests: true,
},
func(ctx context.Context, ingester *ring.InstanceDesc, _ context.CancelFunc) (ResponseFromReplica[Result], error) {
func(ctx context.Context, ingester *ring.InstanceDesc, _ context.CancelCauseFunc) (ResponseFromReplica[Result], error) {
var res ResponseFromReplica[Result]
client, err := clientFactory(ingester.Addr)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/tenant/interceptor.go
Expand Up @@ -83,7 +83,7 @@ func (i *authInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc
}
}

var defaultResolver tenant.Resolver = tenant.NewSingleResolver()
var defaultResolver tenant.Resolver = tenant.NewMultiResolver()

// ExtractTenantIDFromHeaders extracts a single TenantID from http headers.
func ExtractTenantIDFromHeaders(ctx context.Context, headers http.Header) (string, context.Context, error) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/testhelper/ring.go
Expand Up @@ -88,3 +88,7 @@ func (r MockRing) CleanupShuffleShardCache(identifier string) {}
func (r MockRing) GetInstanceState(instanceID string) (ring.InstanceState, error) {
return 0, nil
}

func (r MockRing) GetTokenRangesForInstance(instanceID string) (ring.TokenRanges, error) {
return nil, nil
}
2 changes: 1 addition & 1 deletion pkg/usagestats/seed_test.go
Expand Up @@ -37,7 +37,7 @@ func createMemberlist(t *testing.T, port, memberID int) *memberlist.KV {
var cfg memberlist.KVConfig
flagext.DefaultValues(&cfg)
cfg.TCPTransport = memberlist.TCPTransportConfig{
BindAddrs: []string{"localhost"},
BindAddrs: []string{"127.0.0.1"},
BindPort: 0,
}
cfg.GossipInterval = 100 * time.Millisecond
Expand Down

0 comments on commit c054c6b

Please sign in to comment.