Conversation
Set up otel go metrics reporting and add a RequestCount metric for the http handler instrumentation.
Codecov Report
@@ Coverage Diff @@
## main #200 +/- ##
==========================================
+ Coverage 64.99% 65.52% +0.53%
==========================================
Files 49 49
Lines 1774 1868 +94
==========================================
+ Hits 1153 1224 +71
- Misses 570 587 +17
- Partials 51 57 +6
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| "github.com/hypertrace/goagent/sdk/filter" | ||
| internalconfig "github.com/hypertrace/goagent/sdk/internal/config" | ||
| "github.com/hypertrace/goagent/sdk/internal/container" | ||
| "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" |
There was a problem hiding this comment.
I need to move this otel specific logic out of the sdk since this is meant to be a hypertrace sdk that can be adapted by any telemetry framework. But can do that separately.
| metricsExporterFactory := makeMetricsExporterFactory(cfg) | ||
| metricsExporter, err := metricsExporterFactory() | ||
| if err != nil { | ||
| log.Fatal(err) |
There was a problem hiding this comment.
This means if metrics backend is down instrumented app won't be able to start? Better to fail silently?
There was a problem hiding this comment.
If the metrics/traces collector is down and you bring up the go app with this agent in it, it comes up without issue. You do get context deadline messages since you cannot export anything. After you bring up the collector the spans and metrics start being sent.
Description
Set up otel go metrics reporting and add a RequestCount metric for the http handler instrumentation. This should enable metrics to be created and exported just like spans are. By default we will export to the otlp endpoint spans are exported to but this can be overridden using a metrics endpoint config.
Testing
Tested locally.
Checklist: