Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update README with report cards + fix misc issues #44

Merged
merged 8 commits into from
Mar 14, 2024
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
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Retina

[![goreport][goreport-img]][goreport] ![GitHub release][release-img] [![retina-publish][godoc-badge]][godoc] ![license] [![retina-test][retina-test-image-badge]][retina-test-image] [![retinash][retinash-badge]][retinash] [![retina-publish][retina-publish-badge]][retina-publish] [![retina-publish-ghcr][retina-publish-ghcr-badge]][retina-publish-ghcr] ![retina-codeql-img][retina-codeql-badge] ![retina-golangci-lint-img][retina-golangci-lint-badge]

## Overview

Retina is a cloud and vendor agnostic container workload observability platform which helps customers with enterprise grade DevOps, SecOps and compliance use cases. It is designed to cater to cluster network administrators, cluster security administrators and DevOps engineers by providing a centralized platform for monitoring application and network health, and security. Retina is capable of collecting telemetry data from multiple sources and aggregating it into a single time-series database. Retina is also capable of sending data to multiple destinations, such as Prometheus, Azure Monitor, and other vendors, and visualizing the data in a variety of ways, like Grafana, Azure Monitor, Azure log analytics, and more.

![Retina features](/site/static/img/retina-features.png)

## Documentation

See [retina.sh](http://retina.sh) for more information and examples.
Expand Down Expand Up @@ -59,3 +63,20 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
## Contact

"Retina Devs" <[email protected]>

[goreport-img]: https://goreportcard.com/badge/github.com/microsoft/retina
[goreport]: https://goreportcard.com/report/github.com/microsoft/retina
[godoc]: https://godoc.org/github.com/microsoft/retina
[godoc-badge]: https://godoc.org/github.com/microsoft/retina?status.svg
[release-img]: https://img.shields.io/github/v/release/microsoft/retina.svg
[license]: https://img.shields.io/badge/license-MIT-blue?link=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fretina%2Fblob%2Fmain%2FLICENSE
[retina-test-image-badge]: https://github.com/microsoft/retina/actions/workflows/test.yaml/badge.svg?branch=main
[retina-test-image]: https://github.com/microsoft/retina/actions/workflows/test.yaml?query=branch%3Amain
[retinash-badge]: https://github.com/microsoft/retina/actions/workflows/docs.yaml/badge.svg?branch=main
[retinash]: https://retina.sh/
[retina-publish-badge]: https://github.com/microsoft/retina/actions/workflows/images.yaml/badge.svg?branch=main
[retina-publish]: https://github.com/microsoft/retina/actions/workflows/images.yaml?query=branch%3Amain
[retina-publish-ghcr-badge]: https://github.com/microsoft/retina/actions/workflows/images-ghcr.yaml/badge.svg?branch=main
[retina-publish-ghcr]: https://github.com/microsoft/retina/actions/workflows/images-ghcr.yaml?query=branch%3Amain
[retina-codeql-badge]: https://github.com/microsoft/retina/actions/workflows/codeql.yaml/badge.svg?branch=main
[retina-golangci-lint-badge]: https://github.com/microsoft/retina/actions/workflows/golangci-lint.yaml/badge.svg?branch=main
4 changes: 2 additions & 2 deletions pkg/capture/crd_to_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (translator *CaptureToPodTranslator) initJobTemplate(capture *retinav1alpha
},
// Usually, the Capture Pod takes no more than 10m CPU
// and 10Mi memory. And considering the Capture Pod
// does not consumes much resources as requried by
// does not consumes much resources as required by
// the workload, it's safe to hard-code the resource
// requests and limits.
Resources: corev1.ResourceRequirements{
Expand Down Expand Up @@ -791,7 +791,7 @@ func filterToIPPortsMap(filters []string) (map[string][]string, error) {
}
continue
}
// If any(* or emtpy) port is specified with an ip address, we should ignore the other ports with combination
// If any(* or empty) port is specified with an ip address, we should ignore the other ports with combination
// with this ip address, and the final combination for this ip address will be this_ipaddress:*.
if portFilter == anyIPOrPort {
filterIPPorts[ipAddressFilter] = map[string]struct{}{
Expand Down
2 changes: 1 addition & 1 deletion pkg/capture/provider/network_capture_win.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (ncp *NetworkCaptureProvider) CaptureNetworkPacket(filter string, duration,
)

// We should split arguments organized in a string delimited by spaces as
// seperate ones, otherwise the whole string will be treated as one argument.
// separate ones, otherwise the whole string will be treated as one argument.
// For example, given the following filter, exec lib will treat IPv4.Address
// as the argument and the rest as the value of IPv4.Address.
// "IPv4.Address=(10.244.1.85,10.244.1.235) IPv6.Address=(fd5c:d9f1:79c5:fd83::1bc,fd5c:d9f1:79c5:fd83::11b)"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"testing"
"time"

gomock "github.com/golang/mock/gomock"
"github.com/microsoft/retina/pkg/common"
"github.com/microsoft/retina/pkg/log"
"github.com/microsoft/retina/pkg/pubsub"
gomock "github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
retinav1alpha1 "github.com/microsoft/retina/crd/api/v1alpha1"
"github.com/microsoft/retina/pkg/common"
"github.com/microsoft/retina/pkg/controllers/cache"
"github.com/microsoft/retina/pkg/log"
"github.com/microsoft/retina/pkg/module/metrics"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/deprecated/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func TestGetPodOwner(t *testing.T) {
ownerKind: "Deployment",
},
{
name: "Test unkown owner",
name: "Test unknown owner",
args: args{
obj: &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Expand Down
6 changes: 3 additions & 3 deletions pkg/enricher/enricher.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"reflect"
"sync"

"github.com/microsoft/retina/pkg/common"
"github.com/microsoft/retina/pkg/controllers/cache"
"github.com/microsoft/retina/pkg/log"
"github.com/cilium/cilium/api/v1/flow"
v1 "github.com/cilium/cilium/pkg/hubble/api/v1"
"github.com/cilium/cilium/pkg/hubble/container"
"github.com/microsoft/retina/pkg/common"
"github.com/microsoft/retina/pkg/controllers/cache"
"github.com/microsoft/retina/pkg/log"
"go.uber.org/zap"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/enricher/enricher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"testing"
"time"

"github.com/cilium/cilium/api/v1/flow"
v1 "github.com/cilium/cilium/pkg/hubble/api/v1"
"github.com/microsoft/retina/pkg/common"
"github.com/microsoft/retina/pkg/controllers/cache"
"github.com/microsoft/retina/pkg/log"
"github.com/microsoft/retina/pkg/pubsub"
"github.com/cilium/cilium/api/v1/flow"
v1 "github.com/cilium/cilium/pkg/hubble/api/v1"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/timestamppb"
Expand Down
2 changes: 1 addition & 1 deletion pkg/managers/filtermanager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"net"
"testing"

"github.com/golang/mock/gomock"
"github.com/microsoft/retina/pkg/log"
"github.com/microsoft/retina/pkg/plugin/filter/mocks"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/managers/filtermanager/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ type IFilterManager interface {
// AddIPs adds the given IPs to the filter map (map in kernel space) and the filterCache.
// If any of the IP cannot be added to the filter map,
// no entries will be added to the cache.
// Note: An error returned doesn't gurantee that no IPs
// Note: An error returned doesn't guarantee that no IPs
// were added to the filter map. Caller should retry adding
// all the IPs again.
AddIPs([]net.IP, Requestor, RequestMetadata) error
// DeleteIPs deletes the given IPs from the filter map (map in kernel space) and the filterCache.
// If any of the IP cannot be deleted from the filter map,
// no entries will be deleted from the cache.
// Note: An error returned doesn't gurantee that no IPs
// Note: An error returned doesn't guarantee that no IPs
// were deleted from the filter map. Caller should retry deleting
// all the IPs again.
DeleteIPs([]net.IP, Requestor, RequestMetadata) error
// HasIP returns true if the given IP is in the filterCache.
HasIP(net.IP) bool
// Reset the cache and the filter map.
// Note: An error returned doesn't gurantee that no IPs
// Note: An error returned doesn't guarantee that no IPs
// were deleted from the filter map. Caller should retry Reset
// again.
Reset() error
Expand Down
2 changes: 1 addition & 1 deletion pkg/managers/pluginmanager/pluginmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (
"sync"
"time"

v1 "github.com/cilium/cilium/pkg/hubble/api/v1"
kcfg "github.com/microsoft/retina/pkg/config"
"github.com/microsoft/retina/pkg/log"
"github.com/microsoft/retina/pkg/managers/watchermanager"
"github.com/microsoft/retina/pkg/metrics"
"github.com/microsoft/retina/pkg/plugin/api"
"github.com/microsoft/retina/pkg/plugin/registry"
"github.com/microsoft/retina/pkg/telemetry"
v1 "github.com/cilium/cilium/pkg/hubble/api/v1"
"github.com/pkg/errors"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"
Expand Down
12 changes: 6 additions & 6 deletions pkg/managers/pluginmanager/pluginmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ func TestPluginInit(t *testing.T) {
wantErr bool
}{
{
name: "Plugin init successs Pod Level Disabled",
name: "Plugin init successes Pod Level Disabled",
cfg: cfgPodLevelDisabled,
pluginName: "mockplugin",
wantErr: false,
},
{
name: "Plugin init successs Pod Level Enabled",
name: "Plugin init successes Pod Level Enabled",
cfg: cfgPodLevelEnabled,
pluginName: "mockplugin",
wantErr: false,
Expand Down Expand Up @@ -268,14 +268,14 @@ func TestPluginStartWithoutInit(t *testing.T) {
initPlugin bool
}{
{
name: "Plugin start successs Pod Level Disabled",
name: "Plugin start successes Pod Level Disabled",
cfg: cfgPodLevelDisabled,
pluginName: "mockplugin",
wantErr: true,
initPlugin: false,
},
{
name: "Plugin start successs Pod Level Enabled",
name: "Plugin start successes Pod Level Enabled",
cfg: cfgPodLevelEnabled,
pluginName: "mockplugin",
wantErr: false,
Expand Down Expand Up @@ -315,7 +315,7 @@ func TestPluginStop(t *testing.T) {
startPlugin bool
}{
{
name: "Plugin stop successs Pod Level Disabled",
name: "Plugin stop successes Pod Level Disabled",
cfg: cfgPodLevelDisabled,
pluginName: "mockplugin",
wantStartErr: false,
Expand All @@ -342,7 +342,7 @@ func TestPluginStop(t *testing.T) {
startPlugin: true,
},
{
name: "Plugin stop successs Pod Level Enabled",
name: "Plugin stop successes Pod Level Enabled",
cfg: cfgPodLevelEnabled,
pluginName: "mockplugin",
wantStartErr: false,
Expand Down
2 changes: 1 addition & 1 deletion pkg/managers/watchermanager/watchermanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"errors"
"testing"

"github.com/golang/mock/gomock"
"github.com/microsoft/retina/pkg/log"
mock "github.com/microsoft/retina/pkg/managers/watchermanager/mocks"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/require"
"golang.org/x/sync/errgroup"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/metrics/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
package metrics

import (
"github.com/microsoft/retina/pkg/log"
"github.com/cilium/cilium/api/v1/flow"
"github.com/microsoft/retina/pkg/log"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/zap"
)
Expand Down
5 changes: 2 additions & 3 deletions pkg/module/metrics/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"fmt"
"strings"

v1 "github.com/cilium/cilium/api/v1/flow"
api "github.com/microsoft/retina/crd/api/v1alpha1"
"github.com/microsoft/retina/pkg/exporter"
"github.com/microsoft/retina/pkg/log"
metricsinit "github.com/microsoft/retina/pkg/metrics"
"github.com/microsoft/retina/pkg/utils"
"github.com/cilium/cilium/api/v1/flow"
v1 "github.com/cilium/cilium/api/v1/flow"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -83,7 +82,7 @@ func (d *DNSMetrics) getLabels() []string {
return labels
}

func (d *DNSMetrics) values(flow *flow.Flow) []string {
func (d *DNSMetrics) values(flow *v1.Flow) []string {
flowDns, dnsType, numResponses := utils.GetDns(flow)
if flowDns == nil {
return nil
Expand Down
7 changes: 3 additions & 4 deletions pkg/module/metrics/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ import (
"reflect"
"testing"

"github.com/microsoft/retina/pkg/log"
"github.com/microsoft/retina/pkg/metrics"
"github.com/cilium/cilium/api/v1/flow"
"github.com/golang/mock/gomock"
"github.com/microsoft/retina/pkg/log"
"github.com/microsoft/retina/pkg/metrics"
"github.com/microsoft/retina/pkg/utils"
"github.com/prometheus/client_golang/prometheus"
"gotest.tools/v3/assert"

"github.com/microsoft/retina/pkg/utils"
)

func TestGetLabels(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/module/metrics/drops.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ package metrics
import (
"strings"

v1 "github.com/cilium/cilium/api/v1/flow"
api "github.com/microsoft/retina/crd/api/v1alpha1"
"github.com/microsoft/retina/pkg/exporter"
"github.com/microsoft/retina/pkg/log"
"github.com/microsoft/retina/pkg/metrics"
"github.com/microsoft/retina/pkg/utils"
v1 "github.com/cilium/cilium/api/v1/flow"
"go.uber.org/zap"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/module/metrics/drops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ package metrics
import (
"testing"

"github.com/cilium/cilium/api/v1/flow"
"github.com/golang/mock/gomock"
"github.com/microsoft/retina/crd/api/v1alpha1"
"github.com/microsoft/retina/pkg/log"
metricsinit "github.com/microsoft/retina/pkg/metrics"
"github.com/cilium/cilium/api/v1/flow"
"github.com/golang/mock/gomock"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
Expand Down
2 changes: 1 addition & 1 deletion pkg/module/metrics/forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ package metrics
import (
"strings"

v1 "github.com/cilium/cilium/api/v1/flow"
api "github.com/microsoft/retina/crd/api/v1alpha1"
"github.com/microsoft/retina/pkg/exporter"
"github.com/microsoft/retina/pkg/log"
metricsinit "github.com/microsoft/retina/pkg/metrics"
"github.com/microsoft/retina/pkg/utils"
v1 "github.com/cilium/cilium/api/v1/flow"
"go.uber.org/zap"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/module/metrics/forward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ package metrics
import (
"testing"

"github.com/cilium/cilium/api/v1/flow"
"github.com/golang/mock/gomock"
"github.com/microsoft/retina/crd/api/v1alpha1"
"github.com/microsoft/retina/pkg/log"
metricsinit "github.com/microsoft/retina/pkg/metrics"
"github.com/cilium/cilium/api/v1/flow"
"github.com/golang/mock/gomock"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
Expand Down
4 changes: 2 additions & 2 deletions pkg/module/metrics/latency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"testing"
"time"

"github.com/cilium/cilium/api/v1/flow"
"github.com/golang/mock/gomock"
api "github.com/microsoft/retina/crd/api/v1alpha1"
"github.com/microsoft/retina/pkg/exporter"
"github.com/microsoft/retina/pkg/log"
"github.com/microsoft/retina/pkg/metrics"
"github.com/microsoft/retina/pkg/utils"
"github.com/cilium/cilium/api/v1/flow"
"github.com/golang/mock/gomock"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"
"gotest.tools/v3/assert"
Expand Down
2 changes: 1 addition & 1 deletion pkg/module/metrics/metrics_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"sync"
"time"

"github.com/cilium/cilium/api/v1/flow"
api "github.com/microsoft/retina/crd/api/v1alpha1"
"github.com/microsoft/retina/crd/api/v1alpha1/validations"
"github.com/microsoft/retina/pkg/common"
Expand All @@ -21,7 +22,6 @@ import (
"github.com/microsoft/retina/pkg/metrics"
"github.com/microsoft/retina/pkg/pubsub"
"github.com/microsoft/retina/pkg/utils"
"github.com/cilium/cilium/api/v1/flow"
"go.uber.org/zap"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/module/metrics/metrics_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"sync"
"testing"

"github.com/cilium/cilium/pkg/hubble/container"
"github.com/golang/mock/gomock"
api "github.com/microsoft/retina/crd/api/v1alpha1"
"github.com/microsoft/retina/pkg/common"
kcfg "github.com/microsoft/retina/pkg/config"
Expand All @@ -16,8 +18,6 @@ import (
"github.com/microsoft/retina/pkg/log"
"github.com/microsoft/retina/pkg/managers/filtermanager"
"github.com/microsoft/retina/pkg/pubsub"
"github.com/cilium/cilium/pkg/hubble/container"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
)
Expand Down
Loading
Loading