Skip to content

Commit a0c6662

Browse files
Add default namespaces for zero and alpha
1 parent 5ff830c commit a0c6662

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

x/metrics.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,10 @@ func RegisterExporters(conf *viper.Viper, service string) {
617617
propagation.Baggage{},
618618
))
619619

620+
// Determine namespace from the default service type (dgraph.alpha or dgraph.zero)
621+
// This allows filtering all alphas or zeros in Jaeger even with custom service names
622+
namespace := service // e.g., "dgraph.alpha" or "dgraph.zero"
623+
620624
// Use custom service name if specified, otherwise use the default
621625
if customService := t.GetString("service"); len(customService) > 0 {
622626
service = customService
@@ -626,6 +630,7 @@ func RegisterExporters(conf *viper.Viper, service string) {
626630
res := resource.NewWithAttributes(
627631
semconv.SchemaURL,
628632
semconv.ServiceNameKey.String(service),
633+
semconv.ServiceNamespaceKey.String(namespace),
629634
)
630635

631636
// Configure the batch span processor options

0 commit comments

Comments
 (0)