Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azuremonitorexporter does not implement ExportSpans #27053

Closed
itschip opened this issue Sep 21, 2023 · 4 comments
Closed

azuremonitorexporter does not implement ExportSpans #27053

itschip opened this issue Sep 21, 2023 · 4 comments

Comments

@itschip
Copy link

itschip commented Sep 21, 2023

Component(s)

exporter/azuremonitor

Describe the issue you're reporting

I am having trouble understanding why the NewFactory and CreateTracesExporter won't match with the WithBatcher.

func initMonitor() (*sdktrace.TracerProvider, error) {
	key := os.Getenv("INSTRUMENTATION_KEY")
	exporterConfig := azuremonitorexporter.Config{
		InstrumentationKey: configopaque.String(key),
	}

	factory := azuremonitorexporter.NewFactory()

	azExporter, err := factory.CreateTracesExporter(context.Background(), exporter.CreateSettings{}, exporterConfig)
	if err != nil {
		panic(err)
	}

	tp := sdktrace.NewTracerProvider(
		sdktrace.WithSampler(sdktrace.AlwaysSample()),
		sdktrace.WithBatcher(azExporter),
	)

	otel.SetTracerProvider(tp)
	otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))

	return tp, nil
}

azExporter does not implement ExportSpans.

Am I doing something wrong here, or is there something that is outdated?

@itschip itschip added the needs triage New item requiring triage label Sep 21, 2023
@itschip itschip changed the title azuremonitorexporter does nnot implement ExportSpans azuremonitorexporter does not implement ExportSpans Sep 21, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member

crobert-1 commented Oct 6, 2023

I don't believe this is the default functionality of the exporters defined in the OpenTelemetry Collector.

I believe you need to use an exporter defined in this package, which is distinct from the collector and its exporters. You also have some more exporter options defined here.

If your goal is to export data to Azure monitor you have a couple possible options:

  1. If Azure Monitor accepts the OTLP data format for traces, you could try to use the OTLP exporter directly.
  2. If not, use the OTLP exporter to send traces to an instance of the OpenTelemetry Collector, which can then use the azuremonitor to send traces to the backend.

Sorry for the confusion here, I realize multiple usages of the word exporter can be confusing. Let me know if you have any questions, otherwise you can refer to the OpenTelemetry Demo to see how the traces can be exported to the collector, which can then pass them on to the backend of your choice.

Feel free to let me know if I misunderstood your question, or if you have any others!

@crobert-1 crobert-1 added waiting for author and removed needs triage New item requiring triage labels Oct 9, 2023
@crobert-1
Copy link
Member

I'm going to close the issue, but feel free to let us know if you have any other questions!

@crobert-1 crobert-1 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2023
@pavgup
Copy link

pavgup commented Oct 8, 2024

Heyyo! I'm actually trying to do ALMOST exactly the same thing here and I'm also running into this exporter not supporting ExportSpans. Is the AzureMonitorExporter supposed to be used differently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants