-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qrynexporter: add insert duration hist
- Loading branch information
1 parent
a7399e2
commit b47bbfe
Showing
6 changed files
with
94 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package qrynexporter | ||
|
||
import ( | ||
"fmt" | ||
|
||
"go.opentelemetry.io/otel/attribute" | ||
"go.opentelemetry.io/otel/metric" | ||
) | ||
|
||
const ( | ||
prefix = "exporter_qryn_" | ||
|
||
errorCodeError = "1" | ||
errorCodeSuccess = "" | ||
|
||
dataTypeLogs = "logs" | ||
dataTypeMetrics = "metrics" | ||
dataTypeTraces = "traces" | ||
) | ||
|
||
var ( | ||
otelcolExporterQrynBatchInsertDurationMillis metric.Int64Histogram | ||
) | ||
|
||
func initMetrics(meter metric.Meter) error { | ||
var err error | ||
if otelcolExporterQrynBatchInsertDurationMillis, err = meter.Int64Histogram( | ||
fmt.Sprint(prefix, "batch_insert_duration_millis"), | ||
metric.WithDescription("Qryn exporter batch insert duration in millis"), | ||
metric.WithExplicitBucketBoundaries(0, 5, 10, 20, 50, 100, 200, 500, 1000, 5000), | ||
); err != nil { | ||
return err | ||
} | ||
return nil | ||
} | ||
|
||
func newOtelcolAttrSetBatch(errorCode string, dataType string) *attribute.Set { | ||
s := attribute.NewSet( | ||
attribute.KeyValue{Key: "error_code", Value: attribute.StringValue(errorCode)}, | ||
attribute.KeyValue{Key: "data_type", Value: attribute.StringValue(dataType)}, | ||
) | ||
return &s | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters