Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmd/telemetrygen] Use exporter per worker for better metrics throughput #27201

Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7a6c964
Add exporter per worker
marcelbirkner Sep 26, 2023
e967ab6
add changelog
marcelbirkner Sep 26, 2023
4cc75d7
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Sep 29, 2023
5f7fed4
Update cmd/telemetrygen/internal/metrics/worker_test.go
marcelbirkner Sep 29, 2023
70dd80b
Update cmd/telemetrygen/internal/metrics/worker_test.go
marcelbirkner Sep 29, 2023
741a9f0
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Sep 29, 2023
2dbed89
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Sep 29, 2023
62e021e
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Oct 5, 2023
29e6519
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Oct 5, 2023
ba1ef6b
Fix unit tests after merging main
marcelbirkner Oct 5, 2023
93ce180
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Oct 5, 2023
3a91fd3
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Oct 6, 2023
12ad731
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Oct 6, 2023
5dcbc38
Fix merge conflict
marcelbirkner Oct 6, 2023
66e606f
Update README with examples for logs and metrics
marcelbirkner Oct 6, 2023
0f48f82
Fix linting
marcelbirkner Oct 6, 2023
c549440
Fix linting
marcelbirkner Oct 6, 2023
ef6c2ef
Fix merge conflict
marcelbirkner Oct 6, 2023
f675be5
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Oct 13, 2023
b933d19
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Oct 18, 2023
bea0de8
Merge branch 'main' into telemetrygen-exporter-per-worker
marcelbirkner Oct 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix merge conflict
  • Loading branch information
marcelbirkner committed Oct 6, 2023
commit ef6c2effdde79e983b2341c70edeed88a3d0006d
27 changes: 2 additions & 25 deletions cmd/telemetrygen/internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ import (
"sync/atomic"
"time"

"google.golang.org/grpc"

"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/internal/common"
semconv "go.opentelemetry.io/collector/semconv/v1.13.0"
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc"
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp"
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/resource"
"go.uber.org/zap"
"golang.org/x/time/rate"

"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/internal/common"
)

// Start starts the metric telemetry generator
Expand All @@ -30,28 +29,6 @@ func Start(cfg *Config) error {
}
logger.Info("starting the metrics generator with configuration", zap.Any("config", cfg))

grpcExpOpt := []otlpmetricgrpc.Option{
otlpmetricgrpc.WithEndpoint(cfg.Endpoint()),
otlpmetricgrpc.WithDialOption(
grpc.WithBlock(),
),
}

httpExpOpt := []otlpmetrichttp.Option{
otlpmetrichttp.WithEndpoint(cfg.Endpoint()),
otlpmetrichttp.WithURLPath(cfg.HTTPPath),
}

if cfg.Insecure {
grpcExpOpt = append(grpcExpOpt, otlpmetricgrpc.WithInsecure())
httpExpOpt = append(httpExpOpt, otlpmetrichttp.WithInsecure())
}

if len(cfg.Headers) > 0 {
grpcExpOpt = append(grpcExpOpt, otlpmetricgrpc.WithHeaders(cfg.Headers))
httpExpOpt = append(httpExpOpt, otlpmetrichttp.WithHeaders(cfg.Headers))
}

expFunc := func() (sdkmetric.Exporter, error) {
var exp sdkmetric.Exporter
if cfg.UseHTTP {
Expand Down