Skip to content

Commit

Permalink
Make telemetry explicit (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZIJ authored Oct 23, 2023
1 parent e3198a4 commit 1aa836f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ Digger has 2 main components:

Digger also stores PR-level locks and plan cache in your cloud account (DynamoDB + S3 on AWS, equivalents in other cloud providers)

## Telemetry
No sensitive or personal / identifyable data is logged. You can see what is tracked in [`pkg/usage/usage.go`](https://github.com/diggerhq/digger/blob/main/pkg/usage/usage.go)

## Contributing

We love contributions. Check out our [contribiting guide](CONTRIBUTING.md) to get started.
Expand Down
Binary file added digger
Binary file not shown.
17 changes: 4 additions & 13 deletions pkg/usage/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ package usage

import (
"bytes"
"crypto/sha256"
"encoding/hex"
"encoding/json"
configuration "github.com/diggerhq/lib-digger-config"
"log"
"net/http"
"os"

configuration "github.com/diggerhq/lib-digger-config"
)

var collect_usage_data = true
Expand All @@ -22,12 +21,8 @@ type UsageRecord struct {
}

func SendUsageRecord(repoOwner string, eventName string, action string) error {
h := sha256.New()
h.Write([]byte(repoOwner))
sha := h.Sum(nil)
shaStr := hex.EncodeToString(sha)
payload := UsageRecord{
UserId: shaStr,
UserId: repoOwner,
EventName: eventName,
Action: action,
Token: "diggerABC@@1998fE",
Expand All @@ -36,12 +31,8 @@ func SendUsageRecord(repoOwner string, eventName string, action string) error {
}

func SendLogRecord(repoOwner string, message string) error {
h := sha256.New()
h.Write([]byte(repoOwner))
sha := h.Sum(nil)
shaStr := hex.EncodeToString(sha)
payload := UsageRecord{
UserId: shaStr,
UserId: repoOwner,
EventName: "log from " + source,
Action: message,
Token: "diggerABC@@1998fE",
Expand Down

0 comments on commit 1aa836f

Please sign in to comment.