Skip to content

Commit 039b606

Browse files
authored
[cmd/telemetrygen] Remove WithBlock from telemetrygen metrics/traces (#31631)
**Description:** Metrics and traces in telemetrygen were sent with WithBlock() which was a blocking call waiting on a successful connection to be formed. In the event a connection could not succeed, like a TLS handshake failure, the block would loop indefinitely. **Link to tracking Issue:** Resolves #31401 **Testing:** - Run telemetrygen on main pointed at a host that won't resolve TLS and observe that the command loops indefinitely - Run telemetrygen on this commit pointed at that same host and observe it exit after failing **Documentation:** <Describe the documentation added.>
1 parent babad8d commit 039b606

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: telemetrygen
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Do not use WithBlock when forming grpc connections for metrics/traces in telemetrygen to avoid infinite retry after failure
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [31401]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

cmd/telemetrygen/internal/metrics/exporter.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88

99
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc"
1010
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp"
11-
"google.golang.org/grpc"
1211

1312
"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/internal/common"
1413
)
@@ -18,9 +17,6 @@ import (
1817
func grpcExporterOptions(cfg *Config) ([]otlpmetricgrpc.Option, error) {
1918
grpcExpOpt := []otlpmetricgrpc.Option{
2019
otlpmetricgrpc.WithEndpoint(cfg.Endpoint()),
21-
otlpmetricgrpc.WithDialOption(
22-
grpc.WithBlock(),
23-
),
2420
}
2521

2622
if cfg.Insecure {

cmd/telemetrygen/internal/traces/exporter.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88

99
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
1010
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
11-
"google.golang.org/grpc"
1211

1312
"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/internal/common"
1413
)
@@ -18,9 +17,6 @@ import (
1817
func grpcExporterOptions(cfg *Config) ([]otlptracegrpc.Option, error) {
1918
grpcExpOpt := []otlptracegrpc.Option{
2019
otlptracegrpc.WithEndpoint(cfg.Endpoint()),
21-
otlptracegrpc.WithDialOption(
22-
grpc.WithBlock(),
23-
),
2420
}
2521

2622
if cfg.Insecure {

0 commit comments

Comments
 (0)