Skip to content

Commit

Permalink
Add NewOTELExporter() function
Browse files Browse the repository at this point in the history
  • Loading branch information
Achooo committed May 1, 2023
1 parent c890708 commit af3bd7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions agent/hcp/telemetry/otel_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ type OTELExporter struct {
endpoint string
}

// NewOTELExporter returns a configured OTELExporter
func NewOTELExporter(client hcpclient.MetricsClient, endpoint string) *OTELExporter {
return &OTELExporter{
client: client,
endpoint: endpoint,
}
}

// Temporality returns the Cumulative temporality for metrics aggregation.
// Telemetry Gateway stores metrics in Prometheus format, so use Cummulative aggregation as default.
func (e *OTELExporter) Temporality(_ metric.InstrumentKind) metricdata.Temporality {
Expand Down

0 comments on commit af3bd7f

Please sign in to comment.