Skip to content

Commit

Permalink
record network request bodies and headers in trace (highlight#8551)
Browse files Browse the repository at this point in the history
## Summary

* records additional attributes (http request / response headers and
body) as part of frontend traces
* records more attributes in the browser performance capture to record
detailed request timing
* updates opentelemetry go sdks to latest versions and uses latest
opentelemetry semantic convention

## How did you test this change?

![Screenshot from 2024-05-14
10-36-30](https://github.com/highlight/highlight/assets/1351531/4d3115d1-5668-4dfa-8bd6-1f31900dc736)


![Screenshot from 2024-05-13
15-40-29](https://github.com/highlight/highlight/assets/1351531/c95f814b-778c-4d35-9b81-b41f62bafa02)


![Screenshot from 2024-05-13
14-56-03](https://github.com/highlight/highlight/assets/1351531/c4e28b6c-d5a3-4668-b7c2-9cebc9a1361b)


## Are there any deployment considerations?

no

## Does this work require review from our design team?

no
  • Loading branch information
Vadman97 committed May 15, 2024
1 parent b224376 commit 2a90db8
Show file tree
Hide file tree
Showing 36 changed files with 305 additions and 242 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-phones-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'highlight.run': patch
---

improve dev reliability of browser fetch patch
5 changes: 5 additions & 0 deletions .changeset/smart-birds-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'highlight.run': patch
---

record more attributes as part of captured frontend network requests
34 changes: 17 additions & 17 deletions backend/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 28 additions & 28 deletions backend/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/http/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/go-chi/chi"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.25.0"
"go.opentelemetry.io/otel/trace"

model2 "github.com/highlight-run/highlight/backend/model"
Expand Down
2 changes: 1 addition & 1 deletion backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/marketplacemetering"
"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.25.0"
"go.opentelemetry.io/otel/trace"

ghandler "github.com/99designs/gqlgen/graphql/handler"
Expand Down
2 changes: 1 addition & 1 deletion backend/otel/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/plog"
"go.opentelemetry.io/collector/pdata/ptrace"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.25.0"
)

var ExternalHighlightData = e.New("dropping otel data from external highlight instance")
Expand Down
2 changes: 1 addition & 1 deletion backend/otel/extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/ptrace"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.25.0"
)

var ctx = context.Background()
Expand Down
2 changes: 1 addition & 1 deletion backend/otel/otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"go.opentelemetry.io/collector/pdata/plog/plogotlp"
"go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp"
"go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.25.0"

"github.com/go-chi/chi"
"github.com/highlight-run/highlight/backend/clickhouse"
Expand Down
2 changes: 1 addition & 1 deletion backend/phonehome/phonehome.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/shirou/gopsutil/mem"
log "github.com/sirupsen/logrus"
"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.25.0"
"go.opentelemetry.io/otel/trace"

"github.com/highlight-run/highlight/backend/model"
Expand Down
3 changes: 3 additions & 0 deletions backend/private-graph/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion backend/private-graph/graph/model/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions backend/private-graph/graph/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,9 @@ enum NetworkRequestAttribute {
response_size
status
latency
connect_latency
dns_latency
redirect_latency
request_id
graphql_operation
}
Expand Down
2 changes: 1 addition & 1 deletion backend/private-graph/graph/schema.resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import (
log "github.com/sirupsen/logrus"
stripe "github.com/stripe/stripe-go/v78"
"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.25.0"
"golang.org/x/sync/errgroup"
"gorm.io/gorm"
"gorm.io/gorm/clause"
Expand Down
Loading

0 comments on commit 2a90db8

Please sign in to comment.