diff --git a/exporter/cortexexporter/config.go b/exporter/cortexexporter/config.go index 6afe2a0077c..d78eba3d875 100644 --- a/exporter/cortexexporter/config.go +++ b/exporter/cortexexporter/config.go @@ -26,7 +26,6 @@ type Config struct { exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. exporterhelper.QueueSettings `mapstructure:"sending_queue"` exporterhelper.RetrySettings `mapstructure:"retry_on_failure"` - // Namespace if set, exports metrics under the provided value. Namespace string `mapstructure:"namespace"` diff --git a/exporter/cortexexporter/cortex.go b/exporter/cortexexporter/cortex.go index d896b93daca..1fb789ada5f 100644 --- a/exporter/cortexexporter/cortex.go +++ b/exporter/cortexexporter/cortex.go @@ -32,11 +32,12 @@ import ( otlp "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1" ) - +// TODO: get default labels such as job or instance from Resource type cortexExporter struct { namespace string endpoint string client *http.Client + headers map[string]string wg *sync.WaitGroup closeChan chan struct{} } diff --git a/exporter/cortexexporter/cortex_test.go b/exporter/cortexexporter/cortex_test.go index cc6cd1538f2..f381c1935b8 100644 --- a/exporter/cortexexporter/cortex_test.go +++ b/exporter/cortexexporter/cortex_test.go @@ -41,8 +41,9 @@ import ( // "github.com/stretchr/testify/require" ) -// TODO: try to run Test_PushMetrics after export is in +// TODO: try to run Test_PushMetrics after export() is in // TODO: add bucket and histogram test cases for Test_PushMetrics +// TODO: check that NoError instead of NoNil is used at the right places //return false if descriptor type is nil func Test_validateMetrics(t *testing.T) { diff --git a/exporter/cortexexporter/testdata/config.yaml b/exporter/cortexexporter/testdata/config.yaml index 63e8eaa7184..765d4185d27 100644 --- a/exporter/cortexexporter/testdata/config.yaml +++ b/exporter/cortexexporter/testdata/config.yaml @@ -12,38 +12,31 @@ exporters: Prometheus-Remote-Write-Version: "0.1.0" Tenant-id: 234 another: "somevalue" + + namespace: "" + #A lot of this will be rewritten timeout: 10s reconnection_delay: 15 compression: "on" - num_workers: 4 - namespace: "prefix" - const_labels: - label1: value1 - label2: value2 + + basic_auth: #Nope username: "username" password: "1234" password_file: "yes" http_config: # CA certificate to validate API server certificate with. - http_endpoint: "localhost:8888" + endpoint: "localhost:8888" tls_config: ca_file: /var/lib/mycert.pem - read_buffer: - - write_buffer: + read_buffer_size: + write_buffer: + timeout: 5s # ServerName extension to indicate the name of the server. # https://tools.ietf.org/html/rfc4366#section-3. - - - - - - - - service: +service: pipelines: traces: receivers: [examplereceiver]