API Server: Standalone observability (#84789)
Adds support for logs (specify level), metrics (enable metrics and Prometheus /metrics endpoint and traces (jaeger or otlp) for standalone API server. This will allow any grafana core service part of standalone apiserver to use logging, metrics and traces as normal.
This commit is contained in:
@@ -16,7 +16,7 @@ func getBuildstamp(opts ServerOptions) int64 {
|
||||
return buildstampInt64
|
||||
}
|
||||
|
||||
func setBuildInfo(opts ServerOptions) {
|
||||
func SetBuildInfo(opts ServerOptions) {
|
||||
setting.BuildVersion = opts.Version
|
||||
setting.BuildCommit = opts.Commit
|
||||
setting.EnterpriseBuildCommit = opts.EnterpriseCommit
|
||||
|
||||
@@ -98,7 +98,7 @@ func RunServer(opts ServerOptions) error {
|
||||
}
|
||||
}()
|
||||
|
||||
setBuildInfo(opts)
|
||||
SetBuildInfo(opts)
|
||||
checkPrivileges()
|
||||
|
||||
configOptions := strings.Split(ConfigOverrides, " ")
|
||||
@@ -112,7 +112,7 @@ func RunServer(opts ServerOptions) error {
|
||||
return err
|
||||
}
|
||||
|
||||
metrics.SetBuildInformation(metrics.ProvideRegisterer(cfg), opts.Version, opts.Commit, opts.BuildBranch, getBuildstamp(opts))
|
||||
metrics.SetBuildInformation(metrics.ProvideRegisterer(), opts.Version, opts.Commit, opts.BuildBranch, getBuildstamp(opts))
|
||||
|
||||
s, err := server.Initialize(
|
||||
cfg,
|
||||
|
||||
@@ -75,7 +75,7 @@ func RunTargetServer(opts ServerOptions) error {
|
||||
}
|
||||
}()
|
||||
|
||||
setBuildInfo(opts)
|
||||
SetBuildInfo(opts)
|
||||
checkPrivileges()
|
||||
|
||||
configOptions := strings.Split(ConfigOverrides, " ")
|
||||
@@ -89,7 +89,7 @@ func RunTargetServer(opts ServerOptions) error {
|
||||
return err
|
||||
}
|
||||
|
||||
metrics.SetBuildInformation(metrics.ProvideRegisterer(cfg), opts.Version, opts.Commit, opts.BuildBranch, getBuildstamp(opts))
|
||||
metrics.SetBuildInformation(metrics.ProvideRegisterer(), opts.Version, opts.Commit, opts.BuildBranch, getBuildstamp(opts))
|
||||
|
||||
s, err := server.InitializeModuleServer(
|
||||
cfg,
|
||||
|
||||
Reference in New Issue
Block a user