addServerPortIfNonDefault adds server.port attribute if port is not the default (6379)
(attrs []attribute.KeyValue, serverPort string)
| 31 | |
| 32 | // addServerPortIfNonDefault adds server.port attribute if port is not the default (6379) |
| 33 | func addServerPortIfNonDefault(attrs []attribute.KeyValue, serverPort string) []attribute.KeyValue { |
| 34 | if serverPort != "" && serverPort != "6379" { |
| 35 | return append(attrs, attribute.String(AttrServerPort, serverPort)) |
| 36 | } |
| 37 | return attrs |
| 38 | } |
| 39 | |
| 40 | // metricsRecorder implements the otel.Recorder interface |
| 41 | type metricsRecorder struct { |
no test coverage detected