-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
obs_exporter.go
68 lines (59 loc) · 2.63 KB
/
obs_exporter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package obsmetrics // import "go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics"
import (
"go.opencensus.io/stats"
"go.opencensus.io/tag"
)
const (
// ExporterKey used to identify exporters in metrics and traces.
ExporterKey = "exporter"
// SentSpansKey used to track spans sent by exporters.
SentSpansKey = "sent_spans"
// FailedToSendSpansKey used to track spans that failed to be sent by exporters.
FailedToSendSpansKey = "send_failed_spans"
// SentMetricPointsKey used to track metric points sent by exporters.
SentMetricPointsKey = "sent_metric_points"
// FailedToSendMetricPointsKey used to track metric points that failed to be sent by exporters.
FailedToSendMetricPointsKey = "send_failed_metric_points"
// SentLogRecordsKey used to track logs sent by exporters.
SentLogRecordsKey = "sent_log_records"
// FailedToSendLogRecordsKey used to track logs that failed to be sent by exporters.
FailedToSendLogRecordsKey = "send_failed_log_records"
)
var (
TagKeyExporter, _ = tag.NewKey(ExporterKey)
ExporterPrefix = ExporterKey + NameSep
ExportTraceDataOperationSuffix = NameSep + "traces"
ExportMetricsOperationSuffix = NameSep + "metrics"
ExportLogsOperationSuffix = NameSep + "logs"
// Exporter metrics. Any count of data items below is in the final format
// that they were sent, reasoning: reconciliation is easier if measurements
// on backend and exporter are expected to be the same. Translation issues
// that result in a different number of elements should be reported in a
// separate way.
ExporterSentSpans = stats.Int64(
ExporterPrefix+SentSpansKey,
"Number of spans successfully sent to destination.",
stats.UnitDimensionless)
ExporterFailedToSendSpans = stats.Int64(
ExporterPrefix+FailedToSendSpansKey,
"Number of spans in failed attempts to send to destination.",
stats.UnitDimensionless)
ExporterSentMetricPoints = stats.Int64(
ExporterPrefix+SentMetricPointsKey,
"Number of metric points successfully sent to destination.",
stats.UnitDimensionless)
ExporterFailedToSendMetricPoints = stats.Int64(
ExporterPrefix+FailedToSendMetricPointsKey,
"Number of metric points in failed attempts to send to destination.",
stats.UnitDimensionless)
ExporterSentLogRecords = stats.Int64(
ExporterPrefix+SentLogRecordsKey,
"Number of log record successfully sent to destination.",
stats.UnitDimensionless)
ExporterFailedToSendLogRecords = stats.Int64(
ExporterPrefix+FailedToSendLogRecordsKey,
"Number of log records in failed attempts to send to destination.",
stats.UnitDimensionless)
)