Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski committed Feb 14, 2023
1 parent 44c9eb8 commit 35a6757
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .chloggen/spanmetricsconnector-unified.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ issues: [18535]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
subtext:
2 changes: 1 addition & 1 deletion connector/spanmetricsconnector/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Span Metrics Processor
# Span Metrics Connector

| Status | |
|------------------------- |---------------------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions connector/spanmetricsconnector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require github.com/open-telemetry/opentelemetry-collector-contrib/processor/span
require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/knadh/koanf v1.5.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
Expand All @@ -33,7 +33,7 @@ require (
golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect
google.golang.org/genproto v0.0.0-20230124163310-31e0e69b6fc2 // indirect
google.golang.org/grpc v1.52.3 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
Expand Down
10 changes: 5 additions & 5 deletions connector/spanmetricsconnector/go.sum

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

10 changes: 5 additions & 5 deletions processor/spanmetricsprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ func TestNewConnector(t *testing.T) {
cfg.Dimensions = tc.dimensions

// Test
traceProcessor, err := factory.CreateTracesToMetrics(context.Background(), creationParams, cfg, consumertest.NewNop())
smp := traceProcessor.(*processorImp)
traceConnector, err := factory.CreateTracesToMetrics(context.Background(), creationParams, cfg, consumertest.NewNop())
smc := traceConnector.(*processorImp)

// Verify
assert.Nil(t, err)
assert.NotNil(t, smp)
assert.NotNil(t, smc)

assert.Equal(t, tc.wantLatencyHistogramBuckets, smp.latencyBounds)
assert.Equal(t, tc.wantDimensions, smp.dimensions)
assert.Equal(t, tc.wantLatencyHistogramBuckets, smc.latencyBounds)
assert.Equal(t, tc.wantDimensions, smc.dimensions)
})
}
}
3 changes: 1 addition & 2 deletions processor/spanmetricsprocessor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func validateDimensions(dimensions []Dimension, skipSanitizeLabel bool) error {
// Start implements the component.Component interface.
func (p *processorImp) Start(ctx context.Context, host component.Host) error {
if p.tracesConsumer == nil {
p.logger.Info("Started spanmetricsconnector")
p.logger.Info("Starting spanmetricsconnector")
} else {
p.logger.Info("Starting spanmetricsprocessor")
exporters := host.GetExporters()
Expand Down Expand Up @@ -232,7 +232,6 @@ func (p *processorImp) Start(ctx context.Context, host component.Host) error {
return fmt.Errorf("failed to find metrics exporter: '%s'; please configure metrics_exporter from one of: %+v",
p.config.MetricsExporter, availableMetricsExporters)
}
p.logger.Info("Started spanmetricsprocessor")
}

p.started = true
Expand Down
3 changes: 1 addition & 2 deletions processor/spanmetricsprocessor/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,9 @@ func TestProcessorConcurrentShutdown(t *testing.T) {
}, time.Second, time.Millisecond*10)

// Starting spanmetricsprocessor...
// Started spanmetricsprocessor...
// Shutting down spanmetricsprocessor...
// Stopping ticker.
assert.Len(t, allLogs, 4)
assert.Len(t, allLogs, 3)
}

func TestConfigureLatencyBounds(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This example demonstrates all possible configuration parameters to
# the spanprocessor config.
# the spanconnector config.
receivers:
nop:

Expand All @@ -17,7 +17,7 @@ connectors:
# - span.kind
# - status.code
dimensions:
# If the span is missing http.method, the processor will insert
# If the span is missing http.method, the connector will insert
# the http.method dimension with value 'GET'.
# For example, in the following scenario, http.method is not present in a span and so will be added as a dimension to the metric with value "GET":
# - calls_total{http_method="GET",operation="/Address",service_name="shippingservice",span_kind="SPAN_KIND_SERVER",status_code="STATUS_CODE_UNSET"} 1
Expand Down

0 comments on commit 35a6757

Please sign in to comment.