Skip to content

Commit

Permalink
docs: update README with report cards + fix misc issues (#44)
Browse files Browse the repository at this point in the history
update README with report cards and fix various spelling and formatting
issues.
  • Loading branch information
nddq authored Mar 14, 2024
1 parent f014035 commit 456c54c
Show file tree
Hide file tree
Showing 51 changed files with 104 additions and 91 deletions.
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" <retina@microsoft.com>

[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%2Fgitpro.ttaallkk.top%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

0 comments on commit 456c54c

Please sign in to comment.