Skip to content

Commit

Permalink
trace: honour tracing_service_name config directive (#2608)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode authored Mar 4, 2022
1 parent d8f7f32 commit cb124db
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
3 changes: 3 additions & 0 deletions changelog/unreleased/honour-tracing-service-name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix: respect the tracing_service_name config variable

https://github.com/cs3org/reva/pull/2608
2 changes: 1 addition & 1 deletion cmd/revad/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func initServers(mainConf map[string]interface{}, log *zerolog.Logger) map[strin
}

func initTracing(conf *coreConf) {
rtrace.SetTraceProvider(conf.TracingCollector, conf.TracingEndpoint)
rtrace.SetTraceProvider(conf.TracingCollector, conf.TracingEndpoint, conf.TracingServiceName)
}

func initCPUCount(conf *coreConf, log *zerolog.Logger) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,16 @@ gatewaysvc = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="userprovidersvc" type="string" default="" %}}
The endpoint at which the GRPC userprovider is exposed. [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L65)
{{< highlight toml >}}
[auth.manager.oidcmapping]
userprovidersvc = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="users_mapping" type="string" default="" %}}
The optional OIDC users mapping file path [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L66)
The optional OIDC users mapping file path [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L65)
{{< highlight toml >}}
[auth.manager.oidcmapping]
users_mapping = ""
{{< /highlight >}}
{{% /dir %}}

{{% dir name="group_claim" type="string" default="" %}}
The group claim to be looked up to map the user (default to 'groups'). [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L67)
The group claim to be looked up to map the user (default to 'groups'). [[Ref]](https://github.com/cs3org/reva/tree/master/pkg/auth/manager/oidcmapping/oidcmapping.go#L66)
{{< highlight toml >}}
[auth.manager.oidcmapping]
group_claim = ""
Expand Down
9 changes: 7 additions & 2 deletions pkg/trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ var (
)

// SetTraceProvider sets the TracerProvider at a package level.
func SetTraceProvider(collectorEndpoint string, agentEndpoint string) {
func SetTraceProvider(collectorEndpoint string, agentEndpoint, serviceName string) {
// default to 'reva' as service name if not set
if serviceName == "" {
serviceName = "reva"
}

var exp *jaeger.Exporter
var err error

Expand Down Expand Up @@ -75,7 +80,7 @@ func SetTraceProvider(collectorEndpoint string, agentEndpoint string) {
sdktrace.WithBatcher(exp),
sdktrace.WithResource(resource.NewWithAttributes(
semconv.SchemaURL,
semconv.ServiceNameKey.String("reva"),
semconv.ServiceNameKey.String(serviceName),
)),
)
}
Expand Down

0 comments on commit cb124db

Please sign in to comment.