Skip to content

Commit

Permalink
Merge branch 'main' into fix-update-otel-task
Browse files Browse the repository at this point in the history
  • Loading branch information
sincejune authored Feb 6, 2025
2 parents fd1095c + 6638b83 commit 8f0f51f
Show file tree
Hide file tree
Showing 76 changed files with 3,961 additions and 821 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# 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. filelogreceiver)
component: vcenterreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Adds three more vCenter virtual machine performance metrics

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [37488]

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

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# 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: [user]
27 changes: 27 additions & 0 deletions .chloggen/bearertokenauthextension-fix-grpc-token-refresh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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. filelogreceiver)
component: bearertokenauthextension

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Load token lazily for gRPC AUTH to fix token refresh issue

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [36749]

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

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# 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: []
27 changes: 27 additions & 0 deletions .chloggen/hostmetricsreceiver-feature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

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

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: receiver/hostmetrics

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Remove receiver.hostmetrics.normalizeProcessCPUUtilization feature gate"

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [34763]

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

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# 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: []
27 changes: 27 additions & 0 deletions .chloggen/routing-deprecations-v120.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

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

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove `match_once` configuration parameter.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [36824]

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

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# 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: []
27 changes: 27 additions & 0 deletions .chloggen/telemetrygen-public-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# 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. filelogreceiver)
component: telemetrygen

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Exported the API for telemetrygen for test uses. Additionally added new E2E tests and fixed race condition

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [36984]

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

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# 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: [api]
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Link Checker
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}}
id: lychee
uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374
uses: lycheeverse/lychee-action@f613c4a64e50d792e0b31ec34bbcbba12263c6a6
with:
args: "--verbose --no-progress ./changelog_preview.md --config .github/lychee.toml"
failIfEmpty: false
2 changes: 1 addition & 1 deletion .github/workflows/check-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@f796c8b7d468feb9b8c0a46da3fac0af6874d374
uses: lycheeverse/lychee-action@f613c4a64e50d792e0b31ec34bbcbba12263c6a6
with:
args: "--verbose --no-progress ${{needs.changedfiles.outputs.md_files}} ${{needs.changedfiles.outputs.yaml_files}} --config .github/lychee.toml"
failIfEmpty: false
8 changes: 7 additions & 1 deletion cmd/checkapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ func run(folder string, allowlistFilePath string) error {
return nil
}

func isTestFunction(fnName string) bool {
return strings.HasPrefix(fnName, "Test") ||
strings.HasPrefix(fnName, "Benchmark") ||
strings.HasPrefix(fnName, "Fuzz")
}

func handleFile(f *ast.File, result *api) {
for _, d := range f.Decls {
if str, isStr := d.(*ast.GenDecl); isStr {
Expand All @@ -107,7 +113,7 @@ func handleFile(f *ast.File, result *api) {
}
exported := false
receiver := ""
if fn.Recv.NumFields() == 0 && !strings.HasPrefix(fn.Name.String(), "Test") && !strings.HasPrefix(fn.Name.String(), "Benchmark") {
if fn.Recv.NumFields() == 0 && !isTestFunction(fn.Name.String()) {
exported = true
}
if fn.Recv.NumFields() > 0 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/oteltestbedcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extensions:

exporters:
- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.118.1-0.20250123125445-24f88da7b583
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.118.1-0.20250123125445-24f88da7b583
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.119.0
- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.118.1-0.20250123125445-24f88da7b583
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter v0.119.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.119.0
Expand Down
14 changes: 7 additions & 7 deletions cmd/telemetrygen/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (

"github.com/spf13/cobra"

"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/internal/logs"
"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/internal/metrics"
"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/internal/traces"
"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/pkg/logs"
"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/pkg/metrics"
"github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen/pkg/traces"
)

var (
Expand Down Expand Up @@ -64,13 +64,13 @@ var logsCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(tracesCmd, metricsCmd, logsCmd)

tracesCfg = new(traces.Config)
tracesCfg = traces.NewConfig()
tracesCfg.Flags(tracesCmd.Flags())

metricsCfg = new(metrics.Config)
metricsCfg = metrics.NewConfig()
metricsCfg.Flags(metricsCmd.Flags())

logsCfg = new(logs.Config)
logsCfg = logs.NewConfig()
logsCfg.Flags(logsCmd.Flags())

// Disabling completion command for end user
Expand All @@ -81,7 +81,7 @@ func init() {
// Execute tries to run the input command
func Execute() {
if err := rootCmd.Execute(); err != nil {
// TODO: Uncomment the line below when using Run instead of RunE in the xxxCmd functions
// TODO: Uncomment the line below when using run instead of RunE in the xxxCmd functions
// fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
Expand Down
49 changes: 34 additions & 15 deletions cmd/telemetrygen/internal/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,40 +148,59 @@ func (c *Config) GetHeaders() map[string]string {

// CommonFlags registers common config flags.
func (c *Config) CommonFlags(fs *pflag.FlagSet) {
fs.IntVar(&c.WorkerCount, "workers", 1, "Number of workers (goroutines) to run")
fs.Float64Var(&c.Rate, "rate", 0, "Approximately how many metrics/spans/logs per second each worker should generate. Zero means no throttling.")
fs.DurationVar(&c.TotalDuration, "duration", 0, "For how long to run the test")
fs.DurationVar(&c.ReportingInterval, "interval", 1*time.Second, "Reporting interval")
fs.IntVar(&c.WorkerCount, "workers", c.WorkerCount, "Number of workers (goroutines) to run")
fs.Float64Var(&c.Rate, "rate", c.Rate, "Approximately how many metrics/spans/logs per second each worker should generate. Zero means no throttling.")
fs.DurationVar(&c.TotalDuration, "duration", c.TotalDuration, "For how long to run the test")
fs.DurationVar(&c.ReportingInterval, "interval", c.ReportingInterval, "Reporting interval")

fs.StringVar(&c.CustomEndpoint, "otlp-endpoint", "", "Destination endpoint for exporting logs, metrics and traces")
fs.BoolVar(&c.Insecure, "otlp-insecure", false, "Whether to enable client transport security for the exporter's grpc or http connection")
fs.BoolVar(&c.InsecureSkipVerify, "otlp-insecure-skip-verify", false, "Whether a client verifies the server's certificate chain and host name")
fs.BoolVar(&c.UseHTTP, "otlp-http", false, "Whether to use HTTP exporter rather than a gRPC one")
fs.StringVar(&c.CustomEndpoint, "otlp-endpoint", c.CustomEndpoint, "Destination endpoint for exporting logs, metrics and traces")
fs.BoolVar(&c.Insecure, "otlp-insecure", c.Insecure, "Whether to enable client transport security for the exporter's grpc or http connection")
fs.BoolVar(&c.InsecureSkipVerify, "otlp-insecure-skip-verify", c.InsecureSkipVerify, "Whether a client verifies the server's certificate chain and host name")
fs.BoolVar(&c.UseHTTP, "otlp-http", c.UseHTTP, "Whether to use HTTP exporter rather than a gRPC one")

// custom headers
c.Headers = make(KeyValue)
fs.Var(&c.Headers, "otlp-header", "Custom header to be passed along with each OTLP request. The value is expected in the format key=\"value\". "+
"Note you may need to escape the quotes when using the tool from a cli. "+
`Flag may be repeated to set multiple headers (e.g --otlp-header key1=\"value1\" --otlp-header key2=\"value2\")`)

// custom resource attributes
c.ResourceAttributes = make(KeyValue)
fs.Var(&c.ResourceAttributes, "otlp-attributes", "Custom resource attributes to use. The value is expected in the format key=\"value\". "+
"You can use key=true or key=false. to set boolean attribute."+
"Note you may need to escape the quotes when using the tool from a cli. "+
`Flag may be repeated to set multiple attributes (e.g --otlp-attributes key1=\"value1\" --otlp-attributes key2=\"value2\" --telemetry-attributes key3=true)`)

c.TelemetryAttributes = make(KeyValue)
fs.Var(&c.TelemetryAttributes, "telemetry-attributes", "Custom telemetry attributes to use. The value is expected in the format key=\"value\". "+
"You can use key=true or key=false. to set boolean attribute."+
"Note you may need to escape the quotes when using the tool from a cli. "+
`Flag may be repeated to set multiple attributes (e.g --telemetry-attributes key1=\"value1\" --telemetry-attributes key2=\"value2\" --telemetry-attributes key3=true)`)

// TLS CA configuration
fs.StringVar(&c.CaFile, "ca-cert", "", "Trusted Certificate Authority to verify server certificate")
fs.StringVar(&c.CaFile, "ca-cert", c.CaFile, "Trusted Certificate Authority to verify server certificate")

// mTLS configuration
fs.BoolVar(&c.ClientAuth.Enabled, "mtls", false, "Whether to require client authentication for mTLS")
fs.StringVar(&c.ClientAuth.ClientCertFile, "client-cert", "", "Client certificate file")
fs.StringVar(&c.ClientAuth.ClientKeyFile, "client-key", "", "Client private key file")
fs.BoolVar(&c.ClientAuth.Enabled, "mtls", c.ClientAuth.Enabled, "Whether to require client authentication for mTLS")
fs.StringVar(&c.ClientAuth.ClientCertFile, "client-cert", c.ClientAuth.ClientCertFile, "Client certificate file")
fs.StringVar(&c.ClientAuth.ClientKeyFile, "client-key", c.ClientAuth.ClientKeyFile, "Client private key file")
}

// SetDefaults is here to mirror the defaults for flags above,
// This allows for us to have a single place to change the defaults
// while exposing the API for use.
func (c *Config) SetDefaults() {
c.WorkerCount = 1
c.Rate = 0
c.TotalDuration = 0
c.ReportingInterval = 1 * time.Second
c.CustomEndpoint = ""
c.Insecure = false
c.InsecureSkipVerify = false
c.UseHTTP = false
c.HTTPPath = ""
c.Headers = make(KeyValue)
c.ResourceAttributes = make(KeyValue)
c.TelemetryAttributes = make(KeyValue)
c.CaFile = ""
c.ClientAuth.Enabled = false
c.ClientAuth.ClientCertFile = ""
c.ClientAuth.ClientKeyFile = ""
}
7 changes: 7 additions & 0 deletions cmd/telemetrygen/internal/e2etest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,21 @@ require (
go.opentelemetry.io/collector/pipeline v0.119.0 // indirect
go.opentelemetry.io/collector/receiver v0.119.0 // indirect
go.opentelemetry.io/collector/receiver/xreceiver v0.119.0 // indirect
go.opentelemetry.io/collector/semconv v0.119.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
go.opentelemetry.io/otel v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.10.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.10.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect
go.opentelemetry.io/otel/log v0.10.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
go.opentelemetry.io/otel/sdk/log v0.10.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
Expand Down
Loading

0 comments on commit 8f0f51f

Please sign in to comment.