Skip to content
Merged
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: 2 additions & 0 deletions defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package defaults
import (
"github.com/open-telemetry/opentelemetry-service/exporter"
"github.com/open-telemetry/opentelemetry-service/exporter/jaeger/jaegergrpcexporter"
"github.com/open-telemetry/opentelemetry-service/exporter/jaeger/jaegerthrifthttpexporter"
"github.com/open-telemetry/opentelemetry-service/exporter/loggingexporter"
"github.com/open-telemetry/opentelemetry-service/exporter/opencensusexporter"
"github.com/open-telemetry/opentelemetry-service/exporter/prometheusexporter"
Expand Down Expand Up @@ -62,6 +63,7 @@ func Components() (
&loggingexporter.Factory{},
&zipkinexporter.Factory{},
&jaegergrpcexporter.Factory{},
&jaegerthrifthttpexporter.Factory{},
)
if err != nil {
errs = append(errs, err)
Expand Down
12 changes: 7 additions & 5 deletions defaults/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/open-telemetry/opentelemetry-service/exporter"
"github.com/open-telemetry/opentelemetry-service/exporter/jaeger/jaegergrpcexporter"
"github.com/open-telemetry/opentelemetry-service/exporter/jaeger/jaegerthrifthttpexporter"
"github.com/open-telemetry/opentelemetry-service/exporter/loggingexporter"
"github.com/open-telemetry/opentelemetry-service/exporter/opencensusexporter"
"github.com/open-telemetry/opentelemetry-service/exporter/prometheusexporter"
Expand Down Expand Up @@ -56,11 +57,12 @@ func TestDefaultComponents(t *testing.T) {
"batch": &nodebatcher.Factory{},
}
expectedExporters := map[string]exporter.Factory{
"opencensus": &opencensusexporter.Factory{},
"prometheus": &prometheusexporter.Factory{},
"logging": &loggingexporter.Factory{},
"zipkin": &zipkinexporter.Factory{},
"jaeger-grpc": &jaegergrpcexporter.Factory{},
"opencensus": &opencensusexporter.Factory{},
"prometheus": &prometheusexporter.Factory{},
"logging": &loggingexporter.Factory{},
"zipkin": &zipkinexporter.Factory{},
"jaeger-grpc": &jaegergrpcexporter.Factory{},
"jaeger-thrift-http": &jaegerthrifthttpexporter.Factory{},
}

receivers, processors, exporters, err := Components()
Expand Down
6 changes: 6 additions & 0 deletions examples/demotrace/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ exporters:
jaeger-grpc:
endpoint: jaeger-all-in-one:14250

# Alternatively, use jaeger-thrift-http with the settings below. In this case
# update the list of exporters on the traces pipeline.
#
# jaeger-thrift-http:
# url: http://jaeger-all-in-one:14268/api/traces

processors:
batch:
queued-retry:
Expand Down
126 changes: 0 additions & 126 deletions exporter/jaeger/jaeger_thrift_http_sender.go

This file was deleted.

62 changes: 0 additions & 62 deletions exporter/jaeger/jaeger_thrift_tchannel_sender.go

This file was deleted.

38 changes: 38 additions & 0 deletions exporter/jaeger/jaegerthrifthttpexporter/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright 2019, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package jaegerthrifthttpexporter

import (
"time"

"github.com/open-telemetry/opentelemetry-service/config/configmodels"
)

// Config defines configuration for Jaeger Thrift over HTTP exporter.
type Config struct {
configmodels.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.

// URL is the URL to send the Jaeger trace data to (e.g.:
// http://some.url:14268/api/traces).
URL string `mapstructure:"url"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can we use endpoint to be consistent with other configs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have been consistent on endpoint for receivers because they should always take the same syntax (host:port) but for exporters we had a different conversation in one previous PR: #207 (comment) let's know if you agree with that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM


// Timeout is the maximum timeout for HTTP request sending trace data. The
// default value is 5 seconds.
Timeout time.Duration `mapstructure:"timeout"`

// Headers are a set of headers to be added to the HTTP request sending
// trace data.
Headers map[string]string `mapstructure:"headers"`
}
69 changes: 69 additions & 0 deletions exporter/jaeger/jaegerthrifthttpexporter/config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Copyright 2019, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package jaegerthrifthttpexporter

import (
"path"
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap"

"github.com/open-telemetry/opentelemetry-service/config"
"github.com/open-telemetry/opentelemetry-service/config/configmodels"
)

func TestLoadConfig(t *testing.T) {
receivers, processors, exporters, err := config.ExampleComponents()
assert.Nil(t, err)

factory := &Factory{}
exporters[typeStr] = factory
cfg, err := config.LoadConfigFile(
t, path.Join(".", "testdata", "config.yaml"), receivers, processors, exporters,
)

require.NoError(t, err)
require.NotNil(t, cfg)

e0 := cfg.Exporters["jaeger-thrift-http"]

// URL doesn't have a default value so set it directly.
defaultCfg := factory.CreateDefaultConfig().(*Config)
defaultCfg.URL = "http://some.location:14268/api/traces"
assert.Equal(t, defaultCfg, e0)

expectedName := "jaeger-thrift-http/2"

e1 := cfg.Exporters[expectedName]
expectedCfg := Config{
ExporterSettings: configmodels.ExporterSettings{
TypeVal: typeStr,
NameVal: expectedName,
},
URL: "http://some.other.location/api/traces",
Headers: map[string]string{
"added-entry": "added value",
"dot.test": "test",
},
Timeout: 2 * time.Second,
}
assert.Equal(t, &expectedCfg, e1)

_, _, err = factory.CreateTraceExporter(zap.NewNop(), e1)
require.NoError(t, err)
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package jaeger

// TODO: Delete me when tests are added.
// Package jaegerthrifthttpexporter implements an exporter that sends trace data
// to a Jaeger collector Thrift over HTTP endpoint.
package jaegerthrifthttpexporter
Loading