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

Trace ingestion straight to Tempo cloud saas without a collector #1698

Closed
giuliohome opened this issue Aug 28, 2022 · 2 comments
Closed

Trace ingestion straight to Tempo cloud saas without a collector #1698

giuliohome opened this issue Aug 28, 2022 · 2 comments

Comments

@giuliohome
Copy link

giuliohome commented Aug 28, 2022

In principle, I should be able to send a trace to Grafana cloud Tempo (saas) without the collector (even if - agreed of course - if it is better to use the agent or the collector).

But a code like this

no_otel_collector_url = "https://tempo-eu-west-0.grafana.net"
otlp_exporter = OTLPSpanExporter(endpoint=no_otel_collector_url, headers={"authorization": "Basic myencodedtoken")

correctly passing the authentication, still results in no trace shown on grafancloud explore search.
I assume this aspect is related to Grafana cloud and specifically to Tempo Traces ingestion, am I correct? ... that having said, I wonder why the trace sent straight to grafana cloud from my python code without the collector is silently dropped... Indeed, no error code is returned (as it would happen with a wrong token or a wrong auth key instead), hence I'd had expected to find the trace in Grafana Tempo viewer...

Originally posted by @giuliohome in grafana/agent#1977 (comment)

@giuliohome
Copy link
Author

Tested with .NET and it does work, source shown below, there must be something in python code... (will have to dig into it by myself, but the issue here can be closed atm)

            services.AddOpenTelemetryTracing(
                (builder) => builder
                    //https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/docs/trace/customizing-the-sdk/README.md
                    .AddSource("ExampleTracer")
                    .SetResourceBuilder(ResourceBuilder.CreateDefault()
                        .AddService("ServiceA"))
                    // Instrument HttpClient calls and pass on context
                    .AddHttpClientInstrumentation()
                    .AddAspNetCoreInstrumentation()
                    .AddConsoleExporter()
                    .AddOtlpExporter(o =>
                    {
                        o.Endpoint = new Uri("https://tempo-eu-west-0.grafana.net"); //"http://otel-collector:4317");
                        string token = "myencodedtoken";
                        o.Headers = $"Authorization=Basic {token}";
                        o.ExportProcessorType = ExportProcessorType.Simple;
                    }));

        }

for .net part, all the rest can be taken from https://github.com/benbhall/jaeger-opentelemetry-dotnet with otel-collector commented out from docker-compose.yml and Startup.cs modified as shown here above.

@giuliohome
Copy link
Author

giuliohome commented Aug 28, 2022

Solved also for python by upgrade the version from 1.11 to 1.12!

pip install --upgrade opentelemetry-exporter-otlp
pip install --upgrade opentelemetry-sdk

image

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

No branches or pull requests

1 participant