Skip to content

Commit

Permalink
fix: time units in telemetry (#95)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?

- Closes #92 

## Short description of the changes

- use explicit time units in telemetry name
- use ms for time data

## How to verify that this has the expected result

- build & run
- explore latency and duration telemetry
  • Loading branch information
vreynolds committed Aug 21, 2023
1 parent 57028ac commit b7a36bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import (
"github.com/honeycombio/libhoney-go"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"

semconv "go.opentelemetry.io/otel/semconv/v1.20.0"
)

const Version string = "0.0.3-alpha"
Expand Down Expand Up @@ -136,9 +137,9 @@ func sendHttpEventToHoneycomb(event assemblers.HttpEvent, k8sClient *utils.Cache
// common attributes
ev.Timestamp = event.Timestamp
ev.AddField("httpEvent_handled_at", time.Now())
ev.AddField("httpEvent_handled_latency", time.Now().Sub(event.Timestamp))
ev.AddField("httpEvent_handled_latency_ms", time.Now().Sub(event.Timestamp).Milliseconds())
ev.AddField("goroutine_count", runtime.NumGoroutine())
ev.AddField("duration_ms", event.Duration.Microseconds())
ev.AddField("duration_ms", event.Duration.Milliseconds())
ev.AddField(string(semconv.NetSockHostAddrKey), event.SrcIp)
ev.AddField("destination.address", event.DstIp)

Expand Down

0 comments on commit b7a36bd

Please sign in to comment.