Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,263 changes: 643 additions & 620 deletions grafana/dashboards/deep_dive.json

Large diffs are not rendered by default.

1,510 changes: 754 additions & 756 deletions grafana/dashboards/network_health.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions internal/amf/nas/gmm/message/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func SendDLNASTransport(ctx context.Context, ue *amfContext.RanUe, payloadContai
attribute.Int("pduSessionID", int(pduSessionID)),
attribute.Int("cause", int(cause)),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand Down Expand Up @@ -65,7 +65,7 @@ func SendIdentityRequest(ctx context.Context, ue *amfContext.RanUe, typeOfIdenti
attribute.String("supi", ue.AmfUe.Supi),
attribute.Int("typeOfIdentity", int(typeOfIdentity)),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand All @@ -91,7 +91,7 @@ func SendAuthenticationRequest(ctx context.Context, amf *amfContext.AMF, ue *amf
trace.WithAttributes(
attribute.String("supi", ue.AmfUe.Supi),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand Down Expand Up @@ -141,7 +141,7 @@ func SendServiceAccept(ctx context.Context, ue *amfContext.RanUe, pDUSessionStat
attribute.Int("pduSessionIDErrorCount", len(errPduSessionID)),
attribute.Int("causeErrorCount", len(errCause)),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand All @@ -167,7 +167,7 @@ func SendAuthenticationReject(ctx context.Context, ue *amfContext.RanUe) error {
trace.WithAttributes(
attribute.String("supi", ue.AmfUe.Supi),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand All @@ -194,7 +194,7 @@ func SendServiceReject(ctx context.Context, ue *amfContext.RanUe, cause uint8) e
attribute.String("supi", ue.AmfUe.Supi),
attribute.Int("cause", int(cause)),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand Down Expand Up @@ -222,7 +222,7 @@ func SendRegistrationReject(ctx context.Context, ue *amfContext.RanUe, cause5GMM
attribute.String("supi", ue.AmfUe.Supi),
attribute.Int("cause", int(cause5GMM)),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand All @@ -248,7 +248,7 @@ func SendSecurityModeCommand(ctx context.Context, amf *amfContext.AMF, ue *amfCo
trace.WithAttributes(
attribute.String("supi", ue.AmfUe.Supi),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand Down Expand Up @@ -295,7 +295,7 @@ func SendDeregistrationAccept(ctx context.Context, ue *amfContext.RanUe) error {
trace.WithAttributes(
attribute.String("supi", ue.AmfUe.Supi),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand Down Expand Up @@ -332,7 +332,7 @@ func SendRegistrationAccept(
trace.WithAttributes(
attribute.String("supi", ue.Supi),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand Down Expand Up @@ -436,7 +436,7 @@ func SendConfigurationUpdateCommand(ctx context.Context, amf *amfContext.AMF, am
trace.WithAttributes(
attribute.String("supi", amfUe.Supi),
),
trace.WithSpanKind(trace.SpanKindServer),
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

Expand Down
7 changes: 4 additions & 3 deletions internal/amf/nas/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ func HandleNAS(ctx context.Context, amf *amfContext.AMF, ue *amfContext.RanUe, n

msgTypeName := messageName(msg.GmmHeader.GetMessageType())

ctx, span := tracer.Start(ctx, fmt.Sprintf("AMF NAS %s", msgTypeName),
ctx, span := tracer.Start(ctx, "NAS receive",
trace.WithSpanKind(trace.SpanKindInternal),
trace.WithAttributes(
attribute.String("nas.messageType", msgTypeName),
attribute.String("supi", ue.AmfUe.Supi),
attribute.String("nas.message_type", msgTypeName),
attribute.String("ue.supi", ue.AmfUe.Supi),
),
)
defer span.End()
Expand Down
38 changes: 20 additions & 18 deletions internal/amf/ngap/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ package ngap

import (
"context"
"fmt"
"reflect"

amfContext "github.com/ellanetworks/core/internal/amf/context"
Expand Down Expand Up @@ -66,34 +65,37 @@ func Dispatch(ctx context.Context, conn *sctp.SCTPConn, msg []byte) {
return
}

messageType := getMessageType(pdu)

ctx, span := tracer.Start(ctx, "NGAP receive",
trace.WithSpanKind(trace.SpanKindServer),
trace.WithAttributes(
attribute.String("ngap.message_type", messageType),
attribute.Int("ngap.pdu_category", pdu.Present),
attribute.Int("ngap.message_size", len(msg)),
attribute.String("network.protocol.name", "ngap"),
attribute.String("network.transport", "sctp"),
attribute.String("network.peer.address", remoteAddress.String()),
attribute.String("network.local.address", localAddress.String()),
),
)
defer span.End()

logger.LogNetworkEvent(
ctx,
logger.NGAPNetworkProtocol,
getMessageType(pdu),
messageType,
logger.DirectionInbound,
localAddress.String(),
remoteAddress.String(),
msg,
)

DispatchNgapMsg(amf, ran, pdu)
dispatchNgapMsg(ctx, amf, ran, pdu)
}

func DispatchNgapMsg(amf *amfContext.AMF, ran *amfContext.Radio, pdu *ngapType.NGAPPDU) {
messageType := getMessageType(pdu)

spanName := fmt.Sprintf("AMF NGAP %s", messageType)

ctx, span := tracer.Start(context.Background(), spanName,
trace.WithAttributes(
attribute.String("ngap.pdu_present", fmt.Sprintf("%d", pdu.Present)),
attribute.String("ngap.messageType", messageType),
),
trace.WithSpanKind(trace.SpanKindServer),
)
defer span.End()

NGAPMessages.WithLabelValues(messageType).Inc()
func dispatchNgapMsg(ctx context.Context, amf *amfContext.AMF, ran *amfContext.Radio, pdu *ngapType.NGAPPDU) {
NGAPMessages.WithLabelValues(getMessageType(pdu)).Inc()

switch pdu.Present {
case ngapType.NGAPPDUPresentInitiatingMessage:
Expand Down
9 changes: 6 additions & 3 deletions internal/amf/ngap/send/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ type RealNGAPSender struct {
}

func (s *RealNGAPSender) SendToRan(ctx context.Context, packet []byte, msgType NGAPProcedure) error {
ctx, span := tracer.Start(ctx, "Send To RAN",
ctx, span := tracer.Start(ctx, "NGAP send",
trace.WithSpanKind(trace.SpanKindClient),
trace.WithAttributes(
attribute.String("ngap.messageType", string(msgType)),
attribute.String("ngap.message_type", string(msgType)),
attribute.Int("ngap.message_size", len(packet)),
attribute.String("network.protocol.name", "ngap"),
attribute.String("network.transport", "sctp"),
),
trace.WithSpanKind(trace.SpanKindClient),
)
defer span.End()

Expand Down
4 changes: 2 additions & 2 deletions internal/api/server/authentication_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func authenticateRequest(r *http.Request, jwtSecret []byte, store *db.Database)
}
}()

ctx, span := tracer.Start(r.Context(), "Authenticate",
trace.WithAttributes(),
ctx, span := tracer.Start(r.Context(), "API authenticate",
trace.WithSpanKind(trace.SpanKindServer),
)
defer span.End()

Expand Down
6 changes: 3 additions & 3 deletions internal/ausf/ue_authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
var tracer = otel.Tracer("ella-core/ausf")

func UeAuthPostRequestProcedure(ctx context.Context, suci string, snName string, resyncInfo *models.ResynchronizationInfo) (*models.Av5gAka, error) {
ctx, span := tracer.Start(
ctx,
"AUSF UEAuthentication PostRequest",
ctx, span := tracer.Start(ctx, "AUSF authenticate",
trace.WithSpanKind(trace.SpanKindInternal),
trace.WithAttributes(
attribute.String("ue.suci", suci),
attribute.String("ausf.serving_network", snName),
),
)
defer span.End()
Expand Down
8 changes: 5 additions & 3 deletions internal/smf/pdusession/handle_create_sm_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ import (
var tracer = otel.Tracer("ella-core/smf")

func CreateSmContext(ctx context.Context, supi string, pduSessionID uint8, dnn string, snssai *models.Snssai, n1Msg []byte) (string, []byte, error) {
ctx, span := tracer.Start(ctx, "SMF Create SmContext",
ctx, span := tracer.Start(ctx, "SMF create session",
trace.WithSpanKind(trace.SpanKindInternal),
trace.WithAttributes(
attribute.String("supi", supi),
attribute.Int("pduSessionID", int(pduSessionID)),
attribute.String("ue.supi", supi),
attribute.Int("smf.pdu_session_id", int(pduSessionID)),
attribute.String("smf.dnn", dnn),
),
)
defer span.End()
Expand Down
7 changes: 3 additions & 4 deletions internal/smf/pdusession/handle_deactivate_sm_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ import (
)

func DeactivateSmContext(ctx context.Context, smContextRef string) error {
ctx, span := tracer.Start(
ctx,
"SMF Deactivate SmContext",
ctx, span := tracer.Start(ctx, "SMF deactivate session",
trace.WithSpanKind(trace.SpanKindInternal),
trace.WithAttributes(
attribute.String("smf.smContextRef", smContextRef),
attribute.String("smf.context_ref", smContextRef),
),
)
defer span.End()
Expand Down
7 changes: 3 additions & 4 deletions internal/smf/pdusession/handle_release_sm_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import (
)

func ReleaseSmContext(ctx context.Context, smContextRef string) error {
ctx, span := tracer.Start(
ctx,
"SMF Release SmContext",
ctx, span := tracer.Start(ctx, "SMF release session",
trace.WithSpanKind(trace.SpanKindInternal),
trace.WithAttributes(
attribute.String("smf.smContextRef", smContextRef),
attribute.String("smf.context_ref", smContextRef),
),
)
defer span.End()
Expand Down
13 changes: 10 additions & 3 deletions internal/upf/core/pfcp_session_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/wmnsk/go-pfcp/ie"
"github.com/wmnsk/go-pfcp/message"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"
)

Expand All @@ -37,7 +38,9 @@ func (u UpfPfcpHandler) HandlePfcpSessionModificationRequest(ctx context.Context
}

func HandlePfcpSessionEstablishmentRequest(ctx context.Context, msg *message.SessionEstablishmentRequest) (*message.SessionEstablishmentResponse, error) {
ctx, span := tracer.Start(ctx, "UPF Session Establishment")
ctx, span := tracer.Start(ctx, "UPF establish session",
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

conn := GetConnection()
Expand Down Expand Up @@ -185,7 +188,9 @@ func HandlePfcpSessionEstablishmentRequest(ctx context.Context, msg *message.Ses
}

func HandlePfcpSessionDeletionRequest(ctx context.Context, msg *message.SessionDeletionRequest) (*message.SessionDeletionResponse, error) {
_, span := tracer.Start(ctx, "UPF Session Delete")
_, span := tracer.Start(ctx, "UPF delete session",
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

conn := GetConnection()
Expand Down Expand Up @@ -232,7 +237,9 @@ func HandlePfcpSessionDeletionRequest(ctx context.Context, msg *message.SessionD
}

func HandlePfcpSessionModificationRequest(ctx context.Context, msg *message.SessionModificationRequest) (*message.SessionModificationResponse, error) {
ctx, span := tracer.Start(ctx, "UPF Session Modify")
ctx, span := tracer.Start(ctx, "UPF modify session",
trace.WithSpanKind(trace.SpanKindInternal),
)
defer span.End()

conn := GetConnection()
Expand Down
Loading