Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgopack4 authored Jul 24, 2024
2 parents d0333ba + 49ea32b commit d03f390
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 38 deletions.
25 changes: 25 additions & 0 deletions .chloggen/exporterhelper_metric_units.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: exporterhelper

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Update units for internal telemetry

# One or more tracking issues or pull requests related to the change
issues: [10648]

# (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:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
12 changes: 12 additions & 0 deletions .chloggen/jpkroehling-grpc-statuscode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'enhancement'

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: configgrpc

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: gRPC auth errors now return gRPC status code UNAUTHENTICATED (16)

# One or more tracking issues or pull requests related to the change
issues: [7646]

6 changes: 4 additions & 2 deletions config/configgrpc/configgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ import (
"go.opentelemetry.io/otel"
"google.golang.org/grpc"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/encoding/gzip"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/peer"
"google.golang.org/grpc/status"

"go.opentelemetry.io/collector/client"
"go.opentelemetry.io/collector/component"
Expand Down Expand Up @@ -478,7 +480,7 @@ func authUnaryServerInterceptor(ctx context.Context, req any, _ *grpc.UnaryServe

ctx, err := server.Authenticate(ctx, headers)
if err != nil {
return nil, err
return nil, status.Error(codes.Unauthenticated, err.Error())
}

return handler(ctx, req)
Expand All @@ -493,7 +495,7 @@ func authStreamServerInterceptor(srv any, stream grpc.ServerStream, _ *grpc.Stre

ctx, err := server.Authenticate(ctx, headers)
if err != nil {
return err
return status.Error(codes.Unauthenticated, err.Error())
}

return handler(srv, wrapServerStream(ctx, stream))
Expand Down
8 changes: 6 additions & 2 deletions config/configgrpc/configgrpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ import (
"go.uber.org/zap/zaptest/observer"
"google.golang.org/grpc"
"google.golang.org/grpc/balancer"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/peer"
"google.golang.org/grpc/status"

"go.opentelemetry.io/collector/client"
"go.opentelemetry.io/collector/component"
Expand Down Expand Up @@ -1022,7 +1024,8 @@ func TestDefaultUnaryInterceptorAuthFailure(t *testing.T) {

// verify
assert.Nil(t, res)
assert.Equal(t, expectedErr, err)
assert.ErrorContains(t, err, expectedErr.Error())
assert.Equal(t, codes.Unauthenticated, status.Code(err))
assert.True(t, authCalled)
}

Expand Down Expand Up @@ -1098,7 +1101,8 @@ func TestDefaultStreamInterceptorAuthFailure(t *testing.T) {
err := authStreamServerInterceptor(nil, streamServer, &grpc.StreamServerInfo{}, handler, auth.NewServer(auth.WithServerAuthenticate(authFunc)))

// verify
assert.Equal(t, expectedErr, err)
assert.ErrorContains(t, err, expectedErr.Error()) // unfortunately, grpc errors don't wrap the original ones
assert.Equal(t, codes.Unauthenticated, status.Code(err))
assert.True(t, authCalled)
}

Expand Down
2 changes: 1 addition & 1 deletion docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ Once a module is ready to be released under the `1.x` version scheme, file a PR

| Date | Version | Release manager |
|------------|----------|---------------------------------------------------|
| 2024-07-15 | v0.105.0 | [@atoulme](https://github.com/atoulme) |
| 2024-07-29 | v0.106.0 | [@songy23](https://github.com/songy23) |
| 2024-08-12 | v0.107.0 | [@dmitryax](https://github.com/dmitryax) |
| 2024-08-26 | v0.108.0 | [@codeboten](https://github.com/codeboten) |
Expand All @@ -169,3 +168,4 @@ Once a module is ready to be released under the `1.x` version scheme, file a PR
| 2024-10-21 | v0.112.0 | [@evan-bradley](https://github.com/evan-bradley) |
| 2024-11-04 | v0.113.0 | [@djaglowski](https://github.com/djaglowski) |
| 2024-11-18 | v0.114.0 | [@TylerHelmuth](https://github.com/TylerHelmuth) |
| 2024-12-02 | v0.115.0 | [@atoulme](https://github.com/atoulme) |
22 changes: 11 additions & 11 deletions exporter/exporterhelper/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,84 +12,84 @@ Number of log records failed to be added to the sending queue.

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {records} | Sum | Int | true |

### otelcol_exporter_enqueue_failed_metric_points

Number of metric points failed to be added to the sending queue.

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {datapoints} | Sum | Int | true |

### otelcol_exporter_enqueue_failed_spans

Number of spans failed to be added to the sending queue.

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {spans} | Sum | Int | true |

### otelcol_exporter_queue_capacity

Fixed capacity of the retry queue (in batches)

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Gauge | Int |
| {batches} | Gauge | Int |

### otelcol_exporter_queue_size

Current size of the retry queue (in batches)

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| 1 | Gauge | Int |
| {batches} | Gauge | Int |

### otelcol_exporter_send_failed_log_records

Number of log records in failed attempts to send to destination.

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {records} | Sum | Int | true |

### otelcol_exporter_send_failed_metric_points

Number of metric points in failed attempts to send to destination.

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {datapoints} | Sum | Int | true |

### otelcol_exporter_send_failed_spans

Number of spans in failed attempts to send to destination.

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {spans} | Sum | Int | true |

### otelcol_exporter_sent_log_records

Number of log record successfully sent to destination.

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {records} | Sum | Int | true |

### otelcol_exporter_sent_metric_points

Number of metric points successfully sent to destination.

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {datapoints} | Sum | Int | true |

### otelcol_exporter_sent_spans

Number of spans successfully sent to destination.

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
| {spans} | Sum | Int | true |
22 changes: 11 additions & 11 deletions exporter/exporterhelper/internal/metadata/generated_telemetry.go

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

22 changes: 11 additions & 11 deletions exporter/exporterhelper/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,79 +12,79 @@ telemetry:
exporter_sent_spans:
enabled: true
description: Number of spans successfully sent to destination.
unit: "1"
unit: "{spans}"
sum:
value_type: int
monotonic: true

exporter_send_failed_spans:
enabled: true
description: Number of spans in failed attempts to send to destination.
unit: "1"
unit: "{spans}"
sum:
value_type: int
monotonic: true

exporter_enqueue_failed_spans:
enabled: true
description: Number of spans failed to be added to the sending queue.
unit: "1"
unit: "{spans}"
sum:
value_type: int
monotonic: true

exporter_sent_metric_points:
enabled: true
description: Number of metric points successfully sent to destination.
unit: "1"
unit: "{datapoints}"
sum:
value_type: int
monotonic: true

exporter_send_failed_metric_points:
enabled: true
description: Number of metric points in failed attempts to send to destination.
unit: "1"
unit: "{datapoints}"
sum:
value_type: int
monotonic: true

exporter_enqueue_failed_metric_points:
enabled: true
description: Number of metric points failed to be added to the sending queue.
unit: "1"
unit: "{datapoints}"
sum:
value_type: int
monotonic: true

exporter_sent_log_records:
enabled: true
description: Number of log record successfully sent to destination.
unit: "1"
unit: "{records}"
sum:
value_type: int
monotonic: true

exporter_send_failed_log_records:
enabled: true
description: Number of log records in failed attempts to send to destination.
unit: "1"
unit: "{records}"
sum:
value_type: int
monotonic: true

exporter_enqueue_failed_log_records:
enabled: true
description: Number of log records failed to be added to the sending queue.
unit: "1"
unit: "{records}"
sum:
value_type: int
monotonic: true

exporter_queue_size:
enabled: true
description: Current size of the retry queue (in batches)
unit: "1"
unit: "{batches}"
optional: true
gauge:
value_type: int
Expand All @@ -93,7 +93,7 @@ telemetry:
exporter_queue_capacity:
enabled: true
description: Fixed capacity of the retry queue (in batches)
unit: "1"
unit: "{batches}"
optional: true
gauge:
value_type: int
Expand Down

0 comments on commit d03f390

Please sign in to comment.