Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ jobs:
benchmark-data-dir-path: ""
# Set auto-push to false since GitHub API token is not given
auto-push: false
alert-threshold: '150%'
alert-threshold: '170%'
gh-pages-branch: "benchmark-results"
fail-on-alert: true
- name: Push benchmark result
Expand Down
417 changes: 211 additions & 206 deletions go.mod

Large diffs are not rendered by default.

1,143 changes: 580 additions & 563 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/collector/nginxplusreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ func createMetricsReceiver(
&cfg.ControllerConfig,
params,
metricsConsumer,
scraperhelper.AddScraper(metadata.Type, npsMetrics),
scraperhelper.AddMetricsScraper(metadata.Type, npsMetrics),
)
}
4 changes: 2 additions & 2 deletions internal/collector/nginxreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func createMetrics(
return nil, stubStatusMetricsError
}

controllers = append(controllers, scraperhelper.AddScraper(metadata.Type, stubStatusMetrics))
controllers = append(controllers, scraperhelper.AddMetricsScraper(metadata.Type, stubStatusMetrics))

if len(cfg.AccessLogs) > 0 {
accessLogScraper := accesslog.NewScraper(params, cfg)
Expand All @@ -68,7 +68,7 @@ func createMetrics(
return nil, accessLogMetricsError
}

controllers = append(controllers, scraperhelper.AddScraper(metadata.Type, accessLogMetrics))
controllers = append(controllers, scraperhelper.AddMetricsScraper(metadata.Type, accessLogMetrics))
}

return scraperhelper.NewMetricsController(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const operatorType = "access_log_file_input"

// Config is the configuration of a file input operator
type Config struct {
helper.InputConfig `mapstructure:",squash"`
AccessLogFormat string `mapstructure:"access_log_format"`
fileconsumer.Config `mapstructure:",squash"`
AccessLogFormat string `mapstructure:"access_log_format"`
helper.InputConfig `mapstructure:",squash"`
}

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"sync"
"time"

"github.com/nginxinc/nginx-prometheus-exporter/client"
"github.com/nginx/nginx-prometheus-exporter/client"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/pmetric"
Expand Down
2 changes: 1 addition & 1 deletion internal/collector/otelcol.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ processors:

exporters:
{{- range $index, $otlpExporter := .Exporters.OtlpExporters }}
otlp/{{$index}}:
otlp_grpc/{{$index}}:
endpoint: "{{ .Server.Host -}}:{{- .Server.Port }}"
{{- if .Compression }}
compression: {{ .Compression }}
Expand Down
6 changes: 6 additions & 0 deletions internal/collector/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ func writeCollectorConfig(conf *config.Collector) error {
addDefaultResourceProcessor(conf.Pipelines.Logs)
}

for _, pipeline := range conf.Pipelines.Metrics {
if i := slices.Index(pipeline.Exporters, "otlp/default"); i != -1 {
pipeline.Exporters[i] = "otlp_grpc/default"
}
}

otelcolTemplate, templateErr := template.New(otelTemplatePath).Parse(otelcolTemplate)
if templateErr != nil {
return templateErr
Expand Down
4 changes: 2 additions & 2 deletions internal/collector/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ func TestTemplateWrite(t *testing.T) {
"otlp/default", "nginx", "nginxplus/456", "nginxplus/789",
},
Processors: []string{"resource/default", "batch/default"},
Exporters: []string{"otlp/default", "prometheus", "debug"},
Exporters: []string{"otlp_grpc/default", "prometheus", "debug"},
}
cfg.Collector.Pipelines.Logs = make(map[string]*config.Pipeline)
cfg.Collector.Pipelines.Logs["default"] = &config.Pipeline{
Receivers: []string{"tcplog/default"},
Processors: []string{"securityviolationsfilter/default", "resource/default", "batch/default"},
Exporters: []string{"otlp/default", "debug"},
Exporters: []string{"otlp_grpc/default", "debug"},
}

require.NotNil(t, cfg)
Expand Down
4 changes: 2 additions & 2 deletions internal/collector/testdata/merge_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
exporters:
otlp/default:
otlp_grpc/default:
endpoint: 127.0.0.1:9091
retry_on_failure:
enabled: true
Expand Down Expand Up @@ -52,7 +52,7 @@ service:
pipelines:
metrics/default:
exporters:
- otlp/default
- otlp_grpc/default
processors:
- batch/default_metrics
- resource/default
Expand Down
4 changes: 2 additions & 2 deletions internal/collector/testdata/otel_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ processors:
logsgzip/default: {}

exporters:
otlp/default:
otlp_grpc/default:
endpoint: "127.0.0.1:9091"
timeout: 10s
retry_on_failure:
Expand All @@ -61,4 +61,4 @@ service:
- batch/default_metrics
- resource/default
exporters:
- otlp/default
- otlp_grpc/default
4 changes: 2 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func addDefaultPipelines(collector *Collector) {
collector.Pipelines.Metrics[DefaultPipeline] = &Pipeline{
Receivers: []string{"host_metrics", "nginx_metrics"},
Processors: []string{"batch/default_metrics"},
Exporters: []string{"otlp/default"},
Exporters: []string{"otlp_grpc/default"},
}
}

Expand All @@ -229,7 +229,7 @@ func addDefaultPipelines(collector *Collector) {
collector.Pipelines.Logs[DefaultPipeline] = &Pipeline{
Receivers: []string{"tcplog/nginx_app_protect"},
Processors: []string{"securityviolationsfilter/default", "batch/default_logs"},
Exporters: []string{"otlp/default"},
Exporters: []string{"otlp_grpc/default"},
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1360,14 +1360,14 @@ func createConfig() *Config {
"default": {
Receivers: []string{"host_metrics", "nginx_metrics"},
Processors: []string{"batch/default_metrics"},
Exporters: []string{"otlp/default"},
Exporters: []string{"otlp_grpc/default"},
},
},
Logs: map[string]*Pipeline{
"default": {
Receivers: []string{"tcplog/nginx_app_protect"},
Processors: []string{"securityviolationsfilter/default", "batch/default_logs"},
Exporters: []string{"otlp/default"},
Exporters: []string{"otlp_grpc/default"},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ processors:
securityviolationsfilter/default: {}

exporters:
otlp/default:
otlp_grpc/default:
endpoint: "127.0.0.1:1234"
compression: none
timeout: 10s
Expand Down Expand Up @@ -133,7 +133,7 @@ service:
- resource/default
- batch/default
exporters:
- otlp/default
- otlp_grpc/default
- prometheus
- debug
logs/default:
Expand All @@ -144,5 +144,5 @@ service:
- resource/default
- batch/default
exporters:
- otlp/default
- otlp_grpc/default
- debug
2 changes: 1 addition & 1 deletion test/integration/utils/config_apply_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func PerformConfigApply(t *testing.T, nginxInstanceID, mockManagementPlaneAPIAdd
client.SetRetryCount(RetryCount).SetRetryWaitTime(RetryWaitTime).SetRetryMaxWaitTime(RetryMaxWaitTime)

url := fmt.Sprintf("http://%s/api/v1/instance/%s/config/apply", mockManagementPlaneAPIAddress, nginxInstanceID)
resp, err := client.R().EnableTrace().Post(url)
resp, err := client.R().EnableTrace().SetContentLength(true).Post(url)

t.Logf("Config ApplyResponse: %s", resp.String())
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions test/mock/collector/otel-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exporters:
verbosity: detailed
sampling_initial: 5
sampling_thereafter: 200
otlphttp:
otlp_http:
endpoint: http://loki:3100/otlp

processors:
Expand All @@ -42,4 +42,4 @@ service:
logs:
receivers: [otlp]
processors: [resource, batch]
exporters: [otlphttp]
exporters: [otlp_http]
2 changes: 1 addition & 1 deletion test/types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func AgentConfig() *config.Config {
"default": {
Receivers: []string{"host_metrics"},
Processors: []string{"batch/default"},
Exporters: []string{"otlp/default"},
Exporters: []string{"otlp_grpc/default"},
},
},
},
Expand Down
Loading