Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

Commit c1c9bca

Browse files
author
Bogdan Drutu
authored
Move every exporter in it's own directory. (#406)
1 parent 045ff22 commit c1c9bca

15 files changed

Lines changed: 50 additions & 36 deletions

File tree

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package exporterparser
15+
package awsexporter
1616

1717
import (
1818
"context"
@@ -28,6 +28,7 @@ import (
2828

2929
"github.com/census-instrumentation/opencensus-service/data"
3030
"github.com/census-instrumentation/opencensus-service/exporter"
31+
"github.com/census-instrumentation/opencensus-service/exporter/exporterparser"
3132
)
3233

3334
const defaultVersionForAWSXRayApplications = "latest"
@@ -172,7 +173,7 @@ func (axe *awsXRayExporter) ExportSpans(ctx context.Context, td data.TraceData)
172173
if err != nil {
173174
return err
174175
}
175-
return ocProtoSpansToOCSpanDataInstrumented(ctx, "aws-xray", exp, td)
176+
return exporterparser.OcProtoSpansToOCSpanDataInstrumented(ctx, "aws-xray", exp, td)
176177
}
177178

178179
func (axe *awsXRayExporter) getOrMakeExporterByServiceName(serviceName string) (*xray.Exporter, error) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package exporterparser
15+
package awsexporter
1616

1717
import (
1818
"fmt"
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package exporterparser
15+
package datadogexporter
1616

1717
import (
1818
"context"
@@ -22,6 +22,7 @@ import (
2222

2323
"github.com/census-instrumentation/opencensus-service/data"
2424
"github.com/census-instrumentation/opencensus-service/exporter"
25+
"github.com/census-instrumentation/opencensus-service/exporter/exporterparser"
2526
)
2627

2728
type datadogConfig struct {
@@ -90,5 +91,5 @@ func (dde *datadogExporter) ExportSpans(ctx context.Context, td data.TraceData)
9091
// TODO: Examine the Datadog exporter to see
9192
// if trace.ExportSpan was constraining and if perhaps the
9293
// upload can use the context and information from the Node.
93-
return ocProtoSpansToOCSpanDataInstrumented(ctx, "datadog", dde.exporter, td)
94+
return exporterparser.OcProtoSpansToOCSpanDataInstrumented(ctx, "datadog", dde.exporter, td)
9495
}

exporter/exporterparser/exparser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
tracetranslator "github.com/census-instrumentation/opencensus-service/translator/trace"
3333
)
3434

35-
// ocProtoSpansToOCSpanDataInstrumented converts
35+
// OcProtoSpansToOCSpanDataInstrumented converts
3636
// OpenCensus Proto TraceData to OpenCensus-Go SpanData.
3737
// The "Instrumented" suffix serves to document that this
3838
// function is traced but also has stats for self-observability.
@@ -42,7 +42,7 @@ import (
4242
// by various vendors and contributors. Eventually the goal is to
4343
// get those exporters converted to directly receive
4444
// OpenCensus Proto TraceData.
45-
func ocProtoSpansToOCSpanDataInstrumented(ctx context.Context, exporterName string, te trace.Exporter, td data.TraceData) (aerr error) {
45+
func OcProtoSpansToOCSpanDataInstrumented(ctx context.Context, exporterName string, te trace.Exporter, td data.TraceData) (aerr error) {
4646
ctx, span := trace.StartSpan(ctx,
4747
"opencensus.service.exporter."+exporterName+".ExportTrace",
4848
trace.WithSampler(trace.NeverSample()))
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package exporterparser
15+
package honeycombexporter
1616

1717
// TODO: (@odeke-em) file an issue at the official Honeycomb repository to
1818
// ask them to make an exporter that uses OpenCensus-Proto instead of OpenCensus-Go.
@@ -25,6 +25,7 @@ import (
2525

2626
"github.com/census-instrumentation/opencensus-service/data"
2727
"github.com/census-instrumentation/opencensus-service/exporter"
28+
"github.com/census-instrumentation/opencensus-service/exporter/exporterparser"
2829
)
2930

3031
type honeycombConfig struct {
@@ -63,5 +64,5 @@ type honeycombExporter struct {
6364
}
6465

6566
func (hce *honeycombExporter) ExportSpans(ctx context.Context, td data.TraceData) error {
66-
return ocProtoSpansToOCSpanDataInstrumented(ctx, "honeycomb", hce.exporter, td)
67+
return exporterparser.OcProtoSpansToOCSpanDataInstrumented(ctx, "honeycomb", hce.exporter, td)
6768
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package exporterparser
15+
package jaegerexporter
1616

1717
import (
1818
"context"
@@ -22,6 +22,7 @@ import (
2222

2323
"github.com/census-instrumentation/opencensus-service/data"
2424
"github.com/census-instrumentation/opencensus-service/exporter"
25+
"github.com/census-instrumentation/opencensus-service/exporter/exporterparser"
2526
)
2627

2728
// Slight modified version of go/src/go.opencensus.io/exporter/jaeger/jaeger.go
@@ -75,5 +76,5 @@ func (je *jaegerExporter) ExportSpans(ctx context.Context, td data.TraceData) er
7576
// TODO: Examine "contrib.go.opencensus.io/exporter/jaeger" to see
7677
// if trace.ExportSpan was constraining and if perhaps the Jaeger
7778
// upload can use the context and information from the Node.
78-
return ocProtoSpansToOCSpanDataInstrumented(ctx, "jaeger", je.exporter, td)
79+
return exporterparser.OcProtoSpansToOCSpanDataInstrumented(ctx, "jaeger", je.exporter, td)
7980
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package exporterparser
15+
package kafkaexporter
1616

1717
import (
1818
"context"
1919
"fmt"
2020

2121
"github.com/spf13/viper"
22-
"github.com/yancl/opencensus-go-exporter-kafka"
22+
kafka "github.com/yancl/opencensus-go-exporter-kafka"
2323

2424
"github.com/census-instrumentation/opencensus-service/data"
2525
"github.com/census-instrumentation/opencensus-service/exporter"
26+
"github.com/census-instrumentation/opencensus-service/exporter/exporterparser"
2627
)
2728

2829
type kafkaConfig struct {
@@ -69,5 +70,5 @@ func KafkaExportersFromViper(v *viper.Viper) (tes []exporter.TraceExporter, mes
6970
}
7071

7172
func (kde *kafkaExporter) ExportSpans(ctx context.Context, td data.TraceData) error {
72-
return ocProtoSpansToOCSpanDataInstrumented(ctx, "kafka", kde.exporter, td)
73+
return exporterparser.OcProtoSpansToOCSpanDataInstrumented(ctx, "kafka", kde.exporter, td)
7374
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package exporterparser
15+
package opencensusexporter
1616

1717
import (
1818
"context"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package exporterparser
15+
package prometheusexporter
1616

1717
import (
1818
"context"

exporter/exporterparser/prometheus_test.go renamed to exporter/prometheusexporter/prometheus_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package exporterparser
15+
package prometheusexporter
1616

1717
import (
1818
"context"

0 commit comments

Comments
 (0)