Skip to content

Commit

Permalink
Add spanmetricsprocessor logic (open-telemetry#2012)
Browse files Browse the repository at this point in the history
**Description:** Adds spanmetricsprocessor logic as a follow-up to open-telemetry#1917.

**Link to tracking Issue:** open-telemetry#403

**Testing:**
- Unit and integration tested locally (by adding to `cmd/otelcontribcol/components.go`).
- Performance tested (added metrics key cache to improve performance) and added benchmark function.

**Documentation:** Add relevant documentation to exported structs and functions.
  • Loading branch information
albertteoh authored Jan 28, 2021
1 parent 1e54ccc commit 8ca2e9b
Show file tree
Hide file tree
Showing 7 changed files with 776 additions and 65 deletions.
3 changes: 3 additions & 0 deletions processor/spanmetricsprocessor/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Span Metrics Processor

**Note:** Currently experimental and subject to breaking changes (e.g. change from processor to exporter/translator component).
See: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/403.

Aggregates Request, Error and Duration (R.E.D) metrics from span data.

**Request** counts are computed as the number of spans seen per unique set of dimensions, including Errors.
Expand Down
2 changes: 2 additions & 0 deletions processor/spanmetricsprocessor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ import (
"go.opentelemetry.io/collector/config/configmodels"
)

// Dimension defines the dimension name and optional default value if the Dimension is missing from a span attribute.
type Dimension struct {
Name string `mapstructure:"name"`
Default *string `mapstructure:"default"`
}

// Config defines the configuration options for spanmetricsprocessor.
type Config struct {
configmodels.ProcessorSettings `mapstructure:",squash"`

Expand Down
81 changes: 81 additions & 0 deletions processor/spanmetricsprocessor/mocks/Host.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions processor/spanmetricsprocessor/mocks/MetricsExporter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions processor/spanmetricsprocessor/mocks/TracesConsumer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8ca2e9b

Please sign in to comment.